StartWorkingWhithDoors

This commit is contained in:
Timofey06 2023-08-18 05:56:36 +03:00
parent 0ff736e29d
commit 2e467120c5
2 changed files with 46 additions and 1 deletions

View file

@ -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<string> { "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)
{
}
}
}
}
}

View file

@ -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;