mirror of
				https://github.com/JHDev2006/Super-Mario-Bros.-Remastered-Public.git
				synced 2025-11-04 08:35:41 +00:00 
			
		
		
		
	* Global.gd now has an extra variable for current room type * ResourceSetterNew.gd now has variation category for room types The state variable also had to include the room type, since it wouldn't update properly when entering a bonus room from a level that's already underground * LevelClass.gd sets room type on update_theme A new function, get_room_type() allows for the level's room type to be detected, which can easily be overwritten by other level classes. Bonus Rooms are detected by comparing the level's scene path to a pre-defined list of bonus rooms. * Added get_room_type() to CoinHeaven.gd * Added get_room_type() to PipeCutscene.gd Also updates the room type in _enter_tree() since update_theme() isn't called here. * Added get_room_type() to TitleScreen.gd
		
			
				
	
	
		
			35 lines
		
	
	
		
			828 B
		
	
	
	
		
			GDScript
		
	
	
	
	
	
			
		
		
	
	
			35 lines
		
	
	
		
			828 B
		
	
	
	
		
			GDScript
		
	
	
	
	
	
class_name PipeCutscene
 | 
						|
extends Level
 | 
						|
 | 
						|
static var seen_cutscene := false
 | 
						|
 | 
						|
func _enter_tree() -> void:
 | 
						|
	Global.game_paused = false
 | 
						|
	theme = WORLD_THEMES[Global.current_campaign][Global.world_num]
 | 
						|
	if Global.world_num > 4 and Global.world_num <= 8:
 | 
						|
		theme_time = "Night"
 | 
						|
	else:
 | 
						|
		theme_time = "Day"
 | 
						|
	Global.current_room = get_room_type()
 | 
						|
	Global.level_theme = theme
 | 
						|
	Global.theme_time = theme_time
 | 
						|
 | 
						|
func _ready() -> void:
 | 
						|
	Global.current_level = null
 | 
						|
	seen_cutscene = true
 | 
						|
	first_load = true
 | 
						|
	$Music.play()
 | 
						|
 | 
						|
func update_next_level_info() -> void:
 | 
						|
	pass
 | 
						|
 | 
						|
func go_to_level() -> void:
 | 
						|
	first_load = true
 | 
						|
	Global.transition_to_scene(LevelTransition.level_to_transition_to)
 | 
						|
 | 
						|
func play_pipe_sfx() -> void:
 | 
						|
	AudioManager.play_sfx("pipe", $Player1.global_position)
 | 
						|
 | 
						|
func get_room_type() -> Global.Room:
 | 
						|
	return Global.Room.PIPE_CUTSCENE
 |