Interactive Multimedia Coding Assignment – Post (Prototyping)

I also started working on my mini games.

First the spring mini game. The user has to collect the easter eggs into the basket. When all of the eggs are in the basket a message will appear on screen allowing the user to go back to the spring main screen.

The code i used for this game is the hitTestObject. When the easter eggs hit the basket this adds one to the counter i have created. When the counter is greater than 4 (All five ester eggs have been added to the basket) a message appears allowing the user to go back to the spring main screen.

To stop the code continuously checking if the objects have hit I have set booleans for each easter egg. This allowed me to create an if statement within the if statement for the hitTestObject that said, if the variable is equal to false then do this and change the variable equal to true which stops the program from continuously entering that if statement.

I have some chunks of the code below to help explain what I have done.

Screen Shot 2013-12-11 at 19.45.05 Screen Shot 2013-12-11 at 19.51.19 Screen Shot 2013-12-11 at 19.52.20

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s