This commit is contained in:
Booklordofthedings 2024-08-18 11:02:15 +02:00
parent abb54d45ca
commit 6a9a99389c
8 changed files with 39 additions and 4 deletions

View file

@ -54,6 +54,12 @@ func _physics_process(delta):
get_input(delta)
velocity.y += gravity
move_and_slide()
if(get_slide_collision_count() > 0):
for i in get_slide_collision_count():
var box = get_slide_collision(i).get_collider() as Box
if box and velocity.y >= 0:
box.velocity.x = velocity.x*0.8
# print(jump_count) # Uncomment for debugging
func Jump():

View file

@ -0,0 +1,7 @@
extends CharacterBody2D
class_name Box;
func _physics_process(delta: float) -> void:
velocity.y += 50
velocity.x = velocity.x * 0.8
move_and_slide()

View file

@ -4,7 +4,6 @@ extends Node
var current_selected = "none";
func _process(delta: float) -> void:
if Input.is_action_just_pressed("click"):
if current_selected == "scale_up":