config.rs 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // execute update code 60x per seconds
  2. pub const TARGET_FPS: u32 = 60;
  3. // execute meta code each 20 frames
  4. pub const META_EACH: u32 = 20;
  5. // execute physics code each 10 frames
  6. pub const PHYSICS_EACH: u32 = 10;
  7. // execute animate code each 30 frames
  8. pub const ANIMATE_EACH: u32 = 60;
  9. // change sprite animation tile 30 frames
  10. pub const SPRITE_EACH: u32 = 10;
  11. // max of frame_i used to calculate ticks
  12. pub const MAX_FRAME_I: u32 = 4294967295;
  13. // pixel offset by tick when player move screen display
  14. pub const DISPLAY_OFFSET_BY: f32 = 3.0;
  15. // pixel offset by tick when player move screen display with speed
  16. pub const DISPLAY_OFFSET_BY_SPEED: f32 = 10.0;
  17. // Width of sprite sheet
  18. pub const SCENE_ITEMS_SPRITE_SHEET_WIDTH: f32 = 800.0;
  19. // Height of sprite sheet
  20. pub const SCENE_ITEMS_SPRITE_SHEET_HEIGHT: f32 = 600.0;
  21. // Width of sprite sheet
  22. pub const UI_SPRITE_SHEET_WIDTH: f32 = 800.0;
  23. // Height of sprite sheet
  24. pub const UI_SPRITE_SHEET_HEIGHT: f32 = 600.0;
  25. // Width of one grid tile
  26. pub const GRID_TILE_WIDTH: f32 = 5.0;
  27. // Height of one grid tile
  28. pub const GRID_TILE_HEIGHT: f32 = 5.0;
  29. //
  30. pub const DEFAULT_SELECTED_SQUARE_SIDE: f32 = 14.0;
  31. //
  32. pub const DEFAULT_SELECTED_SQUARE_SIDE_HALF: f32 = DEFAULT_SELECTED_SQUARE_SIDE / 2.0;
  33. //
  34. pub const SCENE_ITEMS_CHANGE_ERR_MSG: &str = "scene_items content change !";
  35. //
  36. pub const DEBUG: bool = true;
  37. // Distance from move target point to consider reached
  38. pub const MOVE_TO_REACHED_WHEN_DISTANCE_INFERIOR_AT: f32 = 3.0;
  39. // Velocity of move vector
  40. pub const MOVE_VELOCITY: f32 = 1.0;
  41. // Velocity of move fast vector
  42. pub const MOVE_FAST_VELOCITY: f32 = 2.0;
  43. // Velocity of move hide vector
  44. pub const MOVE_HIDE_VELOCITY: f32 = 0.5;