moveable
This commit is contained in:
parent
abb54d45ca
commit
6a9a99389c
8 changed files with 39 additions and 4 deletions
|
@ -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():
|
||||
|
|
7
gmtk_2024/scripts/pushable.gd
Normal file
7
gmtk_2024/scripts/pushable.gd
Normal 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()
|
|
@ -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":
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue