Internet Commerce

Partners & Affiliates














Developer Channel

internet.com


Tutorials Home What's New Top Rated Submit myTutes Random!

Search Tutorials


Tutorials Tutorials » Games

Categories Easily make a realistic reflection angle
Author: Jeff Allen | Website: www.hemogoblin.cjb.net |

 
Page 2
«prev 1 2 3 next»

Now make a line on each side of the screen and one on the top too, convert each of them to movie clips, call the side ones wall1 and wall2 and call the top one top.now heres the big part...put all of this in the second keyframe:

ball._x+=xspeed;
ball._y+=yspeed;
if (ball.hitTest(paddle)) {
 yspeed*=-1;
 yspeed+=-.5;
 xspeed=(ball._x-paddle._x)/2;
}
if (ball.hitTest(wall1)) {
 xspeed*=-1;
}
if (ball.hitTest(wall2)) {
 xspeed*=-1;
}
if (ball.hitTest(top)) {
 yspeed*=-1;
}
if (ball._y>=450) {
 ball._x=150;
 ball._y=125;
 xspeed=10;
 yspeed=10;
}

«prev 1 2 3 next»

» Level Intermediate

Added: : 2004-09-15
Rating: 5.40 Votes: 22
Hits: 1332
» Author
Use this tutorial to make a game like breakout or pong, i have a version of pong on my cheap as free website, check it out
» Download
Download the files used in this tutorial.
Download (0 kb)
Get conversion and unzipping tools for PC and Mac here!

» Forums
More help? Search our boards for quick answers!

Please rate this tutorial, 10 is the top rating, you can also click the comments link to read/write a review.
10 9 8 7 6 5 4 3 2 1
Read or Post Comments
 
   
 


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers