DEV Community

Viktor de Pomian Sandell
Viktor de Pomian Sandell

Posted on

Game is done...kinda"

Where we are?

https://depoco.itch.io/holy-carp

Ok, so the game is mostly done. I've uploaded it to itch.io. It's still missing a few elements, but I'll be adding more as I go.

This is only my second game ever, and honestly, I'm pretty happy with how it turned out. Of course, I wanted it to have tons of features and amazing gameplay, but those will come, step by step.

In this post, I'll dive deeper into my GameManager and some refactoring I did, the good stuff that keeps the project tidy and manageable.

What needs to be added

Some of the pixel sprites needs to be fixed, it seems that they got messed up when I imported it into Godot, no idea why.

Sort out the menu and make it look prettier and at the same time add the audio I have + the settings window.

GameManager stuff

So this is my final script for the GameMananger:

extends Node

signal lives_changed(new_lives)
signal score_changed(new_score)


var lives = 3
var current_score = 0

# KEEPING SCORE ---------------------------------

func _update_score(fish_score):
  current_score += fish_score
  score_changed.emit(current_score)

#------------------------------------------------

# HEALTH ----------------------------------------

func _decrease_life():
  if lives > 0:
    lives -=1
    lives_changed.emit(lives)

  if lives == 0:
    _game_over()

#------------------------------------------------

# GAME UI STUFF ---------------------------------

func _game_over():
  var game_over_scene = preload("uid://behejrhw6wlo7")

  var game_over_instance = game_over_scene.instantiate()
  var GameOverCanvas = get_node("/root/MainScene/GameOverCanvas")

  GameOverCanvas.add_child(game_over_instance)

  get_tree().paused = true

#------------------------------------------------

func reset_game():
  lives = 3
  current_score = 0
  lives_changed.emit(lives)
  score_changed.emit(current_score)
Enter fullscreen mode Exit fullscreen mode

It keeps track of score, lives and game over.

This is just a quick update. I'm starting a new game and have a lot on my plate right now, so progress on this post will be occasional.

I'll be adding more to it from time to time. Also, keep an eye out for new posts about my new game. I plan to release Part 1 next week.

My dear readers. Remember that everything I write is not always 100% correct. I do mistakes and I'm a novice at this. So if you find a mistake or just have some random feedback on anything. Please comment!

Top comments (0)