diff --git a/scenes/platformer/characters/Bus.gd b/scenes/platformer/characters/Bus.gd index 907fb0eec..a7b3565df 100644 --- a/scenes/platformer/characters/Bus.gd +++ b/scenes/platformer/characters/Bus.gd @@ -8,11 +8,10 @@ onready var player : Player = owner onready var horn_sound : AudioStreamPlayer = get_node("Horn") onready var resting_sound : AudioStreamPlayer2D = get_node("brrrrrrrrr") onready var moving_sound : AudioStreamPlayer2D = get_node("moving_sound") +onready var collision: CollisionShape2D = get_node(collision_shape) enum busState {RESTING, MOVING}; var state -onready var collision: CollisionShape2D = get_node(collision_shape) - func _ready() -> void: @@ -21,12 +20,6 @@ func _ready() -> void: func _process(_delta: float) -> void: - if inventory.has_bus: - player.powerupspeed = 4 - player.powerupaccel = 2 - else: - player.powerupspeed = 1 - player.powerupaccel = 1 if (Input.is_action_pressed("right") or Input.is_action_pressed("left")): _set_state(busState.MOVING) @@ -66,13 +59,16 @@ func _activate_bus(active: bool) -> void: player.powerupaccel = 1 moving_sound.playing = false resting_sound.playing = false + else: + player.powerupspeed = 4 + player.powerupaccel = 2 func _set_state(newState): if(state == newState): return if (newState == busState.RESTING): animation = "standing" - playing = false + playing = true resting_sound.playing = true # When more state sounds are added that continuously should play moving_sound.playing = false # make all the sounds a dictionary. if (newState == busState.MOVING): diff --git a/scenes/platformer/characters/Trail.gd b/scenes/platformer/characters/Trail.gd index ebe3f878c..09a28699e 100644 --- a/scenes/platformer/characters/Trail.gd +++ b/scenes/platformer/characters/Trail.gd @@ -6,16 +6,13 @@ export(int) var trail_length = 5 var positions = [] var height = 0.0 -onready var parent = get_parent() onready var player: Node2D = owner - func _ready(): - randomize() var result = FileUtils._getFilePathsFromImport(textures_directory, ".png", ".jpg") var finalPath = result[randi() % result.size()] if result: - ResourceLoader.load(finalPath, "Texture") + texture = ResourceLoader.load(finalPath, "Texture") func _process(_delta): global_position = Vector2(0, 0) diff --git a/scenes/title/TitleScreen.gd b/scenes/title/TitleScreen.gd index 9fa11badf..506fecc0a 100644 --- a/scenes/title/TitleScreen.gd +++ b/scenes/title/TitleScreen.gd @@ -18,13 +18,10 @@ func alternate_title_screen(): var screen_index = randi() % label_texts.size() var mario_sprite = get_node("VBoxContainer/IdleMario") var size=mario_sprite.texture.get_size() - mario_sprite.texture = ResourceLoader.load(sprite_paths[screen_index].rstrip(".import"), "Texture") var sizeto=mario_sprite.texture.get_size() - var scale_factor = sizeto/size if sizeto < size else size/sizeto mario_sprite.scale=scale_factor - var mario_label = get_node("VBoxContainer/Mario") mario_label.text = label_texts[screen_index] mario_label.bbcode_text = "\n" + TextUtils.center(TextUtils.wave(TextUtils.rainbow(mario_label.text))) diff --git a/sprites/title_mario.png b/sprites/title_mario.png new file mode 100644 index 000000000..679b2e7c2 Binary files /dev/null and b/sprites/title_mario.png differ diff --git a/sprites/title_mario.png.import b/sprites/title_mario.png.import new file mode 100644 index 000000000..2a3a9f722 --- /dev/null +++ b/sprites/title_mario.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/title_mario.png-b9f50bd0b9134336f888935383617de3.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://sprites/title_mario.png" +dest_files=[ "res://.import/title_mario.png-b9f50bd0b9134336f888935383617de3.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=false +svg/scale=1.0