Most of prototype! yay
This commit is contained in:
5
common/interactable.gd
Normal file
5
common/interactable.gd
Normal file
@@ -0,0 +1,5 @@
|
||||
extends Node2D
|
||||
class_name Interactable
|
||||
|
||||
func interact(player: Player):
|
||||
pass
|
||||
1
common/interactable.gd.uid
Normal file
1
common/interactable.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://csbip0oj1uu0j
|
||||
10
common/interactable_body.gd
Normal file
10
common/interactable_body.gd
Normal file
@@ -0,0 +1,10 @@
|
||||
extends StaticBody2D
|
||||
class_name InteractableBody
|
||||
|
||||
var parent: Interactable
|
||||
|
||||
func _ready() -> void:
|
||||
parent = get_parent()
|
||||
|
||||
func interact(player: Player):
|
||||
parent.interact(player)
|
||||
1
common/interactable_body.gd.uid
Normal file
1
common/interactable_body.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://dryjau28sybgd
|
||||
14
common/player_states/player_state.gd
Normal file
14
common/player_states/player_state.gd
Normal file
@@ -0,0 +1,14 @@
|
||||
extends Resource
|
||||
class_name Player_State
|
||||
|
||||
func restrict_movement() -> bool:
|
||||
return false
|
||||
|
||||
func on_movement_input(input: Vector2, player: Player):
|
||||
pass
|
||||
|
||||
func restrict_rotation() -> bool:
|
||||
return false
|
||||
|
||||
func on_rotation_input(input: float, player: Player):
|
||||
pass
|
||||
1
common/player_states/player_state.gd.uid
Normal file
1
common/player_states/player_state.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://tweaybdvlwev
|
||||
16
common/player_states/player_state_rotation_interaction.gd
Normal file
16
common/player_states/player_state_rotation_interaction.gd
Normal file
@@ -0,0 +1,16 @@
|
||||
extends Player_State
|
||||
class_name Player_State_Rotation_Interaction
|
||||
|
||||
var rotation_target: Node2D
|
||||
|
||||
func _init(target: Node2D) -> void:
|
||||
rotation_target = target
|
||||
|
||||
func restrict_rotation() -> bool:
|
||||
return true
|
||||
|
||||
func on_movement_input(input: Vector2, player: Player):
|
||||
player.interacting_state = Player_State_Standard.new()
|
||||
|
||||
func on_rotation_input(input: float, player: Player):
|
||||
rotation_target.rotation = input
|
||||
@@ -0,0 +1 @@
|
||||
uid://wo8hrn7t4s3p
|
||||
2
common/player_states/player_state_standard.gd
Normal file
2
common/player_states/player_state_standard.gd
Normal file
@@ -0,0 +1,2 @@
|
||||
extends Player_State
|
||||
class_name Player_State_Standard
|
||||
1
common/player_states/player_state_standard.gd.uid
Normal file
1
common/player_states/player_state_standard.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://bkv1iehq3miwi
|
||||
Reference in New Issue
Block a user