Friday, 8 January 2010

Bombs moving

So finally got the bombs firing up screen, couldn't understand at first why the bombs were following the tank but then it hit me I needed to update the position of the bomb every frame so therefore I placed my code in the function every frame this was also where my code for the user inputs is. I then decided that due to the amount of code that was going into this function I would be best to place the code into its own function which is called SpaceKeyPressed this takes in a movie clip and then works on the movei clip updating the code every second again this ties in with the user pressing the Spacebay hece the function name SpaceKeyPressed.


I have another snippet of my code to try and make this a bit more understanable:

No comments:

Post a Comment