From 94afacebec2d155fc8c96ab4173498e305c90d69 Mon Sep 17 00:00:00 2001 From: rewin Date: Thu, 7 Dec 2023 22:54:35 +0300 Subject: [PATCH] Polising and wolf sprite --- assets/test/wolf.png | Bin 0 -> 547 bytes src/sheep.rs | 17 ++++++++++------- src/storyteller.rs | 31 +++++++++++++++++++++---------- src/test_level.rs | 2 +- 4 files changed, 32 insertions(+), 18 deletions(-) create mode 100644 assets/test/wolf.png diff --git a/assets/test/wolf.png b/assets/test/wolf.png new file mode 100644 index 0000000000000000000000000000000000000000..3bce3260edcc5612f6cb98ddd8379235e8230b27 GIT binary patch literal 547 zcmV+;0^I$HP)Px$-AP12R5*>Tl)sANP!xy1yZ8#$Vr7*=0%CBQU^8zpV3lUeu-gijfwa5W3@ihw z!uSR@P8ze3u)!i#DzWwxqrUWCB*SzVtwjCEg2-R{i zuZt`p+U!*G+?RKgU#;8kAz<5aThDwLJ{V2t_IupVJOGx9dHred?J8z4ngC}n#FG!h zmy3DrO~4u5%)8X!Dyl%xqFzgjw5}q(*`NBM6cP7 zOSj+CApo#BuK`qf%AemaD5da&kZ(VJA>JuT#pPmN%LQ?@X;q#AXmz&Za`!OP`$NkD zU|*K}{QmU}UoPgg91?&$Q01u}O*dC+#q-l+tI}KGB1<6q zw`LZUvK_bfgOGh$vR%bmMU|(V4o4kZxomz*0r^3AQJwIbiuXzi|MKv3KJ^eYkL>U<$#Q4NSf9R5ww@RhMOv-0hwX29rvQ+nTl_z@5se< z9KFeN-~xI&9CgaIwb)kWqHr*pFtjZEAZ%@;MV2tMETYYh=cmW3;n2!u;s>FUvTXxL lo1OBe 2. { - *dec = Decision::Idle; + *dec = Decision::Feed; walk.0 = Vec3::ZERO; - commands.entity(e).remove::(); + commands.entity(e).remove::().insert(IdleFeeding { + //sheep in stress for 3 seconds after dog bark + time: 3.0, + }); } else { scare.time += time.delta_seconds(); @@ -413,9 +416,9 @@ pub fn setup( }); //spawn sheeps - let r = level_size.0 / 1.5; + let r = level_size.0 / 1.5 / 2.0; let mut rng = rand::thread_rng(); - let sheep_count = 100; + let sheep_count = 1000; for _ in 0..sheep_count { let x = rng.gen_range(-r..r); diff --git a/src/storyteller.rs b/src/storyteller.rs index 2602b79..0e90d45 100644 --- a/src/storyteller.rs +++ b/src/storyteller.rs @@ -10,8 +10,10 @@ use bevy::prelude::*; use rand::Rng; use crate::{ - player::DOG_SPEED, - sheep::{GoTo, Sheep, RANDOM_WALK_SPEED_MULTIPLIER, SHEEP_SPEED}, + player::{Dog, DOG_SPEED}, + sheep::{ + Decision, GoTo, IdleFeeding, IsScared, Sheep, RANDOM_WALK_SPEED_MULTIPLIER, SHEEP_SPEED, + }, test_level::LevelSize, }; @@ -49,20 +51,24 @@ fn setup_start_time(mut teller: ResMut, time: Res