From d317ef6340a6d3d182c1475091df706bf96b0ae1 Mon Sep 17 00:00:00 2001 From: Wabtey Date: Tue, 6 Aug 2024 02:34:44 +0200 Subject: [PATCH 1/8] add clippy options and small refactoring --- src/characters/npcs/mod.rs | 2 +- src/main.rs | 2 ++ src/tablet/mind_control/mod.rs | 8 +++----- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/characters/npcs/mod.rs b/src/characters/npcs/mod.rs index 92abbff..13095ba 100644 --- a/src/characters/npcs/mod.rs +++ b/src/characters/npcs/mod.rs @@ -67,7 +67,7 @@ fn spawn_characters(mut commands: Commands, cats: Res) { visibility: Visibility { is_visible: false }, ..Default::default() }, - Name::new(format!("WayPoint for Black Cat")), + Name::new("WayPoint for Black Cat"), )) .id(); diff --git a/src/main.rs b/src/main.rs index 2c661e2..0a54efa 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,6 @@ #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] +#![allow(clippy::type_complexity, clippy::too_many_arguments, clippy::pedantic)] +// #![warn(missing_docs)] use bevy::{prelude::*, render::camera::ScalingMode}; use bevy_rapier2d::prelude::*; diff --git a/src/tablet/mind_control/mod.rs b/src/tablet/mind_control/mod.rs index b45f7b5..4937fe9 100644 --- a/src/tablet/mind_control/mod.rs +++ b/src/tablet/mind_control/mod.rs @@ -75,12 +75,11 @@ pub fn mind_control_button( npc_query: Query>, ) { if keyboard_input.pressed(KeyCode::M) { - for npc in npc_query.iter() { + if let Some(npc) = npc_query.iter().next() { commands.entity(npc).insert(MindControled); // .remove::() - break; + let player = player_query.single(); + commands.entity(player).remove::(); } - let player = player_query.single(); - commands.entity(player).remove::(); } } @@ -93,7 +92,6 @@ fn exit_mind_control( npc_query: Query<(Entity, &Name), (With, With)>, ) { if keyboard_input.pressed(KeyCode::Escape) { - // could be a single for now for (npc, _name) in npc_query.iter() { commands.entity(npc).remove::(); } From bcccfd5d9d69cffbefe5623b945a9e28f4f97e4a Mon Sep 17 00:00:00 2001 From: Wabtey Date: Tue, 6 Aug 2024 02:50:45 +0200 Subject: [PATCH 2/8] dumps v0.2 and add `CHANGELOG` file --- CHANGELOG.md | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++++ Cargo.toml | 2 +- 2 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..bf1122f --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,81 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## Final Cinematic - [v0.2](https://github.com/Fabinistere/cats_destroyer_2000/releases/tag/v0.2) - 2023-06-11 + +[![v0.2](https://img.shields.io/badge/v0.2-gray?style=flat&logo=github&logoColor=181717&link=https://github.com/Fabinistere/cats_destroyer_2000/releases/tag/v0.2)](https://github.com/Fabinistere/cats_destroyer_2000/releases/tag/v0.2) + +## Add + +- End cinematic +- WebAssembly + +## Must Have + +- Back to jail (when touched by a enemy) + +## Should Have + +- UI for the Tablet +- Vision Feature + - Tile per Tile + - Can only interact with seen entities. + - Entities can be seen by camera, any mindControled entity (including the player) +- Music +- SFX +- Start Menu + +## Level 1000 - [v0.1](https://github.com/Fabinistere/cats_destroyer_2000/releases/tag/v0.1) - 2023-02-12 + +[![v0.1](https://img.shields.io/badge/v0.1-gray?style=flat&logo=github&logoColor=181717&link=https://github.com/Fabinistere/cats_destroyer_2000/releases/tag/v0.1)](https://github.com/Fabinistere/cats_destroyer_2000/releases/tag/v0.1) + +## Currently Have + +- NPC + - triggered by player if around (and in the same area) + - Movement +- Player + - Basic Movement +- Tablet + - MindControl + - Take the body of another cat + - Stun after a short time after mindctrl + - Hack + - Open One door + - Can't Hack while mindcontrol +- Map + - Hitbox + - Doors + - Closed + - Physical Button + - which opens front and exit doors + +## Must Have + +- Start/End cinematic +- Back to jail (when touched by a enemy) +- Web Exe + +## Should Have + +- UI for the Tablet +- Vision Feature + - Tile per Tile + - Can only interact with seen entities. + - Entities can be seen by camera, any mindControled entity (including the player) +- Music +- SFX +- Start Menu + +## Blue Cat Flex - [v0.0](https://github.com/Fabinistere/cats_destroyer_2000/releases/tag/v0.0) - 2023-02-03 + +[![v0.0](https://img.shields.io/badge/v0.0-gray?style=flat&logo=github&logoColor=181717&link=https://github.com/Fabinistere/cats_destroyer_2000/releases/tag/v0.0)](https://github.com/Fabinistere/cats_destroyer_2000/releases/tag/v0.0) + +- Simple Animation +- Blue Cat Flexing in the center + +![fast_blue_cat](https://user-images.githubusercontent.com/73140258/216720606-6e8f7768-3170-4956-a5d1-5124741783aa.gif) diff --git a/Cargo.toml b/Cargo.toml index cc98b28..5a5df4f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cats_destroyer_2000" -version = "0.1.0" +version = "0.2.0" authors = ["Olf EPAIN aka Wabtey ", "???"] edition = "2021" From 85a16c910e252e161c06707b12573a8f788d261c Mon Sep 17 00:00:00 2001 From: Wabtey Date: Tue, 6 Aug 2024 03:52:59 +0200 Subject: [PATCH 3/8] bevy `0.9` -> bevy `0.10` --- CHANGELOG.md | 20 ++ Cargo.toml | 9 +- src/characters/effects/style.rs | 2 +- src/characters/npcs/mod.rs | 7 +- src/characters/npcs/movement.rs | 14 +- src/characters/player.rs | 3 +- src/debug.rs | 9 +- src/locations/level_one/mod.rs | 490 ++++++++++++++++---------------- src/locations/mod.rs | 21 +- src/locations/sensors.rs | 7 +- src/main.rs | 19 +- src/spritesheet.rs | 2 +- src/tablet/hack/mod.rs | 27 +- src/tablet/mind_control/mod.rs | 67 +++-- src/tablet/mod.rs | 20 +- 15 files changed, 356 insertions(+), 361 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf1122f..7724cab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,26 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Bevy Migration - [v0.3.0](https://github.com/Fabinistere/cats_destroyer_2000/releases/tag/v0.3.0) - 2024-08-06 + +[![v0.3.0](https://img.shields.io/badge/v0.3.0-gray?style=flat&logo=github&logoColor=181717&link=https://github.com/Fabinistere/cats_destroyer_2000/releases/tag/v0.3.0)](https://github.com/Fabinistere/cats_destroyer_2000/releases/tag/v0.3.0) +[![**Full Commits History**](https://img.shields.io/badge/GitHubLog-gray?style=flat&logo=github&logoColor=181717&link=https://github.com/fabinistere/cats_destroyer_2000/commits/v0.3.0)](https://github.com/fabinistere/cats_destroyer_2000/commits/v0.3.0) + +### [Bevy 0.10](https://bevyengine.org/learn/migration-guides/0.9-0.10/) Migration + +- Dependencies + - remove the `dynamic` feature fr + - bevy-inspector-egui 0.18 + - bevy_rapier2d [0.21](https://github.com/dimforge/bevy_rapier/blob/master/CHANGELOG.md#0210--07-march-2023) + - feature `debug-render` change to `debug-render-2d` +- ECS + - [Migrate engine to Schedule v3 (stageless)](https://bevyengine.org/learn/migration-guides/0.9-0.10/#migrate-engine-to-schedule-v3-stageless) + - [System sets (Bevy 0.9)](https://bevyengine.org/learn/migration-guides/0.9-0.10/#system-sets-bevy-0-9) + - [States](https://bevyengine.org/learn/migration-guides/0.9-0.10/#states) + - Replace `RemovedComponents` backing with `Events` +- UI + - [Windows as Entities](https://bevyengine.org/learn/migration-guides/0.9-0.10/#windows-as-entities) + ## Final Cinematic - [v0.2](https://github.com/Fabinistere/cats_destroyer_2000/releases/tag/v0.2) - 2023-06-11 [![v0.2](https://img.shields.io/badge/v0.2-gray?style=flat&logo=github&logoColor=181717&link=https://github.com/Fabinistere/cats_destroyer_2000/releases/tag/v0.2)](https://github.com/Fabinistere/cats_destroyer_2000/releases/tag/v0.2) diff --git a/Cargo.toml b/Cargo.toml index 5a5df4f..4ad8ab9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cats_destroyer_2000" -version = "0.2.0" +version = "0.3.0" authors = ["Olf EPAIN aka Wabtey ", "???"] edition = "2021" @@ -8,10 +8,9 @@ edition = "2021" [dependencies] -bevy = { version = "0.9", features = ["dynamic"] } -bevy-inspector-egui = "0.15" -# bevy_tweening = "0.6" -bevy_rapier2d = { version = "0.19", features = ["simd-stable", "debug-render"] } +bevy = "0.10" +bevy-inspector-egui = "0.18" +bevy_rapier2d = { version = "0.21", features = ["simd-stable", "debug-render-2d"] } image = "0.23" diff --git a/src/characters/effects/style.rs b/src/characters/effects/style.rs index 7d59a62..96ae417 100644 --- a/src/characters/effects/style.rs +++ b/src/characters/effects/style.rs @@ -23,7 +23,7 @@ pub fn add_dazed_effect( // TODO: polish - floating Stars above their head // whatever the entity - commands.entity(entity).add_children(|parent| { + commands.entity(entity).with_children(|parent| { parent.spawn(( SpriteSheetBundle { sprite: TextureAtlasSprite { diff --git a/src/characters/npcs/mod.rs b/src/characters/npcs/mod.rs index 13095ba..888028c 100644 --- a/src/characters/npcs/mod.rs +++ b/src/characters/npcs/mod.rs @@ -1,5 +1,4 @@ use bevy::prelude::*; -use bevy_inspector_egui::Inspectable; use bevy_rapier2d::prelude::*; use crate::{ @@ -51,7 +50,7 @@ impl Plugin for NPCsPlugin { } } -#[derive(Component, Inspectable)] +#[derive(Component, Reflect)] pub struct NPC; fn spawn_characters(mut commands: Commands, cats: Res) { @@ -64,8 +63,8 @@ fn spawn_characters(mut commands: Commands, cats: Res) { BLACK_CAT_STARTING_POSITION.1 - 50., 0., )), - visibility: Visibility { is_visible: false }, - ..Default::default() + visibility: Visibility::Hidden, + ..default() }, Name::new("WayPoint for Black Cat"), )) diff --git a/src/characters/npcs/movement.rs b/src/characters/npcs/movement.rs index d28fef6..bf95e04 100644 --- a/src/characters/npcs/movement.rs +++ b/src/characters/npcs/movement.rs @@ -2,7 +2,10 @@ use bevy::prelude::*; use bevy_rapier2d::prelude::*; use crate::{ - characters::{effects::style::DazeAnimation, movement::{Dazed, Speed}}, + characters::{ + effects::style::DazeAnimation, + movement::{Dazed, Speed}, + }, characters::{npcs::NPC, player::Player}, constants::character::npc::movement::BLACK_CAT_STARTING_POSITION, tablet::mind_control::MindControled, @@ -212,8 +215,8 @@ pub fn give_new_direction_event( BLACK_CAT_STARTING_POSITION.1 - 50., 0., )), - visibility: Visibility { is_visible: false }, - ..Default::default() + visibility: Visibility::Hidden, + ..default() }, Name::new(format!("WayPoint for {}", name)), )) @@ -239,7 +242,10 @@ pub fn daze_wait( mut commands: Commands, time: Res