Add player controller, state management, and input handling
- Implemented PlayerController.cs to manage player movement and actions. - Created PlayerState.cs to track player lives, coins, and key status. - Added CameraFollow.cs for smooth camera movement following the player. - Developed Character.cs as an abstract class for character behavior. - Introduced Enums.cs for defining TreasureType and MapElementType. - Added IDoor interface for door interactions. - Created InputActions.cs for handling player input actions. - Implemented MainMenu.cs for basic menu functionality including play and exit options.
This commit is contained in:
@@ -52,7 +52,7 @@ public class PlayerController : Character
|
||||
|
||||
private void OnFireButtonPressed()
|
||||
{
|
||||
if (_hammer == null)
|
||||
if (_hammerThrower.CanThrow)
|
||||
{
|
||||
_animator.SetTrigger("Body_ThrowHammer");
|
||||
}
|
||||
@@ -61,7 +61,7 @@ public class PlayerController : Character
|
||||
// Animation event
|
||||
public void ThrowHammerObject()
|
||||
{
|
||||
_hammerThrower.ThrowHammer();
|
||||
_hammerThrower.TryThrowHammer();
|
||||
UpdatePlayerSprite();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user