Game Design Examples (two approaches)

Hello Community,

this post is based on a request from Hype Beta subforum… but as the result might benefit somebody not using the beta (a smaller group on that restricted subforum)… I am posting this code in the public space of the forum.

It shows two ways to organise a game.

Version1 is based on a single init-Function

This version does all the setup (including click handler) from a single function that sets up the game on scene load. Has the benefit that everything code related for the game is in one single spot.

Version2 is based on the extension Global Behavior

This version uses custom behavior to communicate and run the timer. It has the benefit that multiple elements can react to behavior. Also the click handler are managed through Hype so it might be easier for beginners to understand.

Hope this helps somebody.

PS: Here is another similar code example but for a Wheel Of Fortune game:

PPS: I would love Hype to have a attachSymbol function to dynamically add symbols.


↑ look at original post
Updated the source… removed some little errors.