SeptemberGame/scripts/bullet.gd

21 lines
480 B
GDScript3
Raw Normal View History

class_name Bullet extends Area2D
var speed:float = 700
@onready var bullet_graphic = $BulletGraphic
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
position += transform.x * speed * delta
func xz(value)->void:
speed = value
if speed<0:
bullet_graphic.flip_h = true
else:
bullet_graphic.flip_h = false