placeholder gun animation and player scripts
This commit is contained in:
parent
464c5ecfd5
commit
ed684b694b
6 changed files with 137 additions and 85 deletions
31
base/scripts/player/command_stack.gd
Normal file
31
base/scripts/player/command_stack.gd
Normal file
|
@ -0,0 +1,31 @@
|
|||
extends RefCounted
|
||||
|
||||
class_name CommandStack
|
||||
## Commands that can be pushed to stack
|
||||
enum Command {
|
||||
None,
|
||||
TakeWeapon,
|
||||
Shoot,
|
||||
Reload,
|
||||
HolsterWeapon,
|
||||
TakeZaza,
|
||||
LightZaza,
|
||||
Smoke
|
||||
}
|
||||
|
||||
var left_command_stack: Array[Command] = []
|
||||
var right_command_stack: Array[Command] = []
|
||||
|
||||
func push(left_command: Command = Command.None, right_command: Command = Command.None):
|
||||
left_command_stack.push_back(left_command)
|
||||
right_command_stack.push_back(right_command)
|
||||
|
||||
func pop():
|
||||
left_command_stack.pop_back()
|
||||
right_command_stack.pop_back()
|
||||
|
||||
func current_left_command() -> Command:
|
||||
return left_command_stack.back()
|
||||
|
||||
func current_right_command() -> Command:
|
||||
return right_command_stack.back()
|
1
base/scripts/player/command_stack.gd.uid
Normal file
1
base/scripts/player/command_stack.gd.uid
Normal file
|
@ -0,0 +1 @@
|
|||
uid://dackkxqximesc
|
12
base/scripts/player/player.gd
Normal file
12
base/scripts/player/player.gd
Normal file
|
@ -0,0 +1,12 @@
|
|||
extends RigidBody3D
|
||||
|
||||
var stack: CommandStack = CommandStack.new()
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
pass # Replace with function body.
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
pass
|
1
base/scripts/player/player.gd.uid
Normal file
1
base/scripts/player/player.gd.uid
Normal file
|
@ -0,0 +1 @@
|
|||
uid://dts8lbivkgsmj
|
Loading…
Add table
Add a link
Reference in a new issue