12345678910111213141516171819 |
- extends KinematicBody2D
- var gravity = 35
- var Velocity = Vector2.ZERO
- var max_speed = 450
- var is_stop = false
- func _physics_process(delta):
- if is_stop:
- return
- Velocity.y += gravity
- Velocity.y = clamp(Velocity.y, -max_speed, max_speed)
- Velocity = move_and_slide(Velocity)
- func initialize(pos):
- global_position = pos
|