money
This commit is contained in:
parent
4ab01fe0dc
commit
f4ffbf642b
8 changed files with 55 additions and 22 deletions
|
|
@ -3,10 +3,21 @@ class_name Player
|
|||
|
||||
var playerObject
|
||||
|
||||
var monies = 0
|
||||
|
||||
func _ready() -> void:
|
||||
GlobalVariables.player = self
|
||||
playerObject = $Horse
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
var rotationDif = playerObject.angular_velocity
|
||||
|
||||
monies += (rotationDif.length() * delta)/6.2
|
||||
|
||||
if monies >= 1:
|
||||
monies -= 1
|
||||
GlobalVariables.money += 1
|
||||
|
||||
func get_object_position():
|
||||
return playerObject.global_position
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue