PDA

View Full Version : Flash Game: Platformer


chigsam
07-08-2007, 01:08 AM
See i just started doing things with flash and learning a little. I decided to make a simple platformer. The only problem is, is when ever i try to make more the one block (my ground) my ball doesnt detect any collision with it. any help here?

onClipEvent (enterFrame) {
if (!this.hitTest(this._parent.block)) {
vspeed += .05;
} else {
landed = 1;
vspeed = 0;
}
if (vspeed>5) {
vspeed = 5;
}
_y += vspeed;
}


Thanks for all you who read this ;)

Noct
07-09-2007, 06:23 PM
Welcome aboard.
You won't get collision with more then one object, since you are only hitTesting one object - "block"
You need to hitTest any item you want collision with, using either multiple hitTests, "or" statements, or one hitTest and an array of objects.