equal
deleted
inserted
replaced
132 |
132 |
133 fn create_gear(&mut self, position: Point) { |
133 fn create_gear(&mut self, position: Point) { |
134 if let Some(ref mut state) = self.game_state { |
134 if let Some(ref mut state) = self.game_state { |
135 let id = state.physics.new_gear().unwrap(); |
135 let id = state.physics.new_gear().unwrap(); |
136 let fp_position = FPPoint::new(position.x.into(), position.y.into()); |
136 let fp_position = FPPoint::new(position.x.into(), position.y.into()); |
137 state.physics.add_gear_data( |
137 state.physics.add_gear_data(id, &PositionData(fp_position)); |
138 id, |
138 state |
139 &PositionData(fp_position) |
139 .physics |
140 ); |
140 .add_gear_data(id, &VelocityData(FPPoint::zero())) |
141 state.physics.add_gear_data( |
|
142 id, |
|
143 &VelocityData(FPPoint::zero()) |
|
144 ) |
|
145 } |
141 } |
146 } |
142 } |
147 |
143 |
148 pub fn step(&mut self) { |
144 pub fn step(&mut self) { |
149 if let Some(ref mut state) = self.game_state { |
145 if let Some(ref mut state) = self.game_state { |