Welcome guest, here you can read the whole selected article.

The website with source code tutorials for programming flash games.
If you are looking for a fun, you can also play my online games.

Home | Tutorials | Games | Others | About »  Sign Up | Log In  « 



Create a Flash game like Deflection - continued

Posted on 10-Jul-2008, 14:42:03
Deflection Game Well, I didn't know what to do today so I read the newest tutorial by Emanuele Feronato called Create a Flash game like Deflection and I found this sentence at the end of it:

"If you want to write the code for player interaction, I will be happy to publish it, otherwise wait for me to do it."






And I write the code for player interaction as a continuation of his Deflection tutorial. Please read it first if you want to continue with my tutorial addition!

The main task was to add a mouse control so a player can draw lines from which the ball will bounce. After collision between the ball and a line drawn by mouse, that line must be removed!

I think all code is quite well commented so here it is:

In the main function called runMe add the next code immediatelly after the for-loop in which we are checking the walls for collisions:



At the end of the script add this code:



Well, it seems that’s all. Here is the result (try to draw lines with your mouse):




Complete source code you can download here!








No comments yet!



Please login if you wish to post your comments!

Games





Recent articles





Copyright 2009 © Ask For Game Task. All rights reserved.