Daria K Posted March 20, 2016 Share Posted March 20, 2016 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 More sharing options...
mattstyles Posted March 21, 2016 Share Posted March 21, 2016 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. drhayes 1 Link to comment Share on other sites More sharing options...
pettergames Posted April 25, 2016 Share Posted April 25, 2016 great! good idea. I then use the games available like cool math games sugar sugar , cool math games run 3 , cool math games run , cool math cooking games , cool math games run 3 because I can not design Link to comment Share on other sites More sharing options...
Recommended Posts