I'm working on a side-scorlling game at the moment and im trying to make it so that if youre neither jumping nor touching the floor, but in the air, you fall to the floor. In the start script, i have 4 flags (jumping, falling, goingup, and goingdown) set to false. then when you enter the first level, the i have the following script:
if (element ("Apocolypse").collideRect element ("Floor"))=false{
falling=true
}
if (falling=true){
element ("Apocolypse").velocity.y=-100
}
i know that once i get to trying to add jumping to the mix, im gunna have to add:
&& jumping=false
to the "if", but for now, all i wanna know is why this one wont work. The error message i get is:
expresion could not be evaluated on line 4 (its actually line 4 cuz i got comments and crap above it): if (element("Apocolypse").collideRect element ("Floor")
1 error found.
so tell me, what is this error?? much thanx in advance.
www.freewebs.com/protocomics
the beginning of a very great comic. Will i ever continue? doubtful.
then in your scripts you can just use
if (Apocolypse.collideRect(Floor)==false){
falling=true
} NOTE THIS IS UNTESTED
You can simplify this further like so
thanx, now i get no error message. But still when the game opens up and you go to the first level, Apocolypse, a stick figure at the moment, just floats in the air... I'm going to attach the file here, so if you would be so kind as to dl it and fix it up or examine the script and tell me whats wrong with it, id be much appreciative. sorry for all the trouble, i just cant figure it out...
EDIT: ok i think i fixed it, beause by the time i get to the stage, he's gone. (im assuming he fell thru the floor) now i need some way to make it so that when he gets to the floor, he'll stop moving down. here's what i tried:
if (Apocolypse.hitcheck(Floor)==true){
falling=false
Apocolypse.velocity.y=0
}
i get a message saying:
hitcheck() is not a method of paint Apocoylpse. what do i do? thanx in advance.
Last edited by NireksAdvocate; 07-30-2003 at 05:12 PM.
www.freewebs.com/protocomics
the beginning of a very great comic. Will i ever continue? doubtful.
Ok, in the meantime, i began to work on the script for jumping. it starts out with
if (falling==false){
jumping==true
}
if (jumping==true){
Apocolypse.velocity.y=-100
after this, i want it to wait for 1.5 seconds and then set the velocity back to 100 'til it hits the floor. i know how to reset the velocity, but how do i make it wait a certain amount of time before doing it? thanx in advance. signing off--
www.freewebs.com/protocomics
the beginning of a very great comic. Will i ever continue? doubtful.