Basic projectile implementation

This commit is contained in:
2024-09-15 02:37:32 -07:00
parent b42b248c0b
commit 470b853916
7 changed files with 209 additions and 47 deletions

View File

@@ -123,6 +123,7 @@ namespace GameJamDungeon
var attackSpeed = PlayerData.Inventory.EquippedWeapon.Value.WeaponStats.AttackSpeed;
AnimationPlayer.SetSpeedScale((float)attackSpeed);
AnimationPlayer.Play("attack");
SwordSlashAnimation.Play("attack");
})
.Handle((in PlayerLogic.Output.ThrowItem output) =>
{
@@ -131,7 +132,6 @@ namespace GameJamDungeon
this.Provide();
PlayerLogic.Start();
GameRepo.SetPlayerData(PlayerData);
SwordSlashAnimation.Position = GetViewport().GetVisibleRect().Size / 2;
GlobalPosition = GameRepo.PlayerGlobalPosition.Value;
GameRepo.PlayerGlobalPosition.Sync += PlayerGlobalPosition_Sync;
HealthTimer.Timeout += OnHealthTimerTimeout;
@@ -177,6 +177,7 @@ namespace GameJamDungeon
{
PlayerLogic.Input(new PlayerLogic.Input.PhysicsTick(delta));
SwordSlashAnimation.Position = GetViewport().GetVisibleRect().Size / 2;
MoveAndSlide();
PlayerLogic.Input(new PlayerLogic.Input.Moved(GlobalPosition, GlobalTransform));