File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,13 +20,26 @@ var obstacles = [];
2020
2121for ( var i = 0 ; i < 100 ; i ++ ) {
2222 var geometry = new THREE . BoxGeometry ( 0.2 , 1 , 0.2 ) ;
23- var material = new THREE . MeshNormalMaterial ( { color : 0xff0000 } ) ;
23+ var material = new THREE . MeshStandardMaterial ( { color : 0xff0000 } ) ;
2424 var obstacle = new THREE . Mesh ( geometry , material ) ;
2525 obstacle . position . x = 10 + Math . floor ( Math . random ( ) * 300 ) ;
2626 obstacles . push ( obstacle ) ;
2727 scene . add ( obstacle ) ;
2828}
2929
30+ var lights = [ ] ;
31+ lights [ 0 ] = new THREE . PointLight ( 0xffffff , 1 , 0 ) ;
32+ lights [ 1 ] = new THREE . PointLight ( 0xffffff , 1 , 0 ) ;
33+ lights [ 2 ] = new THREE . PointLight ( 0xffffff , 1 , 0 ) ;
34+
35+ lights [ 0 ] . position . set ( 0 , 200 , 0 ) ;
36+ lights [ 1 ] . position . set ( 100 , 200 , 100 ) ;
37+ lights [ 2 ] . position . set ( - 100 , - 200 , - 100 ) ;
38+
39+ scene . add ( lights [ 0 ] ) ;
40+ scene . add ( lights [ 1 ] ) ;
41+ scene . add ( lights [ 2 ] ) ;
42+
3043var jumping = false ;
3144var jump_distance = 0.1 ;
3245var acceleration = 0.0025 ;
You can’t perform that action at this time.
0 commit comments