#need help me with structuring my code

4 messages · Page 1 of 1 (latest)

hollow nacelle
#

the shop is in the bottom center

#

this is my node tree

#

this is my grenade:
extends RigidBody2D
class_name Grenade
static var force:= 150
static var cost := 3
static var texture = preload("res://grenade.png")
func _ready() -> void:
$Image.texture = texture
func use(Tank: TANK):
position = Tank.position+Vector2.UP.rotated(Tank.rotation) * 14
linear_velocity = Tank.velocity /2 + Vector2.UP.rotated(Tank.rotation) * force
await get_tree().create_timer(2).timeout
Global.explosion(position, 60)
queue_free()

#

the grenade itself isnt too important