Skip to content

Commit

Permalink
Background music (#10)
Browse files Browse the repository at this point in the history
* Fixed small issues

* Added Linux Game Jam 2018 splash screen

* Changed boss bug sprite

Also added jump and idle animations and animation triggers

* Fixed screen bugs triggering score ADD twice

* Changed score signal to pass only the current score

* Changed rocket label behavior to self contain all required calcs

* Fixed score score_changed connection

* Changed bugs attached to juan to also slows his movement speed

* Changed bugs behavior to take damage when tapping the interact action

* Added debug label showing when bugs child count is > 1

* Added penalty to ground bugs

* Added amount property to spawn_minions method of boss bug

* Fixed debug label not hiding when there are no bugs to debug

* Fixed label rocket being flipped

* Changed bugs penalty to also decrease player's jump height

* Removed button behavior from ground bug

* Added fighting module to Juan

* Added Mario-like stomp to Juan

* Removed pickup character

It isn't needed anymore

* Fixed camera drag margin

* Moved Juan animations from .tscn to dedicated .tres files

This eases the addition of Juan to the cutout_animation repository

* Moved Juan sprite to cutout_character folder

* Moved cutout resources to dedicated folder

* Recovered boss bug

* Fixed boss bug animation call

* Added independent actions for interaction and debugging

* Remove old bossbug sprite

* Added damage animation to boss bug

* Fixed uncompleted retry button not grabbing focus

* Added panel container style for game interface theme

* Added control binding screen

* Added controls option to main screen

* Fixed instructions to always show the correct key bound to the given action

* Added ending music

* Added main menu music to main_screen

* Changed background music to levels
  • Loading branch information
henriiquecampos authored Apr 18, 2018
1 parent 853a972 commit 399e06e
Show file tree
Hide file tree
Showing 9 changed files with 83 additions and 8 deletions.
Binary file added assets/bgm/ending_music.ogg
Binary file not shown.
18 changes: 18 additions & 0 deletions assets/bgm/ending_music.ogg.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[remap]

importer="ogg_vorbis"
type="AudioStreamOGGVorbis"
path="res://.import/ending_music.ogg-b5c9174cd3b9e6fc5d5275799b93d222.oggstr"

[deps]

source_file="res://assets/bgm/ending_music.ogg"
source_md5="bfab6c911c2a4b8168649865defb3045"

dest_files=[ "res://.import/ending_music.ogg-b5c9174cd3b9e6fc5d5275799b93d222.oggstr" ]
dest_md5="53966eef73348be9f470d555827b0bd7"

[params]

loop=true
loop_offset=0
Binary file added assets/bgm/main_menu_music.ogg
Binary file not shown.
18 changes: 18 additions & 0 deletions assets/bgm/main_menu_music.ogg.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[remap]

importer="ogg_vorbis"
type="AudioStreamOGGVorbis"
path="res://.import/main_menu_music.ogg-f9ddafbd7b8511d8b685e06768b80318.oggstr"

[deps]

source_file="res://assets/bgm/main_menu_music.ogg"
source_md5="912629009a4f170b5b0de9d82cb0eefa"

dest_files=[ "res://.import/main_menu_music.ogg-f9ddafbd7b8511d8b685e06768b80318.oggstr" ]
dest_md5="f9cff7ce58e5c14da0f662cc8f146683"

[params]

loop=true
loop_offset=0
31 changes: 29 additions & 2 deletions bgm.tscn
Original file line number Diff line number Diff line change
@@ -1,8 +1,25 @@
[gd_scene load_steps=2 format=2]
[gd_scene load_steps=3 format=2]

[ext_resource path="res://assets/bgm/background_music.ogg" type="AudioStream" id=1]
[ext_resource path="res://assets/bgm/ending_music.ogg" type="AudioStream" id=1]

[sub_resource type="Animation" id=1]

resource_name = "fade"
length = 1.0
loop = false
step = 0.1
tracks/0/type = "value"
tracks/0/path = NodePath(".:volume_db")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 1 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 0,
"values": [ -24.0, -4.0 ]
}

[node name="bgm" type="AudioStreamPlayer"]

Expand All @@ -12,4 +29,14 @@ autoplay = false
mix_target = 0
bus = "bgm"

[node name="animator" type="AnimationPlayer" parent="." index="0"]

root_node = NodePath("..")
autoplay = ""
playback_process_mode = 1
playback_default_blend_time = 0.0
playback_speed = 1.0
anims/fade = SubResource( 1 )
blend_times = [ ]


5 changes: 5 additions & 0 deletions levels/level_00.gd
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@ extends Node2D
export (String, FILE, "*.tscn") var next_level
export (String, FILE, "*.tscn") var current_level
export (int) var min_score = 0
const BGM_MUSIC = preload("res://assets/bgm/background_music.ogg")

func _ready():
if !bgm.stream == BGM_MUSIC:
bgm.stream = BGM_MUSIC
bgm.get_node("animator").play("fade")
bgm.play()
$rocket.set_minimum_score(min_score)
score_container.next_level = next_level
score_container.current_level = current_level
Expand Down
4 changes: 1 addition & 3 deletions levels/level_06.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[ext_resource path="res://actors/enemies/boss_bug/boss_bug.tscn" type="PackedScene" id=3]
[ext_resource path="res://actors/enemies/ground_bug.tscn" type="PackedScene" id=4]

[node name="level_00" index="0" instance=ExtResource( 1 )]
[node name="level_00" instance=ExtResource( 1 )]

next_level = "res://screens/promo_screen/promo_screen.tscn"
current_level = "res://levels/level_06.tscn"
Expand Down Expand Up @@ -34,12 +34,10 @@ editor/display_folded = true
[node name="boss_bug" parent="bugs" index="1" instance=ExtResource( 3 )]

position = Vector2( 1592, 464 )
penalty = 5

[node name="ground_bug" parent="bugs" index="2" instance=ExtResource( 4 )]

position = Vector2( 736, 520 )
penalty = 5


[editable path="juan"]
Expand Down
3 changes: 3 additions & 0 deletions screens/main_menu/main_screen.gd
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
extends "res://screens/basic_screen.gd"
var can_play = false
const BGM_MUSIC = preload("res://assets/bgm/main_menu_music.ogg")
func _ready():
var bus = AudioServer.get_bus_index("bgm")
$bgm_volume.value = AudioServer.get_bus_volume_db(bus)
bus = AudioServer.get_bus_index("sfx")
$sfx_volume.value = AudioServer.get_bus_volume_db(bus)
if !bgm.stream == BGM_MUSIC:
bgm.stream = BGM_MUSIC
if !bgm.is_playing():
bgm.play()

Expand Down
12 changes: 9 additions & 3 deletions screens/promo_screen/promo_screen.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,14 @@ script/source = "extends HBoxContainer

const BRIGHT = Color(1.1, 1.1, 1.1)
const DARK = Color(0.8, 0.8, 0.8)

const BGM_MUSIC = preload(\"res://assets/bgm/ending_music.ogg\")
func _ready():
bgm.get_node(\"animator\").play_backwards(\"fade\")
yield(bgm.get_node(\"animator\"), \"animation_finished\")
bgm.stream = BGM_MUSIC
bgm.play()
bgm.get_node(\"animator\").play(\"fade\")

for c in get_children():
c.connect(\"focus_entered\", self, \"bright\", [c])
c.connect(\"button_down\", self, \"darker\", [c])
Expand All @@ -48,9 +54,9 @@ func darker(button):
func open_link(link):
OS.shell_open(link)"
[node name="promo_screen" instance=ExtResource( 1 )]
[node name="promo_screen" index="0" instance=ExtResource( 1 )]
next_scene = "res://levels/level_01.tscn"
next_scene = "res://screens/main_menu/main_screen.tscn"
[node name="background" type="TextureRect" parent="." index="0"]
Expand Down

0 comments on commit 399e06e

Please sign in to comment.