Dialogue system; ask user if they want to teleport to next floor
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
using Chickensoft.Collections;
|
||||
using Chickensoft.GodotNodeInterfaces;
|
||||
using Chickensoft.Introspection;
|
||||
using Chickensoft.LogicBlocks;
|
||||
using Chickensoft.SaveFileBuilder;
|
||||
using Godot;
|
||||
|
||||
@@ -148,6 +147,13 @@ namespace GameJamDungeon
|
||||
SetPhysicsProcess(true);
|
||||
}
|
||||
|
||||
public override void _UnhandledInput(InputEvent @event)
|
||||
{
|
||||
var attackIsPressed = Input.IsActionJustPressed(GameInputs.Attack);
|
||||
if (attackIsPressed && !GameRepo.IsWithinDialogueSpace)
|
||||
PlayerLogic.Input(new PlayerLogic.Input.Attack());
|
||||
}
|
||||
|
||||
private void OnEnemyHitBoxEntered(Area3D area)
|
||||
{
|
||||
if (area is IHitbox hitBox)
|
||||
@@ -172,10 +178,6 @@ namespace GameJamDungeon
|
||||
{
|
||||
PlayerLogic.Input(new PlayerLogic.Input.PhysicsTick(delta));
|
||||
|
||||
var attackIsPressed = Input.IsActionJustPressed(GameInputs.Attack);
|
||||
if (attackIsPressed && !GameRepo.IsWithinDialogueSpace)
|
||||
PlayerLogic.Input(new PlayerLogic.Input.Attack());
|
||||
|
||||
MoveAndSlide();
|
||||
|
||||
PlayerLogic.Input(new PlayerLogic.Input.Moved(GlobalPosition));
|
||||
@@ -196,7 +198,7 @@ namespace GameJamDungeon
|
||||
public void ThrowItem()
|
||||
{
|
||||
var itemScene = GD.Load<PackedScene>("res://src/items/throwable/ThrowableItem.tscn");
|
||||
var throwItem = itemScene.Instantiate<IThrowableItem>();
|
||||
var throwItem = itemScene.Instantiate<ThrowableItem>();
|
||||
GetTree().Root.AddChildEx(throwItem);
|
||||
throwItem.GlobalPosition = GameRepo.PlayerGlobalPosition.Value;
|
||||
throwItem.GlobalRotation = GlobalRotation;
|
||||
@@ -224,7 +226,10 @@ namespace GameJamDungeon
|
||||
HPBar.Value = newHP;
|
||||
|
||||
if (newHP <= 0.0)
|
||||
{
|
||||
PlayerLogic.Input(new PlayerLogic.Input.Killed());
|
||||
HealthTimer.Stop();
|
||||
}
|
||||
}
|
||||
|
||||
private void OnVTChanged(int newVT)
|
||||
|
||||
Reference in New Issue
Block a user