File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,11 +6,6 @@ authors = ["bvssvni <bvssvni@gmail.com>"]
66keywords = []
77
88[dependencies .piston_window ]
9- version = " 0.138.2 "
9+ version = " 0.139.0 "
1010features = [" batteries" ]
1111
12- [dependencies ]
13- find_folder = " 0.3.0"
14- piston2d-drag_controller = " 0.30.0"
15- piston2d-deform_grid = " 0.15.0"
16- rand = " 0.8.5"
Original file line number Diff line number Diff line change @@ -115,8 +115,9 @@ impl App{
115115 fn gen_apple_coords ( & mut self , size : [ i32 ; 2 ] ) {
116116 let w: i32 = size[ 0 ] / 10 ;
117117 let h: i32 = size[ 1 ] / 10 ;
118- let mut rng = rand:: thread_rng ( ) ;
119- self . apple = [ 10_i32 * rng. gen_range ( 0 ..w) , 10_i32 * rng. gen_range ( 0 ..h) ] ;
118+ let mut rng = rand:: rng ( ) ;
119+ self . apple = [ 10_i32 * rng. random_range ( 0 ..w) ,
120+ 10_i32 * rng. random_range ( 0 ..h) ] ;
120121 for pos in & self . segments {
121122 if * pos == self . apple {
122123 self . gen_apple_coords ( size) ;
You can’t perform that action at this time.
0 commit comments