Jump to content

Cooking/Serving game tutorial


Daria K
 Share

Recommended Posts

Hello everyone, I am new to phaser and I have an assignment to create a cooking/serving game(using phaser).. you know, where you have customers and you have to cook burgers e.g., you have time and some goal. I can't really find a useful phaser tutorial for such game. And I can't write the logic myself. So I was wondering has anyone seen such a tutorial, or can you link me some other useful readings and tutorials, that will help me get started. 

These are similar games to what I want to create: 1. http://www.y8.com/games/delicious_burger_shop   2. http://www.y8.com/games/breakfast_bar   3. http://www.y8.com/games/oscar_mayer_deli_creations

Link to comment
Share on other sites

I think the point of an assignment is that you're supposed to work out how to do the logic! Although research is a good thing too!

At its essence I'd guess this assignment taxes your use of timers and list management.

You probably need to manage a couple of timers, one for each order (the fail condition is normally that you've taken too long to fulfil an order), possibly another timer for when a new customer arrives, or maybe multiple timers for when you get new ingredients etc etc. So, quite a lot of time management for both the player and for you as the developer. You could set up one single timer (normally known as a tick, or game tick) and hang your timers off of that, or set up multiple timers. Use `requestAnimationFrame` for your timers, or a small library that wraps it (I think Phaser handles this for you, but its worth you knowing how it happens). Both the 'single tick' and 'multiple timers' have merit, its up to you which to choose, the single tick is probably more popular but it might be easier just to set up new timers when you need them, either way is fairly simple.

You'll have to create a system for managing those timers though, i.e. what happens when they run out, how do you cancel them when they are no longer valid etc etc. The easiest way, and the way probably taught by your course, is to use event emitters, or employ the publisher/subscriber pattern i.e. when a timer finishes you fire an event (or message) and anyone listening responds. This is usually how people starting out structure their applications and its fairly popular amongst professional apps too.

So, if you're researching, you don't need a tutorial specifically for this type of game. Research time management, list management and publisher/subscriber pattern, there will be a glut of info via google on those topics and they aren't JS specific either (although you will find plenty that are), these are programming problems that exist in almost any environment/language you use.

Link to comment
Share on other sites

  • 1 month later...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...