Tutorial Island


Hi all,

I've been working on a tutorial level lately. I'll use this devlog to share some challenges I faced with this.

First of all I needed to create some kind of messaging system to communicate with a user via text. Implementing this was tougher than I thought it would be. This message system had to do 4 things. 

  •  Show a message to the user
  • These messages need to have a next/close button
  • Sometimes the camera needs to be moved to a certain position

And the most challenging requirement:

  • Messages need to be triggered by things happening in game. (For example: Reaching a certain amount of gold.)

This last one was was especially a challenge because this could be coming from anywhere in the game. Now I could simply add a line of code to the GameManager class saying: "if gold < 500 => display a message". But that would mean I would have to add these kinds of statements on every class that spawns a message. And what if I wanted to show the message in level 1 at 500 gold, but then in level 2 I need to show a message at 750 gold?   This won't work, so what did I do? 

I already had a place to store unique level data, so added the message checks in there! These classes have access to the game manager which contains most of the game data like gold and enemies in game etc. So in the levelOneData class I added a check in the update method saying: "if GameManager.gold < 500 => display a message"

This is working great so far!

The only downside with this implementation is that I need to create a separate class for every level. Although this might mean there will be a whole lot of classes in the end the could will remain clean and I know where to look if I need to make adjustments.

I'm curious to find out how my fellow game developers would approach this. So if you have an idea, be sure to shoot me a message!


Leave a comment

Log in with itch.io to leave a comment.