mirror of
https://github.com/kristoferssolo/FuncIt.git
synced 2025-10-21 19:30:35 +00:00
25 lines
395 B
GDScript
25 lines
395 B
GDScript
extends Area2D
|
|
|
|
export var speed = 100
|
|
var velocity = Vector2()
|
|
|
|
var time = 0
|
|
var gravitile = 5
|
|
|
|
|
|
func follow_parabolic_trajectory():
|
|
velocity.x = 5
|
|
velocity.y = 1 * time * gravitile
|
|
|
|
|
|
func _process(delta):
|
|
follow_parabolic_trajectory()
|
|
time += delta
|
|
position += velocity * speed * delta
|
|
|
|
|
|
func _on_Bullet_body_entered(body):
|
|
if body.is_in_group("mobs"):
|
|
body.queue_free()
|
|
queue_free()
|