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:
12
Scripts/Classes/Components/ScalableCollisionPolygon.gd
Normal file
12
Scripts/Classes/Components/ScalableCollisionPolygon.gd
Normal file
@@ -0,0 +1,12 @@
|
||||
@tool
|
||||
extends CollisionPolygon2D
|
||||
|
||||
@export var offset := Vector2.ZERO
|
||||
@export var height := 0.0
|
||||
|
||||
func _physics_process(_delta: float) -> void:
|
||||
update()
|
||||
|
||||
func update() -> void:
|
||||
var height_to_use = height
|
||||
position.y = -height_to_use / 2 * scale.y - offset.y
|
Reference in New Issue
Block a user