PDA

View Full Version : Side scrolling game - gravity


TriXteR
04-14-2002, 03:37 PM
what I have for gravity is


onClipEvent (enterFrame) {
if (ground == "true") {
} else {
setProperty ("/bird", _y, Number(getproperty("/bird", _y))+10);
x_value = getproperty("/bird", _x);
y_value = getproperty("/bird", _y);
}
}


where "bird" is the character and "ground" is turned on by a looped 2 frame hittest in all my ground objects


flag = this.hitTest("/bird");
if (flag == true) {
tellTarget ("/") {
gotoAndStop ("hit");
}
}
if (flag == true) {
tellTarget ("/grav") {
ground = "true";
}
}


to either side of the ground object are invisable ground objects that do the same thing except turn "ground" off

now... this works... but it's not very effective... I can't ever make enemies affected by gravity... I was hoping there is an easier, more practical way.... :(

can any body help? :(