From 2e467120c5bbc1fe19a775b43836a0a74004d7da Mon Sep 17 00:00:00 2001 From: Timofey06 Date: Fri, 18 Aug 2023 05:56:36 +0300 Subject: [PATCH] StartWorkingWhithDoors --- .../GameCore/GameObjects/Entities/Door.cs | 37 +++++++++++++++++++ .../LivingEntities/Player/Player.cs | 10 ++++- 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 DangerousD/GameCore/GameObjects/Entities/Door.cs diff --git a/DangerousD/GameCore/GameObjects/Entities/Door.cs b/DangerousD/GameCore/GameObjects/Entities/Door.cs new file mode 100644 index 0000000..0e21692 --- /dev/null +++ b/DangerousD/GameCore/GameObjects/Entities/Door.cs @@ -0,0 +1,37 @@ +using DangerousD.GameCore.GameObjects.LivingEntities; +using DangerousD.GameCore.Graphics; +using Microsoft.Xna.Framework; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DangerousD.GameCore.GameObjects.Entities +{ + public class Door : Entity + { + public Door(Vector2 position) : base(position) + { + } + + protected override GraphicsComponent GraphicsComponent { get; } = new(new List { "SilasBallMove" }, "SilasBallMove"); + public override void Update(GameTime gameTime) + { + base.Update(gameTime); + + } + public override void OnCollision(GameObject gameObject) + { + base.OnCollision(gameObject); + if (gameObject is Player) + { + Player player = (Player)gameObject; + if (player.isUping) + { + + } + } + } + } +} diff --git a/DangerousD/GameCore/GameObjects/LivingEntities/Player/Player.cs b/DangerousD/GameCore/GameObjects/LivingEntities/Player/Player.cs index 1790e25..0006914 100644 --- a/DangerousD/GameCore/GameObjects/LivingEntities/Player/Player.cs +++ b/DangerousD/GameCore/GameObjects/LivingEntities/Player/Player.cs @@ -31,7 +31,7 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities public bool isInvincible; private int bullets; public bool FallingThroughPlatform = false; - + public bool isUping = false; @@ -162,6 +162,14 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities } public override void Update(GameTime gameTime) { + if (AppManager.Instance.InputManager.ScopeState==ScopeState.Up) + { + isUping = true; + } + else + { + isUping = false; + } if (isOnGround && FallingThroughPlatform) { FallingThroughPlatform = false;