From 88da62242edc0855144a257800ff746c68d3fc7d Mon Sep 17 00:00:00 2001 From: TudbuT Date: Sat, 23 Nov 2024 22:55:19 +0100 Subject: [PATCH] respawning and such, balls --- assets/world.txt | 25 +++++++++++++++++-------- src/game/player.rs | 26 ++++++++++++++++++-------- src/game/player/animation.rs | 2 +- src/game/scene.rs | 30 +++++++++++++++++++++++------- src/main.rs | 2 +- 5 files changed, 60 insertions(+), 25 deletions(-) diff --git a/assets/world.txt b/assets/world.txt index a32646a..8846b43 100644 --- a/assets/world.txt +++ b/assets/world.txt @@ -6,12 +6,21 @@ header .G = grasblock_lower.png ._ = _grasblock_upper.png ., = _erdblock_upper.png -body + .a = _tree1_greenish.png + .O = ~Blockgrau.png +links -T P -TT ,,,_______,,,______,___ -TTTTTTTTEEEGGGGGGGEEEGGGGGGEGGGE -TTTTTTTTTEEEEEEEEEEEEEEEEEEEEEEE -TTTTTTEEEEEEEEEEEEEEEEEEEEEEEEEE -EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE -EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE +blocks +TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT +T T +T T +T O T +T O T +T O T +T P _______ _ T +TT ,,,_______,,,_a____,___ __GGGGGGG_______TTTTTTTTTTTT T +TTTTTTTTEEEGGGGGGGEEEGGGGGGEGGGE GGEEEEEEEGGEEEEETTTTTTTTTTTTTTTTTTT +TTTTTTTTTEEEEEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEETTTTTTTTTTTTTTTEEET +TTTTTTEEEEEEEEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEETTTTTTEEEEEEEEEET +EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT +EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT diff --git a/src/game/player.rs b/src/game/player.rs index eeba809..6131dce 100644 --- a/src/game/player.rs +++ b/src/game/player.rs @@ -1,4 +1,4 @@ -use std::{hash::Hash, time::Duration}; +use std::{any::Any, hash::Hash, time::Duration}; use animation::{run_animations, AnimBundle, Animation}; use bevy::{ecs::system::SystemId, prelude::*, sprite::MaterialMesh2dBundle, utils::HashMap}; @@ -7,7 +7,7 @@ use bevy_rapier2d::prelude::*; use crate::{AppState, METER}; -use super::{scene::PlayerCoords, set::IngameSet}; +use super::{scene::PlayerCoords, set::IngameSet, PLAYER_DEPTH}; mod animation; @@ -59,7 +59,7 @@ fn move_player( kb_input: Res>, mut query: Query<( &mut Velocity, - &Transform, + &mut Transform, &mut Player, &mut KinematicCharacterController, &mut Sprite, @@ -70,7 +70,7 @@ fn move_player( player_coords: Res, time: Res