|
@@ -149,6 +149,14 @@ impl MainState {
|
149
|
149
|
|
150
|
150
|
if let Some(scene_item_prepare_order) = &self.scene_item_prepare_order {
|
151
|
151
|
// TODO: Add order to scene_item
|
|
152
|
+ match scene_item_prepare_order {
|
|
153
|
+ SceneItemPrepareOrder::Move(scene_item_usize) => {
|
|
154
|
+ let scene_item = self.scene_items.get_mut(*scene_item_usize).expect(SCENE_ITEMS_CHANGE_ERR_MSG);
|
|
155
|
+ let angle = f32::atan2(scene_position.y - scene_item.position.y, scene_position.x - scene_item.position.x) + f32::consts::FRAC_PI_2;
|
|
156
|
+ println!("{:?}", angle);
|
|
157
|
+ }
|
|
158
|
+ }
|
|
159
|
+
|
152
|
160
|
self.scene_item_prepare_order = None;
|
153
|
161
|
}
|
154
|
162
|
|
|
@@ -521,9 +529,9 @@ impl event::EventHandler for MainState {
|
521
|
529
|
graphics::clear(ctx, graphics::BLACK);
|
522
|
530
|
let mut scene_mesh_builder = MeshBuilder::new();
|
523
|
531
|
|
524
|
|
- self.generate_scene_item_sprites();
|
525
|
|
- self.generate_scene_item_menu_sprites();
|
526
|
|
- self.generate_map_sprites();
|
|
532
|
+ self.generate_scene_item_sprites()?;
|
|
533
|
+ self.generate_scene_item_menu_sprites()?;
|
|
534
|
+ self.generate_map_sprites()?;
|
527
|
535
|
|
528
|
536
|
scene_mesh_builder = self.update_mesh_builder_with_debug(scene_mesh_builder)?;
|
529
|
537
|
scene_mesh_builder = self.update_mesh_builder_with_selected_items(scene_mesh_builder)?;
|
|
@@ -547,7 +555,7 @@ impl event::EventHandler for MainState {
|
547
|
555
|
|
548
|
556
|
graphics::present(ctx)?;
|
549
|
557
|
|
550
|
|
- println!("FPS: {}", ggez::timer::fps(ctx));
|
|
558
|
+ // println!("FPS: {}", ggez::timer::fps(ctx));
|
551
|
559
|
Ok(())
|
552
|
560
|
}
|
553
|
561
|
|