Thread
:
Multiple images moving different directions
View Single Post
11-08-2012, 12:28 AM
PM User
|
#
29
Old Pedant
Supreme Master coder!
Join Date: Feb 2009
Posts: 23,210
Thanks: 59
Thanked 3,996 Times in 3,965 Posts
Here's a hint: The "bounce" code is here:
Code:
if ( x==0 || x==xmax || y==0 || y==ymax ) { bug.xspeed = - bug.xspeed; bug.yspeed = - bug.yspeed; }
Clearly, to do what you want, you need to keep the two kinds of bounces separate.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant
View Public Profile
Find More Posts by Old Pedant