Bullets firing and scene manager witih teleportation and force push
This commit is contained in:
1 parent
94012868f0
commit
4e9a117b77
15 files changed
+260
-60
No files matched your search
@@ -0,0 +1,22 @@
|
||||
class_name Crate extends RigidBody2D
|
||||
|
||||
var teleport_target: Vector2 = Vector2.ZERO
|
||||
var should_teleport: bool = false
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
pass # Replace with function body.
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
pass
|
||||
|
||||
func teleport_to(position:Vector2):
|
||||
teleport_target = position
|
||||
should_teleport = true
|
||||
|
||||
func _integrate_forces(state: PhysicsDirectBodyState2D) -> void:
|
||||
if should_teleport:
|
||||
state.transform = Transform2D.IDENTITY.translated(teleport_target)
|
||||
should_teleport = false
|
||||
Reference in new issue
Block a user