Skip to content

Commit

Permalink
Added Boss Ambient
Browse files Browse the repository at this point in the history
  • Loading branch information
moikheck committed Dec 8, 2021
1 parent 28e11ff commit 2eb1704
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 37 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,5 @@ We personally believe that this project/iteration deserves an A, based on the fo
- [Dungeon Music by Samuelbcf7](https://freesound.org/people/Samuelbcf7/sounds/578733/), licensed under [Creative Commons 0 License](http://creativecommons.org/publicdomain/zero/1.0/)
- [death monster sound 2 by ibm5155](https://freesound.org/people/ibm5155/sounds/174912/), licensed under [Creative Commons Attribution License](https://creativecommons.org/licenses/by/3.0/)
- [creature sounds » monster pain by soundmast123](https://freesound.org/people/soundmast123/sounds/571974/), licensed under [Creative Commons Attribution License](https://creativecommons.org/licenses/by/3.0/)
- All textures created by Michael Heckman.
- All texture assets created by Michael Heckman.
Arrangement of ["Robot Rock"](https://www.youtube.com/watch?v=sFZjqVnWBhc) used in Boss Ambient licensed under [Creative Commons Attribution License](https://creativecommons.org/licenses/by/3.0/)
Binary file added project/Characters/Enemies/Boss/wide-boi.wav
Binary file not shown.
2 changes: 2 additions & 0 deletions project/Characters/Enemies/Common/Enemy.gd
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ func _process(_delta):
if player_position.y < position.y:
velocity.y -= speed
$AnimatedSprite.play("walk")
if name == 'Boss':
get_parent().play_boss_ambient()
else:
velocity = Vector2.ZERO
$AnimatedSprite.play("default")
Expand Down
11 changes: 11 additions & 0 deletions project/Levels/Main/Level.gd
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ extends Node2D

var does_boss_exist := true
var player_position := Vector2.ZERO
var is_boss_ambient_playing := false

func _ready():
$Item.set_item("Potion", "null")
Expand All @@ -21,6 +22,12 @@ func get_player_position():
return player_position


func play_boss_ambient():
if not is_boss_ambient_playing:
is_boss_ambient_playing = true
$Boss/BossAmbient.play()


func _on_Chest_open(chest):
var position = chest.position
var new_item: Item = load("res://Levels/Main/Items/Item.tscn").instance()
Expand Down Expand Up @@ -60,3 +67,7 @@ func _on_BossArea_body_exited(body):
if body.name == 'Boss':
$BossWall.queue_free()
does_boss_exist = false


func _on_BossAmbient_finished():
$Boss/BossAmbient.play()
78 changes: 42 additions & 36 deletions project/Levels/Main/Level.tscn

Large diffs are not rendered by default.

0 comments on commit 2eb1704

Please sign in to comment.