hero-mark-2/objects/rock/rock.gd
2022-12-07 02:23:21 -05:00

14 lines
284 B
GDScript

extends KinematicBody2D
var velocity = Vector2.ZERO
onready var bottom = $Bottom
func _physics_process(delta):
if !is_on_floor():
#Gravity
velocity.y = 100
velocity.x = 0
move_and_slide(velocity,Vector2.UP)
velocity.x = 0
func push(direction):
velocity -= direction * 32