├── src ├── util │ ├── run_criteria │ │ └── mod.rs │ ├── helper_systems │ │ ├── mod.rs │ │ └── despawn_recursive_system.rs │ ├── mod.rs │ ├── debug │ │ ├── mod.rs │ │ └── show_quad_tree_system.rs │ ├── read_file_to_string.rs │ ├── get_close_position_2d.rs │ └── stage_label_helper.rs ├── units │ ├── modifications │ │ ├── statuse │ │ │ ├── helper │ │ │ │ └── mod.rs │ │ │ ├── mod.rs │ │ │ └── burn_system.rs │ │ ├── effect │ │ │ ├── mod.rs │ │ │ ├── apply_effect_add_health_system.rs │ │ │ └── apply_effect_damage_health_system.rs │ │ ├── projectile_modifications │ │ │ ├── helper │ │ │ │ ├── mod.rs │ │ │ │ └── enable_projectile_collision.rs │ │ │ ├── grow_shot_system.rs │ │ │ ├── curve_shot_system.rs │ │ │ └── burning_shot_system.rs │ │ └── helper │ │ │ ├── mod.rs │ │ │ ├── remove_player_mod_from_target_system.rs │ │ │ ├── mod_list_deregister_system.rs │ │ │ ├── apply_player_mod_to_target_system.rs │ │ │ ├── mod_list_register_system.rs │ │ │ ├── apply_affect_system.rs │ │ │ ├── remove_affect_system.rs │ │ │ └── despawn_companion_from_mod_system.rs │ ├── layerable_system.rs │ ├── enemies │ │ ├── despawn_dead_enemy_system.rs │ │ ├── despawn_far_enemy_system.rs │ │ └── mod.rs │ ├── guns │ │ ├── gun_reloading_timer_system.rs │ │ └── mod.rs │ ├── behaviors │ │ ├── mono_directional_move_behavior_system.rs │ │ ├── spin_aim_behavior_system.rs │ │ ├── chase_target_behavior_system.rs │ │ ├── teleport_to_target_behavior_system.rs │ │ ├── aim_at_closest_target_behavior_system.rs │ │ └── turn_to_target_behavior_system.rs │ ├── player │ │ └── player_died_system.rs │ ├── rotate_unit_system.rs │ ├── time_alive_system.rs │ ├── projectile │ │ ├── projectile_despawn_system.rs │ │ └── projectile_check_stop_system.rs │ ├── level_up_system.rs │ ├── mirror_aim_to_move_direction_system.rs │ ├── sprite_aim_rotate_system.rs │ ├── sprite_move_rotate_system.rs │ ├── inherit_unit_size_system.rs │ ├── unit_push_system.rs │ ├── apply_damaged_component_system.rs │ ├── clear_damaged_entities_system.rs │ ├── knock_back_system.rs │ ├── health_bar_update_system.rs │ ├── sprite_flip_system.rs │ ├── move_unit_system.rs │ └── apply_hit_effect_system.rs ├── models │ ├── bundles │ │ ├── mod.rs │ │ └── damage_bundle.rs │ ├── modifications │ │ ├── statuses │ │ │ ├── mod.rs │ │ │ └── burning.rs │ │ ├── utils │ │ │ ├── mod.rs │ │ │ ├── associate_component.rs │ │ │ └── owner.rs │ │ ├── effects │ │ │ ├── mod.rs │ │ │ ├── effect_add_health.rs │ │ │ └── effect_damage_health.rs │ │ ├── low_cal.rs │ │ ├── blue_pill.rs │ │ ├── sprinting.rs │ │ ├── descriptors │ │ │ ├── modification.rs │ │ │ ├── sprite_path_wrapper.rs │ │ │ ├── mod.rs │ │ │ ├── mod_name.rs │ │ │ ├── price.rs │ │ │ ├── tool_tip.rs │ │ │ └── mod_sprite_path.rs │ │ ├── glass_cannon.rs │ │ ├── split_shot.rs │ │ ├── curve_shot.rs │ │ ├── slime.rs │ │ ├── affects │ │ │ ├── affect_operator.rs │ │ │ ├── projectile_affects │ │ │ │ ├── mod.rs │ │ │ │ ├── affect_projectile_damage.rs │ │ │ │ ├── affect_projectile_hit_limit.rs │ │ │ │ ├── affect_projectile_travel_range.rs │ │ │ │ ├── affect_projectile_unit_size.rs │ │ │ │ └── affect_projectile_move_speed.rs │ │ │ ├── mod.rs │ │ │ ├── affect_damage.rs │ │ │ ├── affect_health.rs │ │ │ ├── affect_reload.rs │ │ │ ├── affect_hit_limit.rs │ │ │ ├── affect_unit_size.rs │ │ │ ├── affect_travel_range.rs │ │ │ ├── affect_move_speed.rs │ │ │ └── attribute_affect.rs │ │ ├── grow_shot.rs │ │ ├── burning_shot.rs │ │ ├── magnet.rs │ │ ├── explosion_shot.rs │ │ ├── gravity_shot.rs │ │ ├── radiation.rs │ │ ├── lightning.rs │ │ ├── death_ball.rs │ │ ├── shield.rs │ │ ├── acid_puddle.rs │ │ ├── turret.rs │ │ ├── psy_rock.rs │ │ ├── mod.rs │ │ └── knock_back_shot.rs │ ├── events │ │ ├── level_finished_event.rs │ │ ├── debug_command_info_event.rs │ │ ├── player_died_event.rs │ │ ├── target_died_event.rs │ │ ├── projectile_stopped_event.rs │ │ ├── enemy_collision_event.rs │ │ ├── projectile_shot_event.rs │ │ ├── item_collision_event.rs │ │ ├── player_enemy_collision_event.rs │ │ ├── apply_mod_to_target_event.rs │ │ ├── remove_mod_from_target_event.rs │ │ ├── debug_command_event.rs │ │ └── damaged_event.rs │ ├── audio │ │ ├── mod.rs │ │ ├── sound_channel.rs │ │ └── sound_handle_channel.rs │ ├── gun │ │ ├── mod.rs │ │ ├── basic_sword.rs │ │ └── straight_basic_shot.rs │ ├── items │ │ ├── mod.rs │ │ ├── descriptor │ │ │ ├── mod.rs │ │ │ ├── item.rs │ │ │ ├── heal.rs │ │ │ └── gold_value.rs │ │ ├── coin.rs │ │ └── shop.rs │ ├── world │ │ ├── mod.rs │ │ ├── goal.rs │ │ └── goal_activation_progress.rs │ ├── input │ │ ├── mod.rs │ │ ├── player_aim_controlled.rs │ │ └── player_move_controlled.rs │ ├── configurations │ │ ├── raw_configs │ │ │ ├── mod.rs │ │ │ └── enemy_behavior.rs │ │ ├── coin_config.rs │ │ ├── barrel_config.rs │ │ ├── mod.rs │ │ ├── hot_dog_config.rs │ │ ├── spawner_config.rs │ │ ├── mod_config.rs │ │ ├── player_config.rs │ │ ├── projectile_config.rs │ │ └── world_grid_config.rs │ ├── enemy.rs │ ├── resources │ │ ├── ui_states │ │ │ ├── mod.rs │ │ │ ├── hud_state.rs │ │ │ ├── info_window_state.rs │ │ │ └── shop_state.rs │ │ ├── collision │ │ │ ├── mod.rs │ │ │ ├── hit_box_quad_tree.rs │ │ │ ├── item_collision_quad_tree.rs │ │ │ └── solid_body_quad_tree.rs │ │ ├── world │ │ │ ├── mod.rs │ │ │ ├── game_time.rs │ │ │ ├── background_tiles_resource.rs │ │ │ ├── active_stage.rs │ │ │ └── spawn_task_receiver.rs │ │ └── shop_customer.rs │ ├── tile.rs │ ├── player.rs │ ├── ui │ │ ├── pause.rs │ │ ├── navigation_button.rs │ │ ├── debug_console_history.rs │ │ ├── mod.rs │ │ ├── health_bar.rs │ │ ├── tooltip_window.rs │ │ └── shop.rs │ ├── main_camera.rs │ ├── sprite_flip.rs │ ├── mod_container.rs │ ├── collision │ │ ├── item_collider.rs │ │ ├── enemy_hit_box_collider.rs │ │ ├── enemy_solid_body_collider.rs │ │ ├── collider_weight.rs │ │ ├── collider_owner.rs │ │ ├── hit_box_collider.rs │ │ ├── mod.rs │ │ └── solid_body_collider.rs │ ├── inherit_unit_size.rs │ ├── sprite_aim_rotation.rs │ ├── attribute_container.rs │ ├── behavior │ │ ├── spin_aim_behavior.rs │ │ ├── aim_at_closest_target_behavior.rs │ │ ├── rotate_behavior.rs │ │ ├── steering_behavior.rs │ │ ├── mono_directional_move_behavior.rs │ │ ├── chase_target_behavior.rs │ │ ├── turn_to_target_behavior.rs │ │ ├── mod.rs │ │ ├── teleporting_script.rs │ │ └── teleport_to_target_behavior.rs │ ├── child_projectile.rs │ ├── sprite_move_rotation.rs │ ├── mirror_aim_to_move_direction.rs │ ├── time_alive.rs │ ├── animation │ │ ├── mod.rs │ │ ├── fade_animation.rs │ │ ├── animation_state.rs │ │ ├── idle_animation_component.rs │ │ └── walking_animation_component.rs │ ├── gold_storage.rs │ ├── weapon_slot.rs │ ├── mod_register.rs │ ├── move_direction.rs │ ├── projectile.rs │ ├── spawner │ │ ├── enemy_spawn.rs │ │ ├── mod.rs │ │ ├── enemy_config_handle.rs │ │ ├── spawn_stage.rs │ │ ├── spawn_pattern.rs │ │ ├── spawn_task.rs │ │ ├── spawn_phase.rs │ │ └── enemy_config.rs │ ├── aim_direction.rs │ ├── mod_container_slot.rs │ ├── attribute_container_slot.rs │ ├── knock_back.rs │ ├── unit_push.rs │ ├── unit_attributes │ │ ├── mod.rs │ │ ├── attribute.rs │ │ ├── damage.rs │ │ ├── move_speed.rs │ │ ├── damage_interval.rs │ │ ├── reload.rs │ │ ├── hit_limit.rs │ │ └── travel_range.rs │ ├── damaged_effect.rs │ ├── visited_shop.rs │ ├── layerable.rs │ ├── damaged_entities.rs │ ├── sprite_layer.rs │ └── mod.rs ├── ui │ ├── update │ │ ├── mod.rs │ │ └── update_hud_state.rs │ ├── views │ │ ├── mod.rs │ │ ├── show_game_over_system.rs │ │ └── show_game_won_system.rs │ ├── debug │ │ ├── update_info_fps_system.rs │ │ ├── show_info_attribute_value_system.rs │ │ ├── show_info_info_system.rs │ │ ├── update_console_history.rs │ │ └── show_info_gun_attribute_value_system.rs │ └── main_menu │ │ └── mod.rs ├── world │ ├── game_time_system.rs │ ├── spawner │ │ └── mod.rs │ ├── mod.rs │ ├── background │ │ ├── move_background_tiles_system.rs │ │ └── mod.rs │ └── drops │ │ ├── coin_pickup_system.rs │ │ └── hot_dog_pickup_system.rs ├── assets_handling │ ├── preload_spawner_config_system.rs │ ├── preload_world_grid_config_system.rs │ ├── preload_player_system.rs │ ├── preload_projectile_system.rs │ ├── preload_mod_system.rs │ ├── preload_stage_spawn_system.rs │ ├── preload_audio_system.rs │ ├── preload_item_system.rs │ ├── preload_animation_system.rs │ └── preload_enemy_system.rs ├── animation │ ├── animation_move_side_state_handle_system.rs │ ├── animation_move_idle_state_handle_system.rs │ ├── animation_move_up_state_handle_system.rs │ ├── animation_move_down_state_handle_system.rs │ ├── idle_animation_system.rs │ ├── movement_animation_up_system.rs │ ├── movement_animation_down_system.rs │ └── movement_animation_side_system.rs ├── audio │ ├── background_music_system.rs │ └── mod.rs ├── scheduling │ └── mod.rs ├── input │ ├── player_control_movement_system.rs │ ├── player_control_aim_system.rs │ ├── setup_camera_systems.rs │ └── toggle_pause_system.rs └── collision │ ├── calculate_item_quad_tree_system.rs │ ├── calculate_hit_box_quad_tree_system.rs │ └── item_player_collision_system.rs ├── rust-toolchain.toml ├── .DS_Store ├── .gitignore ├── configurations ├── spawner_config.json ├── barrel.json ├── coin.json ├── hot_dog.json ├── player.json ├── world_grid.json ├── projectile.json ├── mods │ ├── slime.json │ ├── curve_shot.json │ ├── split_shot.json │ ├── grow_shot.json │ ├── burning_shot.json │ ├── radiation.json │ ├── acid_puddle.json │ ├── death_ball.json │ ├── magnet.json │ ├── knock_back_shot.json │ ├── sprinting.json │ ├── explosion_shot.json │ ├── lightning.json │ ├── gravity_shot.json │ ├── shield.json │ ├── turret.json │ ├── psy_rock.json │ ├── glass_cannon.json │ ├── low_cal.json │ └── blue_pill.json ├── stages │ ├── circle_level.json │ ├── random_level.json │ ├── grouped_level.json │ └── sided_level.json └── enemies │ ├── 0_bee.json │ ├── 4_orc.json │ ├── 6_bee_big.json │ ├── 1_goblin.json │ ├── 3_kobold.json │ ├── 5_circle_goblin.json │ ├── 2_bug.json │ ├── 7_grouped_bug.json │ ├── 9_vertical_orc.json │ └── 8_horizontal_kobold.json ├── .idea ├── vcs.xml ├── misc.xml ├── .gitignore └── modules.xml ├── survival_game.iml └── LICENSE /src/util/run_criteria/mod.rs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/units/modifications/statuse/helper/mod.rs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/models/bundles/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod damage_bundle; 2 | -------------------------------------------------------------------------------- /rust-toolchain.toml: -------------------------------------------------------------------------------- 1 | [toolchain] 2 | channel = "nightly" -------------------------------------------------------------------------------- /src/models/modifications/statuses/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod burning; -------------------------------------------------------------------------------- /src/util/helper_systems/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod despawn_recursive_system; 2 | -------------------------------------------------------------------------------- /src/models/events/level_finished_event.rs: -------------------------------------------------------------------------------- 1 | pub struct LevelFinishedEvent; -------------------------------------------------------------------------------- /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pflanzmann/survival_game/HEAD/.DS_Store -------------------------------------------------------------------------------- /src/ui/update/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod update_hud_state; 2 | pub mod update_shop_state; -------------------------------------------------------------------------------- /src/models/audio/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod sound_handle_channel; 2 | pub mod sound_channel; -------------------------------------------------------------------------------- /src/models/gun/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod straight_basic_shot; 2 | pub mod basic_sword; 3 | -------------------------------------------------------------------------------- /src/models/items/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod shop; 2 | pub mod descriptor; 3 | pub mod coin; 4 | -------------------------------------------------------------------------------- /src/models/world/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod goal_activation_progress; 2 | pub mod goal; 3 | -------------------------------------------------------------------------------- /src/models/modifications/utils/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod owner; 2 | pub mod associate_component; -------------------------------------------------------------------------------- /src/models/input/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod player_aim_controlled; 2 | pub mod player_move_controlled; 3 | -------------------------------------------------------------------------------- /src/models/items/descriptor/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod heal; 2 | pub mod item; 3 | pub mod gold_value; 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /assets 2 | /target 3 | .idea/runConfigurations.xml 4 | console_history.json 5 | 6 | ZedSave -------------------------------------------------------------------------------- /src/models/configurations/raw_configs/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod raw_enemy_config; 2 | pub mod enemy_behavior; 3 | -------------------------------------------------------------------------------- /src/models/modifications/effects/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod effect_add_health; 2 | pub mod effect_damage_health; -------------------------------------------------------------------------------- /src/models/enemy.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | 3 | #[derive(Component)] 4 | pub struct Enemy; 5 | -------------------------------------------------------------------------------- /src/models/resources/ui_states/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod hud_state; 2 | pub mod info_window_state; 3 | pub mod shop_state; -------------------------------------------------------------------------------- /src/models/tile.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | 3 | #[derive(Component)] 4 | pub struct Tile; 5 | -------------------------------------------------------------------------------- /src/models/world/goal.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | 3 | #[derive(Component)] 4 | pub struct Goal; -------------------------------------------------------------------------------- /src/models/items/coin.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | 3 | #[derive(Component)] 4 | pub struct Coin; 5 | -------------------------------------------------------------------------------- /src/models/items/shop.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | 3 | #[derive(Component)] 4 | pub struct Shop; 5 | -------------------------------------------------------------------------------- /src/models/player.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | 3 | #[derive(Component)] 4 | pub struct Player; 5 | -------------------------------------------------------------------------------- /src/models/ui/pause.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | 3 | #[derive(Component)] 4 | pub struct PauseMenuComp; -------------------------------------------------------------------------------- /src/models/events/debug_command_info_event.rs: -------------------------------------------------------------------------------- 1 | pub struct DebugCommandInfoEvent { 2 | pub debug_command: String, 3 | } -------------------------------------------------------------------------------- /src/models/items/descriptor/item.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | 3 | #[derive(Component)] 4 | pub struct Item; -------------------------------------------------------------------------------- /src/models/main_camera.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | 3 | #[derive(Component)] 4 | pub struct MainCamera; 5 | -------------------------------------------------------------------------------- /src/models/sprite_flip.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | 3 | #[derive(Component)] 4 | pub struct SpriteFlip; 5 | -------------------------------------------------------------------------------- /src/models/gun/basic_sword.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | 3 | #[derive(Component)] 4 | pub struct BasicSword; 5 | -------------------------------------------------------------------------------- /src/models/mod_container.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | 3 | #[derive(Component)] 4 | pub struct ModContainer; 5 | -------------------------------------------------------------------------------- /src/units/modifications/effect/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod apply_effect_add_health_system; 2 | pub mod apply_effect_damage_health_system; 3 | -------------------------------------------------------------------------------- /src/models/audio/sound_channel.rs: -------------------------------------------------------------------------------- 1 | pub enum SoundChannel { 2 | Pickup, 3 | Projectile, 4 | Misc, 5 | Background, 6 | } -------------------------------------------------------------------------------- /src/models/collision/item_collider.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | 3 | #[derive(Component)] 4 | pub struct ItemCollider; -------------------------------------------------------------------------------- /src/models/inherit_unit_size.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | 3 | #[derive(Component)] 4 | pub struct InheritUnitSize; -------------------------------------------------------------------------------- /configurations/spawner_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "spawn_range": 3840.0, 3 | "spawn_range_offset": 512.0, 4 | "max_spawns_per_frame": 20 5 | } -------------------------------------------------------------------------------- /src/models/sprite_aim_rotation.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | 3 | #[derive(Component)] 4 | pub struct SpriteAimRotation; 5 | -------------------------------------------------------------------------------- /src/models/ui/navigation_button.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | 3 | #[derive(Component)] 4 | pub struct NavigationButton; 5 | -------------------------------------------------------------------------------- /src/models/attribute_container.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | 3 | #[derive(Component)] 4 | pub struct AttributeContainer; 5 | -------------------------------------------------------------------------------- /src/models/behavior/spin_aim_behavior.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | 3 | #[derive(Component)] 4 | pub struct SpinAimBehavior; 5 | -------------------------------------------------------------------------------- /src/models/child_projectile.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | 3 | #[derive(Copy, Clone, Component)] 4 | pub struct ChildProjectile; -------------------------------------------------------------------------------- /src/models/gun/straight_basic_shot.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | 3 | #[derive(Component)] 4 | pub struct StraightBasicShot; 5 | -------------------------------------------------------------------------------- /src/models/resources/collision/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod hit_box_quad_tree; 2 | pub mod item_collision_quad_tree; 3 | pub mod solid_body_quad_tree; 4 | -------------------------------------------------------------------------------- /src/models/sprite_move_rotation.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | 3 | #[derive(Component)] 4 | pub struct SpriteMoveRotation; 5 | -------------------------------------------------------------------------------- /src/models/collision/enemy_hit_box_collider.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | 3 | #[derive(Component)] 4 | pub struct EnemyHitBoxCollider; -------------------------------------------------------------------------------- /src/models/events/player_died_event.rs: -------------------------------------------------------------------------------- 1 | use bevy::prelude::Entity; 2 | 3 | pub struct PlayerDiedEvent { 4 | pub player_entity: Entity, 5 | } 6 | -------------------------------------------------------------------------------- /src/models/events/target_died_event.rs: -------------------------------------------------------------------------------- 1 | use bevy::prelude::Entity; 2 | 3 | pub struct TargetDiedEvent { 4 | pub target_entity: Entity, 5 | } 6 | -------------------------------------------------------------------------------- /src/models/input/player_aim_controlled.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | 3 | #[derive(Component)] 4 | pub struct PlayerAimControlled; 5 | -------------------------------------------------------------------------------- /src/models/ui/debug_console_history.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | 3 | #[derive(Component)] 4 | pub struct DebugConsoleHistory; 5 | -------------------------------------------------------------------------------- /src/ui/views/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod show_hud_system; 2 | pub mod show_game_over_system; 3 | pub mod show_game_won_system; 4 | pub mod show_shop_system; 5 | -------------------------------------------------------------------------------- /configurations/barrel.json: -------------------------------------------------------------------------------- 1 | { 2 | "sprite_custom_size_x": 128.0, 3 | "sprite_custom_size_y": 128.0, 4 | "sprite_path": "sprites/barrel.png" 5 | } -------------------------------------------------------------------------------- /configurations/coin.json: -------------------------------------------------------------------------------- 1 | { 2 | "sprite_custom_size_x": 128.0, 3 | "sprite_custom_size_y": 128.0, 4 | "sprite_path": "sprites/basic_drop.png" 5 | } -------------------------------------------------------------------------------- /src/models/input/player_move_controlled.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | 3 | #[derive(Component)] 4 | pub struct PlayerMoveControlled; 5 | -------------------------------------------------------------------------------- /src/models/mirror_aim_to_move_direction.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | 3 | #[derive(Component)] 4 | pub struct MirrorAimToMoveDirection; -------------------------------------------------------------------------------- /src/models/time_alive.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | 3 | #[derive(Component)] 4 | pub struct TimeAlive { 5 | pub time_alive: f32, 6 | } -------------------------------------------------------------------------------- /src/models/animation/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod walking_animation_component; 2 | pub mod idle_animation_component; 3 | pub mod animation_state; 4 | pub mod fade_animation; -------------------------------------------------------------------------------- /src/models/collision/enemy_solid_body_collider.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | 3 | #[derive(Component)] 4 | pub struct EnemySolidBodyCollider; -------------------------------------------------------------------------------- /src/models/resources/world/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod background_tiles_resource; 2 | pub mod active_stage; 3 | pub mod spawn_task_receiver; 4 | pub mod game_time; 5 | -------------------------------------------------------------------------------- /src/models/items/descriptor/heal.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | 3 | #[derive(Component)] 4 | pub struct Heal { 5 | pub amount: f32, 6 | } 7 | -------------------------------------------------------------------------------- /src/models/behavior/aim_at_closest_target_behavior.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | 3 | #[derive(Component)] 4 | pub struct AimAtClosestTargetBehavior; 5 | -------------------------------------------------------------------------------- /src/models/collision/collider_weight.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | 3 | #[derive(Component)] 4 | pub struct ColliderWeight { 5 | pub weight: f32, 6 | } -------------------------------------------------------------------------------- /src/models/events/projectile_stopped_event.rs: -------------------------------------------------------------------------------- 1 | use bevy::prelude::Entity; 2 | 3 | pub struct ProjectileStoppedEvent { 4 | pub projectile_entity: Entity, 5 | } 6 | -------------------------------------------------------------------------------- /src/models/gold_storage.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | 3 | #[derive(Component, Default)] 4 | pub struct GoldStorage { 5 | pub number: i32, 6 | } 7 | -------------------------------------------------------------------------------- /src/models/animation/fade_animation.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | 3 | #[derive(Component)] 4 | pub struct FadeAnimation { 5 | pub fade_time: f32, 6 | } -------------------------------------------------------------------------------- /src/models/resources/world/game_time.rs: -------------------------------------------------------------------------------- 1 | use bevy::prelude::Resource; 2 | 3 | #[derive(Default, Resource)] 4 | pub struct GameTime { 5 | pub time_in_seconds: f64, 6 | } -------------------------------------------------------------------------------- /src/models/ui/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod shop; 2 | pub mod health_bar; 3 | pub mod pause; 4 | pub mod navigation_button; 5 | pub mod debug_console_history; 6 | pub mod tooltip_window; -------------------------------------------------------------------------------- /configurations/hot_dog.json: -------------------------------------------------------------------------------- 1 | { 2 | "sprite_custom_size_x": 128.0, 3 | "sprite_custom_size_y": 128.0, 4 | "sprite_path": "sprites/hot_dog.png", 5 | "heal_amount": 20.0 6 | } -------------------------------------------------------------------------------- /src/models/behavior/rotate_behavior.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | 3 | #[derive(Component)] 4 | pub struct UnitRotation { 5 | pub revolutions_per_min: f32, 6 | } -------------------------------------------------------------------------------- /src/models/behavior/steering_behavior.rs: -------------------------------------------------------------------------------- 1 | use bevy::prelude::*; 2 | 3 | #[derive(Component, Default)] 4 | pub struct SteeringBehavior { 5 | pub direction: Vec2, 6 | } 7 | -------------------------------------------------------------------------------- /src/models/items/descriptor/gold_value.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | 3 | #[derive(Component)] 4 | pub struct GoldValue { 5 | pub gold_value: i32, 6 | } 7 | -------------------------------------------------------------------------------- /src/models/modifications/low_cal.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | use serde::Deserialize; 3 | 4 | #[derive(Copy, Clone, Component, Deserialize)] 5 | pub struct LowCal; -------------------------------------------------------------------------------- /src/models/modifications/blue_pill.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | use serde::Deserialize; 3 | 4 | #[derive(Copy, Clone, Component, Deserialize)] 5 | pub struct BluePill; -------------------------------------------------------------------------------- /src/models/modifications/sprinting.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | use serde::Deserialize; 3 | 4 | #[derive(Copy, Clone, Component, Deserialize)] 5 | pub struct Sprinting; -------------------------------------------------------------------------------- /src/models/modifications/utils/associate_component.rs: -------------------------------------------------------------------------------- 1 | use bevy::prelude::Component; 2 | 3 | pub trait AssociateComponent { 4 | fn get_component(&self) -> T; 5 | } -------------------------------------------------------------------------------- /src/models/world/goal_activation_progress.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | 3 | #[derive(Component)] 4 | pub struct GoalActivationProgress { 5 | pub progress: f32, 6 | } -------------------------------------------------------------------------------- /src/models/events/enemy_collision_event.rs: -------------------------------------------------------------------------------- 1 | use bevy::prelude::Entity; 2 | 3 | pub struct EnemyCollisionEvent { 4 | pub target_entity: Entity, 5 | pub source_entity: Entity, 6 | } -------------------------------------------------------------------------------- /src/models/events/projectile_shot_event.rs: -------------------------------------------------------------------------------- 1 | use bevy::prelude::{Entity, Resource}; 2 | 3 | #[derive(Resource)] 4 | pub struct ProjectileShotEvent { 5 | pub entity: Entity, 6 | } 7 | -------------------------------------------------------------------------------- /src/models/modifications/descriptors/modification.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | use serde::Deserialize; 3 | 4 | #[derive(Component, Deserialize)] 5 | pub struct Modification; -------------------------------------------------------------------------------- /src/models/modifications/descriptors/sprite_path_wrapper.rs: -------------------------------------------------------------------------------- 1 | use serde::Deserialize; 2 | 3 | #[derive(Deserialize)] 4 | pub struct SpritePathWrapper { 5 | pub path: String, 6 | } 7 | -------------------------------------------------------------------------------- /src/models/modifications/glass_cannon.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | use serde::Deserialize; 3 | 4 | #[derive(Copy, Clone, Component, Deserialize)] 5 | pub struct GlassCannon; -------------------------------------------------------------------------------- /src/models/resources/shop_customer.rs: -------------------------------------------------------------------------------- 1 | use bevy::prelude::{Entity, Resource}; 2 | 3 | #[derive(Default, Resource)] 4 | pub struct ShopCustomer { 5 | pub customer: Option, 6 | } -------------------------------------------------------------------------------- /src/models/modifications/split_shot.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | use serde::Deserialize; 3 | 4 | #[derive(Copy, Clone, Component, Deserialize)] 5 | pub struct SplitShot; 6 | -------------------------------------------------------------------------------- /src/models/ui/health_bar.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | use bevy::prelude::Entity; 3 | 4 | #[derive(Component)] 5 | pub struct HealthBar { 6 | pub owner: Entity, 7 | } 8 | -------------------------------------------------------------------------------- /src/models/events/item_collision_event.rs: -------------------------------------------------------------------------------- 1 | use bevy::prelude::Entity; 2 | 3 | pub struct ItemCollisionEvent { 4 | pub source_entity: Entity, 5 | pub target_entity: Entity, 6 | } 7 | 8 | -------------------------------------------------------------------------------- /src/models/modifications/curve_shot.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | use serde::Deserialize; 3 | 4 | #[derive(Copy, Clone, Hash, Component, Deserialize)] 5 | pub struct CurveShot; 6 | -------------------------------------------------------------------------------- /src/models/modifications/descriptors/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod mod_name; 2 | pub mod mod_sprite_path; 3 | pub mod tool_tip; 4 | pub mod modification; 5 | pub mod price; 6 | pub mod sprite_path_wrapper; 7 | -------------------------------------------------------------------------------- /src/models/weapon_slot.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | use bevy::prelude::Entity; 3 | 4 | #[derive(Component)] 5 | pub struct WeaponSlot { 6 | pub weapon_entity: Entity, 7 | } 8 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /configurations/player.json: -------------------------------------------------------------------------------- 1 | { 2 | "sprite_custom_size_x": 256.0, 3 | "sprite_custom_size_y": 256.0, 4 | "move_speed": 15.0, 5 | "damage": 5.0, 6 | "health": 20.0, 7 | "reload": 80.0 8 | } 9 | -------------------------------------------------------------------------------- /src/models/events/player_enemy_collision_event.rs: -------------------------------------------------------------------------------- 1 | use bevy::prelude::Entity; 2 | 3 | pub struct PlayerEnemyCollisionEvent { 4 | pub player_entity: Entity, 5 | pub enemy_entity: Entity, 6 | } 7 | -------------------------------------------------------------------------------- /src/models/mod_register.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | use bevy::prelude::Entity; 3 | 4 | #[derive(Component, Default)] 5 | pub struct ModRegister { 6 | pub register: Vec, 7 | } -------------------------------------------------------------------------------- /src/models/move_direction.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | use bevy::prelude::Vec2; 3 | 4 | #[derive(Component, Default)] 5 | pub struct MoveDirection { 6 | pub direction: Vec2, 7 | } 8 | -------------------------------------------------------------------------------- /src/models/projectile.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | use bevy::prelude::Entity; 3 | 4 | #[derive(Copy, Clone, Component)] 5 | pub struct Projectile { 6 | pub source_entity: Entity, 7 | } -------------------------------------------------------------------------------- /src/models/spawner/enemy_spawn.rs: -------------------------------------------------------------------------------- 1 | use serde::Deserialize; 2 | 3 | #[derive(Default, Deserialize, Clone)] 4 | pub struct EnemySpawn { 5 | pub enemy_index: usize, 6 | pub spawn_weight: f32, 7 | } -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/models/aim_direction.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | use bevy::prelude::Vec2; 3 | 4 | #[derive(Component, Default)] 5 | pub struct AimDirection { 6 | pub direction: Vec2, 7 | } 8 | 9 | -------------------------------------------------------------------------------- /src/models/resources/world/background_tiles_resource.rs: -------------------------------------------------------------------------------- 1 | use bevy::prelude::{Vec2, Resource}; 2 | 3 | #[derive(Resource)] 4 | pub struct BackgroundTilesResource { 5 | pub current_origin: Vec2, 6 | } 7 | -------------------------------------------------------------------------------- /src/util/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod read_file_to_string; 2 | pub mod entity_builder; 3 | pub mod get_close_position_2d; 4 | pub mod run_criteria; 5 | pub mod quad_tree; 6 | pub mod debug; 7 | pub mod helper_systems; 8 | -------------------------------------------------------------------------------- /src/models/spawner/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod spawn_task; 2 | pub mod enemy_config; 3 | pub mod enemy_config_handle; 4 | pub mod spawn_phase; 5 | pub mod enemy_spawn; 6 | pub mod spawn_stage; 7 | pub mod spawn_pattern; 8 | -------------------------------------------------------------------------------- /configurations/world_grid.json: -------------------------------------------------------------------------------- 1 | { 2 | "generated_background_radius_x": 36, 3 | "generated_background_radius_y": 36, 4 | "background_step_distance": 1000, 5 | "noise_scale": 30.0, 6 | "tile_size": 256.0 7 | } -------------------------------------------------------------------------------- /src/models/collision/collider_owner.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | use bevy::prelude::{Deref, DerefMut, Entity}; 3 | 4 | #[derive(Component, Deref, DerefMut)] 5 | pub struct ColliderOwner(pub Entity); 6 | -------------------------------------------------------------------------------- /src/models/mod_container_slot.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | use bevy::prelude::Entity; 3 | 4 | #[derive(Component)] 5 | pub struct ModContainerSlot { 6 | pub container_entity: Entity, 7 | } 8 | 9 | -------------------------------------------------------------------------------- /src/models/modifications/descriptors/mod_name.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | use serde::Deserialize; 3 | 4 | #[derive(Component, Deserialize)] 5 | pub struct ModName { 6 | pub mod_name: String, 7 | } -------------------------------------------------------------------------------- /src/models/modifications/descriptors/price.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | use bevy::prelude::Deref; 3 | use serde::Deserialize; 4 | 5 | #[derive(Component, Deref, Deserialize)] 6 | pub struct Price(pub i32); -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Editor-based HTTP Client requests 5 | /httpRequests/ 6 | # Datasource local storage ignored files 7 | /dataSources/ 8 | /dataSources.local.xml 9 | -------------------------------------------------------------------------------- /src/models/events/apply_mod_to_target_event.rs: -------------------------------------------------------------------------------- 1 | use bevy::prelude::{Entity, Resource}; 2 | 3 | #[derive(Resource)] 4 | pub struct ApplyModToTargetEvent { 5 | pub mod_entity: Entity, 6 | pub target_entity: Entity, 7 | } -------------------------------------------------------------------------------- /src/models/modifications/descriptors/tool_tip.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | use serde::Deserialize; 3 | 4 | #[derive(Component, Deserialize, Clone)] 5 | pub struct ToolTip { 6 | pub tooltip: String, 7 | } 8 | -------------------------------------------------------------------------------- /src/models/attribute_container_slot.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | use bevy::prelude::Entity; 3 | 4 | #[derive(Component)] 5 | pub struct AttributeContainerSlot { 6 | pub container_entity: Entity, 7 | } 8 | 9 | -------------------------------------------------------------------------------- /src/models/behavior/mono_directional_move_behavior.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | use bevy::prelude::Vec2; 3 | 4 | #[derive(Component)] 5 | pub struct MonoDirectionalMoveBehavior { 6 | pub direction: Vec2, 7 | } 8 | -------------------------------------------------------------------------------- /src/models/events/remove_mod_from_target_event.rs: -------------------------------------------------------------------------------- 1 | use bevy::prelude::{Entity, Resource}; 2 | 3 | #[derive(Resource)] 4 | pub struct RemoveModFromTargetEvent { 5 | pub mod_entity: Entity, 6 | pub target_entity: Entity, 7 | } -------------------------------------------------------------------------------- /src/models/modifications/descriptors/mod_sprite_path.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | use bevy::prelude::{Handle, Image}; 3 | 4 | #[derive(Component)] 5 | pub struct SpriteHandle { 6 | pub handle: Handle, 7 | } -------------------------------------------------------------------------------- /src/models/modifications/slime.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | use serde::Deserialize; 3 | 4 | #[derive(Copy, Clone, Component, Deserialize)] 5 | pub struct Slime; 6 | 7 | #[derive(Component)] 8 | pub struct SlimeUnit; -------------------------------------------------------------------------------- /src/models/knock_back.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | use serde::Deserialize; 3 | 4 | #[derive(Copy, Clone, Component, Deserialize)] 5 | pub struct KnockBack { 6 | pub push_duration: f32, 7 | pub push_force: f32, 8 | } -------------------------------------------------------------------------------- /src/models/modifications/affects/affect_operator.rs: -------------------------------------------------------------------------------- 1 | use serde::Deserialize; 2 | use serde::Serialize; 3 | 4 | #[derive(Deserialize, Copy, Clone, Serialize)] 5 | pub enum AffectOperator { 6 | Add, 7 | Multiply, 8 | } 9 | 10 | -------------------------------------------------------------------------------- /src/models/modifications/effects/effect_add_health.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | use serde::Deserialize; 3 | 4 | #[derive(Component, Copy, Clone, Deserialize)] 5 | pub struct EffectAddHealth { 6 | pub amount: f32, 7 | } 8 | -------------------------------------------------------------------------------- /src/models/behavior/chase_target_behavior.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | use bevy::prelude::Entity; 3 | 4 | #[derive(Component)] 5 | pub struct ChaseTargetBehavior { 6 | pub target: Entity, 7 | pub proximity: f32, 8 | } 9 | -------------------------------------------------------------------------------- /src/models/modifications/effects/effect_damage_health.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | use serde::Deserialize; 3 | 4 | #[derive(Component, Copy, Clone, Deserialize)] 5 | pub struct EffectDamageHealth { 6 | pub amount: f32, 7 | } 8 | -------------------------------------------------------------------------------- /src/models/unit_push.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | use bevy::prelude::Vec2; 3 | 4 | #[derive(Component)] 5 | pub struct UnitPush { 6 | pub direction: Vec2, 7 | pub duration: f32, 8 | pub force: f32, 9 | } 10 | -------------------------------------------------------------------------------- /configurations/projectile.json: -------------------------------------------------------------------------------- 1 | { 2 | "sprite_custom_size_x": 95.0, 3 | "sprite_custom_size_y": 128.0, 4 | "sprite_path": "sprites/paper_projectile.png", 5 | "speed": 25.0, 6 | "damage": 5.0, 7 | "range": 2048.0, 8 | "hit_limit": 1.0 9 | } -------------------------------------------------------------------------------- /src/models/unit_attributes/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod attribute; 2 | pub mod damage; 3 | pub mod health; 4 | pub mod move_speed; 5 | pub mod hit_limit; 6 | pub mod travel_range; 7 | pub mod reload; 8 | pub mod damage_interval; 9 | pub mod unit_size; 10 | -------------------------------------------------------------------------------- /src/util/debug/mod.rs: -------------------------------------------------------------------------------- 1 | use bevy::prelude::Plugin; 2 | 3 | use crate::App; 4 | 5 | pub mod show_quad_tree_system; 6 | 7 | pub struct DebugPlugin; 8 | 9 | impl Plugin for DebugPlugin { 10 | fn build(&self, _app: &mut App) {} 11 | } 12 | -------------------------------------------------------------------------------- /src/models/behavior/turn_to_target_behavior.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | use bevy::prelude::Entity; 3 | 4 | #[derive(Component)] 5 | pub struct TurnToTargetBehavior { 6 | pub target: Entity, 7 | pub revolutions_per_min: f32, 8 | } 9 | -------------------------------------------------------------------------------- /src/models/collision/hit_box_collider.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | 3 | use crate::models::collision::collider_type::ColliderType; 4 | 5 | #[derive(Component)] 6 | pub struct HitBoxCollider { 7 | pub collider_type: ColliderType, 8 | } 9 | -------------------------------------------------------------------------------- /src/models/configurations/coin_config.rs: -------------------------------------------------------------------------------- 1 | use serde::Deserialize; 2 | 3 | #[derive(Default, Deserialize, Debug)] 4 | pub struct CoinConfig { 5 | pub sprite_custom_size_x: f32, 6 | pub sprite_custom_size_y: f32, 7 | pub sprite_path: String, 8 | } -------------------------------------------------------------------------------- /src/models/configurations/barrel_config.rs: -------------------------------------------------------------------------------- 1 | use serde::Deserialize; 2 | 3 | #[derive(Default, Deserialize, Debug)] 4 | pub struct BarrelConfig { 5 | pub sprite_custom_size_x: f32, 6 | pub sprite_custom_size_y: f32, 7 | pub sprite_path: String, 8 | } -------------------------------------------------------------------------------- /src/models/modifications/affects/projectile_affects/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod affect_projectile_damage; 2 | pub mod affect_projectile_move_speed; 3 | pub mod affect_projectile_hit_limit; 4 | pub mod affect_projectile_travel_range; 5 | pub mod affect_projectile_unit_size; -------------------------------------------------------------------------------- /src/models/spawner/enemy_config_handle.rs: -------------------------------------------------------------------------------- 1 | use bevy::prelude::Resource; 2 | 3 | use crate::models::spawner::enemy_config::EnemyConfig; 4 | 5 | #[derive(Default, Resource)] 6 | pub struct EnemyConfigHandles { 7 | pub enemy_configs: Vec, 8 | } 9 | -------------------------------------------------------------------------------- /src/models/ui/tooltip_window.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | 3 | #[derive(Component)] 4 | pub struct TooltipWindow; 5 | 6 | #[derive(Component)] 7 | pub struct TooltipText; 8 | 9 | #[derive(Component)] 10 | pub struct HoverTooltip; 11 | -------------------------------------------------------------------------------- /src/models/modifications/grow_shot.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | use serde::Deserialize; 3 | 4 | #[derive(Copy, Clone, Component, Deserialize)] 5 | pub struct GrowShot { 6 | pub damage_per_second: f32, 7 | pub size_per_second: f32, 8 | } 9 | -------------------------------------------------------------------------------- /src/models/configurations/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod coin_config; 2 | pub mod player_config; 3 | pub mod hot_dog_config; 4 | pub mod projectile_config; 5 | pub mod barrel_config; 6 | pub mod mod_config; 7 | pub mod raw_configs; 8 | pub mod world_grid_config; 9 | pub mod spawner_config; -------------------------------------------------------------------------------- /src/models/collision/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod collider_weight; 2 | pub mod collider_type; 3 | pub mod collider_owner; 4 | pub mod solid_body_collider; 5 | pub mod hit_box_collider; 6 | pub mod enemy_hit_box_collider; 7 | pub mod enemy_solid_body_collider; 8 | pub mod item_collider; 9 | -------------------------------------------------------------------------------- /src/models/resources/ui_states/hud_state.rs: -------------------------------------------------------------------------------- 1 | use bevy::prelude::{Entity, Handle, Image, Resource}; 2 | 3 | #[derive(Default, Resource)] 4 | pub struct HudState { 5 | pub image_handles: Vec>, 6 | pub entities: Vec, 7 | pub fps_timer: f32, 8 | } -------------------------------------------------------------------------------- /src/units/modifications/projectile_modifications/helper/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod assign_with_associate_component_to_projectile_system; 2 | pub mod assign_attribute_to_projectile_system; 3 | pub mod assign_modification_to_projectile_system; 4 | pub mod enable_projectile_collision; 5 | -------------------------------------------------------------------------------- /src/models/damaged_effect.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | 3 | #[derive(Component)] 4 | pub struct DamagedEffect { 5 | pub timer: f32, 6 | } 7 | 8 | impl DamagedEffect { 9 | pub fn new() -> Self { 10 | Self { timer: 0.0 } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/models/events/debug_command_event.rs: -------------------------------------------------------------------------------- 1 | use bevy::prelude::Resource; 2 | 3 | #[derive(Resource)] 4 | pub struct DebugCommandEvent { 5 | pub debug_command: String, 6 | 7 | pub key: String, 8 | pub values: Vec, 9 | pub arguments: Vec, 10 | } 11 | -------------------------------------------------------------------------------- /src/models/configurations/hot_dog_config.rs: -------------------------------------------------------------------------------- 1 | use serde::Deserialize; 2 | 3 | #[derive(Default, Deserialize, Debug)] 4 | pub struct HotDogConfig { 5 | pub sprite_custom_size_x: f32, 6 | pub sprite_custom_size_y: f32, 7 | pub sprite_path: String, 8 | pub heal_amount: f32, 9 | } -------------------------------------------------------------------------------- /src/models/configurations/spawner_config.rs: -------------------------------------------------------------------------------- 1 | use bevy::prelude::Resource; 2 | use serde::Deserialize; 3 | 4 | #[derive(Default, Resource, Deserialize)] 5 | pub struct SpawnerConfig { 6 | pub spawn_range: f32, 7 | pub spawn_range_offset: f32, 8 | pub max_spawns_per_frame: usize, 9 | } -------------------------------------------------------------------------------- /src/models/resources/ui_states/info_window_state.rs: -------------------------------------------------------------------------------- 1 | use std::collections::HashMap; 2 | use bevy::prelude::Resource; 3 | 4 | #[derive(Default, Resource)] 5 | pub struct InfoWindowState { 6 | pub infos: HashMap, 7 | pub fps_counter: String, 8 | pub fps_timer: f32, 9 | } -------------------------------------------------------------------------------- /src/models/audio/sound_handle_channel.rs: -------------------------------------------------------------------------------- 1 | use bevy::asset::Handle; 2 | use bevy_kira_audio::AudioSource; 3 | 4 | pub enum SoundHandleChannel { 5 | Pickup(Handle), 6 | Projectile(Handle), 7 | Misc(Handle), 8 | Background(Handle), 9 | } -------------------------------------------------------------------------------- /src/util/read_file_to_string.rs: -------------------------------------------------------------------------------- 1 | use std::fs::read_to_string; 2 | 3 | pub fn read_file_to_string(path: &str) -> String { 4 | let my_string = match read_to_string(path) { 5 | Ok(value) => value, 6 | Err(_) => String::new(), 7 | }; 8 | 9 | return my_string; 10 | } -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/models/modifications/burning_shot.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | use serde::Deserialize; 3 | 4 | #[derive(Copy, Clone, Component, Deserialize)] 5 | pub struct BurningShot { 6 | pub debuff_duration: f32, 7 | pub damage_interval: f32, 8 | pub damage_per_tick: f32, 9 | } 10 | -------------------------------------------------------------------------------- /src/models/visited_shop.rs: -------------------------------------------------------------------------------- 1 | use bevy::ecs::component::Component; 2 | 3 | #[derive(Component)] 4 | pub struct VisitedShop { 5 | pub revisit_timer: f32, 6 | } 7 | 8 | impl VisitedShop { 9 | pub fn new(revisit_timer: f32) -> Self { 10 | VisitedShop { revisit_timer } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/models/spawner/spawn_stage.rs: -------------------------------------------------------------------------------- 1 | use bevy::prelude::Resource; 2 | use serde::Deserialize; 3 | 4 | use crate::models::spawner::spawn_phase::SpawnPhase; 5 | 6 | #[derive(Default, Deserialize, Resource, Clone)] 7 | pub struct Stage { 8 | pub name: String, 9 | pub spawn_phases: Vec, 10 | } -------------------------------------------------------------------------------- /src/models/configurations/mod_config.rs: -------------------------------------------------------------------------------- 1 | use bevy::prelude::Component; 2 | use serde::Deserialize; 3 | 4 | #[derive(Default, Deserialize, Debug)] 5 | pub struct ModConfig { 6 | pub mod_name: String, 7 | pub tooltip: String, 8 | pub sprite_path: String, 9 | pub component: T, 10 | } -------------------------------------------------------------------------------- /src/world/game_time_system.rs: -------------------------------------------------------------------------------- 1 | use bevy::prelude::{Res, ResMut, Time}; 2 | 3 | use crate::models::resources::world::game_time::GameTime; 4 | 5 | pub fn game_time_system( 6 | time: Res