2025-10-07 00:56:47 +00:00
|
|
|
class_name Bullet extends Area2D
|
|
|
|
|
|
|
|
|
|
var speed:float = 700
|
2025-10-21 01:06:01 +00:00
|
|
|
@onready var bullet_graphic = $BulletGraphic
|
2025-10-07 00:56:47 +00:00
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
|
2025-10-21 01:06:01 +00:00
|
|
|
func xz(value)->void:
|
2025-10-07 00:56:47 +00:00
|
|
|
speed = value
|
2025-10-21 01:06:01 +00:00
|
|
|
if speed<0:
|
|
|
|
|
bullet_graphic.flip_h = true
|
|
|
|
|
else:
|
|
|
|
|
bullet_graphic.flip_h = false
|