mirror of
https://github.com/JHDev2006/Super-Mario-Bros.-Remastered-Public.git
synced 2025-10-22 15:38:14 +00:00
added the game
This commit is contained in:
10
Scripts/Classes/Blocks/InvisibleQuestionBlock.gd
Normal file
10
Scripts/Classes/Blocks/InvisibleQuestionBlock.gd
Normal file
@@ -0,0 +1,10 @@
|
||||
extends Block
|
||||
|
||||
func on_area_entered(area: Area2D) -> void:
|
||||
if area.owner is Player:
|
||||
var player: Player = area.owner
|
||||
if player.velocity.y < 0 and player.global_position.y > $Hitbox.global_position.y and abs(player.global_position.x - global_position.x) < 8:
|
||||
player_block_hit.emit(area.owner)
|
||||
player.velocity.y = 0
|
||||
player.bump_ceiling()
|
||||
$Collision.set_deferred("disabled", false)
|
Reference in New Issue
Block a user