This commit is contained in:
1 parent
c40cbc4574
commit
231629d91e
28 files changed
+434
-91
No files matched your search
@@ -0,0 +1,25 @@
|
||||
class_name Block_Spike
|
||||
|
||||
extends Block_Simple
|
||||
|
||||
# This runs BEFORE the instance is loaded.
|
||||
# There's a lot you can't do here, as it doesn't exist yet.
|
||||
func _init():
|
||||
is_vertical = false
|
||||
tags = ["Spike","Hazard"]
|
||||
|
||||
# This runs AFTER the instance is loaded.
|
||||
# This runs BEFORE the instance is added to the scene tree.
|
||||
func _ready() -> void:
|
||||
if is_vertical:
|
||||
rotate_block(90)
|
||||
|
||||
# This runs every frame. Expensive.
|
||||
func _process(delta: float) -> void:
|
||||
var _last_known_delta = delta
|
||||
|
||||
func on_player_near(body: Node2D) -> void:
|
||||
print("Player is touching block with tags: " + str(tags))
|
||||
|
||||
func on_player_leave(body: Node2D) -> void:
|
||||
print("Player is leaving block with tags: " + str(tags))
|
||||
Reference in new issue
Block a user