Skip to content

Commit

Permalink
Merge pull request #27 from Nogal/winning
Browse files Browse the repository at this point in the history
"win" condition
  • Loading branch information
Nogal committed Nov 12, 2023
2 parents 791370f + dba61c0 commit ef71015
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 10 deletions.
2 changes: 2 additions & 0 deletions locale/locale.csv
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ KEY_EXIT,Exit,終了
KEY_LANGUAGE,日本語,English
KEY_MENU,Menu,メニュー
KEY_RETRY,Retry,リトライ
KEY_DEATH,You've been eaten!,食べられちゃった!
KEY_TOO_BIG,You're too big for the ecosystem!,生態系にはでかすぎるよ!
Binary file modified locale/locale.en_US.translation
Binary file not shown.
Binary file modified locale/locale.jp.translation
Binary file not shown.
4 changes: 1 addition & 3 deletions src/Enemies/Spawner.gd
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ func _process(delta):


func _on_timer_timeout():
print("spawning")

var mob = mob_scene.instantiate()

var extents = get_node("Area2D/CollisionShape2D").shape.extents
Expand All @@ -26,7 +24,7 @@ func _on_timer_timeout():

mob_position.x = (randi() % int(round(extents.x))) - (extents.x/2) + center.x
mob_position.y = (randi() % int(round(extents.y))) - (extents.y/2) + center.y
print(mob_position)

mob.position = mob_position
add_child(mob)
get_node("Timer").set_wait_time(random_time)
Expand Down
2 changes: 0 additions & 2 deletions src/Enemies/badfish.gd
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,10 @@ func _process(delta):

func _on_area_entered(area):
if area.is_in_group("player"):
print("I am dead!")
queue_free()
pass # Replace with function body.


func _on_visible_on_screen_notifier_2d_screen_exited():
print("I have traveled to the nether!")
queue_free()
pass # Replace with function body.
1 change: 1 addition & 0 deletions src/Levels/level1.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,4 @@ position = Vector2(1248, 480)

[connection signal="eat_counter_increased" from="Steven" to="BonesDisplay" method="_on_steven_eat_counter_increased"]
[connection signal="steven_died" from="Steven" to="DeathMenu" method="_on_steven_died"]
[connection signal="steven_too_big" from="Steven" to="DeathMenu" method="_on_steven_steven_too_big"]
8 changes: 4 additions & 4 deletions src/Player/steven.gd
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,30 @@ var dead = false

signal eat_counter_increased
signal steven_died
signal steven_too_big

# Called when the node enters the scene tree for the first time.
func _ready():
self.scale = self.scale * 0.5


func grow_steven_grow():
number_eaten += 1
var tween = get_tree().create_tween()
get_node("Burp").play()
if number_eaten % 5 == 0:
#if (int(self.scale.x * 10) + 1) % 5 == 0:
MusicPlayer._song_go_up()
eat_counter_increased.emit(number_eaten)
self.scale += Vector2(0.05, 0.05)
tween.tween_property($StevenSprite, "scale", Vector2(1.2, 1.2), 0.15).set_trans(Tween.TRANS_SINE)
tween.tween_property($StevenSprite, "scale", Vector2(1, 1), 0.15).set_trans(Tween.TRANS_SINE)
if self.scale > Vector2(6.0, 6.0):
steven_too_big.emit()
MusicPlayer.queue_song(1)


# Called every frame. 'delta' is the elapsed time since the previous frame.
func _physics_process(delta):

position.x = wrapf(position.x, 0, screen_size.x)
#position.y = wrapf(position.y, 0, screen_size.y)
player_movement(delta)

func player_movement(delta):
Expand Down
8 changes: 8 additions & 0 deletions src/menu/death_menu.gd
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ func _process(delta):


func _on_steven_died():
get_node("Message").set_text(tr('KEY_DEATH'))
self.visible = true
pass # Replace with function body.

Expand All @@ -29,3 +30,10 @@ func _on_retry_pressed():
func _on_menu_pressed():
unpause()
SceneManager.change_scene("res://src/menu/main_menu.tscn")


func _on_steven_steven_too_big():
get_node("Message").set_text(tr('KEY_TOO_BIG'))
get_tree().paused = true
self.visible = true
pass # Replace with function body.
8 changes: 8 additions & 0 deletions src/menu/death_menu.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,13 @@ offset_right = 896.0
offset_bottom = 512.0
text = "KEY_MENU"

[node name="Message" type="Label" parent="."]
offset_left = 320.0
offset_top = 128.0
offset_right = 832.0
offset_bottom = 256.0
horizontal_alignment = 1
vertical_alignment = 1

[connection signal="pressed" from="Retry" to="." method="_on_retry_pressed"]
[connection signal="pressed" from="Menu" to="." method="_on_menu_pressed"]
2 changes: 1 addition & 1 deletion src/menu/main_menu.gd
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func _on_exit_pressed():

func update_language():
get_node("Start").set_text(tr("KEY_START"))
get_node("RichTextLabel").text = "[center][wave] [rainbow freq=.2 sat=0.8 val=0.9 ]" + tr("KEY_TITLE")
get_node("RichTextLabel").text = "[center][wave amp=100.0] [rainbow freq=.2 sat=0.8 val=0.9 ]" + tr("KEY_TITLE")
get_node("Exit").set_text(tr("KEY_EXIT"))
get_node("Language").set_text(tr("KEY_LANGUAGE"))

Expand Down

0 comments on commit ef71015

Please sign in to comment.