Added godmode hotkey

This commit is contained in:
2026-03-11 13:58:53 +11:00
parent 0914903084
commit a9f1fd48c9
5 changed files with 39 additions and 8 deletions

View File

@@ -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: