Added godmode hotkey
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
class_name BoxBoy extends CharacterBody2D
|
||||
|
||||
@onready var _gameplayController = $/root/Scene/GameplayController
|
||||
@onready var _sprite = $AnimatedSprite2D
|
||||
|
||||
const MOVE_FORCE: int = 300 #about 10 tiles horizontally (airborne arc)
|
||||
@@ -68,9 +69,12 @@ func _physics_process(_delta) -> void:
|
||||
if abs(velocity.x) > MAX_MOVE_SPEED:
|
||||
velocity.x = MAX_MOVE_SPEED * sign(velocity.x)
|
||||
|
||||
if _gameplayController.godmode and velocity.y > 0:
|
||||
velocity.y = 0
|
||||
|
||||
|
||||
#do the thing
|
||||
move_and_slide()
|
||||
print(velocity.y)
|
||||
|
||||
#animation stuff
|
||||
func _on_animation_finished() -> void:
|
||||
|
||||
Reference in New Issue
Block a user