View Full Version : simple stuff
soundgarden
08-05-2003, 03:52 PM
This may be really easy to do but im having trouble. I want a movie clip that moves to the right and when it hits a wall MC it moves to the left and then moves to the right again after it hits another wall. Basically like pong.
sandman9
08-05-2003, 04:35 PM
you can do a if (_x > __place value here__ ) then ball -= -1; ..... and same thing for the other side but with a if (_x <..... then ball += +1;
Let me know if that makes sense
Sandman9
soundgarden
08-05-2003, 05:57 PM
im sorry I don't get it.
sandman9
08-05-2003, 09:39 PM
oppps sorry, ignore that ...... i've seen this before. It's usually a onClipEvent (load) action that first determines the movement
Then there's a onClipEvent (enterframe) action that has the If statements. Maybe someone can post a link to an example they've seen recently for you
Sorry bout that
Sandman9
Warrior
08-05-2003, 11:05 PM
It's called a hit test and there are a lot of source files in the message board. Check out CyanBlues thread as he has what you're looking for. If not then tell me and I will make you the code :D
patmanwb
08-05-2003, 11:27 PM
take a look at the file i attached.
There is a ball movie clip with 2 event handlers.
Pretty straightforward.
soundgarden
08-06-2003, 10:03 AM
Thanks!
You know when I want to make a script its hard to think of how doing it but looking at a completed script it is soooo simple.
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.