sprites bullet crate, tilemap, parallax background
This commit is contained in:
1 parent
e66b95c1f1
commit
6c070f7c73
22 files changed
+795
-17
No files matched your search
@@ -1,6 +1,8 @@
|
||||
class_name Bullet extends Area2D
|
||||
|
||||
var speed:float = 700
|
||||
@onready var bullet_graphic: Sprite2D = $bulletGraphic
|
||||
|
||||
signal bulletDamageSignal(body, bullet)
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
@@ -8,6 +10,10 @@ func _ready() -> void:
|
||||
|
||||
func setSpeed(value)->void:
|
||||
speed = value
|
||||
if speed <0:
|
||||
bullet_graphic.flip_h = true
|
||||
if speed > 0:
|
||||
bullet_graphic.flip_h = false
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
position += transform.x * speed *delta
|
||||
|
||||
Reference in new issue
Block a user