Interactive Multimedia Coding Assignment – Post (Prototyping)

Adding animations

For autumn and winter I had said in my specification that I would like to have animations during them. In winter I have added snow falling and in autumn leaves floating.

I have a fair idea of how to do this from processing. I researched the code for AS, and found a great example on stackoverflow.com the tutorial “Generate random falling objects in AS3“. Using this code I manipulated it to give me the effects I wanted for my snow falling from below 0 on the X axis and changed it again for the leaves below 0 on the Y axis.

Screen Shot 2013-12-12 at 16.00.10 Screen Shot 2013-12-12 at 16.00.48

 

 

 

 

 

 

 

A problem I have now is that the snow and leafs remain to come onto the stage when the user navigates away from either the autumn or winter screen. I added in a boolean for the snow and leafs. I thought that this would be a good way of removing them, if the navigations are selected then change the boolean to false and have this set up that if boolean equals false use the removeChild function to remove the snow/leafs from the stage. This didn’t work. It only stopped the leafs/snow from adding to the stage but it did not remove what was already on it.

After speaking to ken he advised that I make and array for the snow and leafs. From this array I could make a function where you can remove the leafs/snow from the stage when the user navigates from the autumn/winter screen.

This worked really well and gave me the result i wanted.

Screen Shot 2013-12-12 at 16.26.29

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