mirror of
				https://github.com/JHDev2006/Super-Mario-Bros.-Remastered-Public.git
				synced 2025-11-04 08:35:41 +00:00 
			
		
		
		
	- Added new variables to `CharacterInfo.json` - Made it so `BlockCollision` area position is attached to top of `SmallCollision` and `BigCollision`
		
			
				
	
	
		
			19 lines
		
	
	
		
			452 B
		
	
	
	
		
			GDScript
		
	
	
	
	
	
			
		
		
	
	
			19 lines
		
	
	
		
			452 B
		
	
	
	
		
			GDScript
		
	
	
	
	
	
@tool
 | 
						|
extends CollisionPolygon2D
 | 
						|
 | 
						|
@export var offset := Vector2.ZERO
 | 
						|
@export var height := 0.0
 | 
						|
@export var hitbox := Vector3.ONE
 | 
						|
 | 
						|
var crouching := false
 | 
						|
 | 
						|
func _physics_process(_delta: float) -> void:
 | 
						|
	scale = Vector2(hitbox.x, hitbox.y)
 | 
						|
	if crouching and get_meta("scalable", true): scale.y *= hitbox.z
 | 
						|
	update()
 | 
						|
 | 
						|
func update() -> void:
 | 
						|
	var height_to_use = height
 | 
						|
	if get_meta("scalable", true):
 | 
						|
		position.y = -height_to_use / 2 * scale.y - offset.y
 |