Skip to content

Commit

Permalink
420 Merge Fixes and Trail Fix (#492)
Browse files Browse the repository at this point in the history
* Radzo overwrite fixes, trail fixes
  • Loading branch information
monochromia authored Jul 4, 2022
1 parent b0b481b commit be83513
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 16 deletions.
14 changes: 5 additions & 9 deletions scenes/platformer/characters/Bus.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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)
Expand Down Expand Up @@ -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):
Expand Down
5 changes: 1 addition & 4 deletions scenes/platformer/characters/Trail.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 0 additions & 3 deletions scenes/title/TitleScreen.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down
Binary file added sprites/title_mario.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions sprites/title_mario.png.import
Original file line number Diff line number Diff line change
@@ -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

4 comments on commit be83513

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.