Super Gravity

Hi, ive got bored of my other games and i started a new one for the contest
Im hoping for it to be simple

Your a little blob that runs through the world and cant stop running

there will be little holes with spikes or just a hole

what code do i put to make gravity pull it down but when its on the ground
(MC â€śgroundâ€ť) it stops you

yhack

Make a variable called â€śGravityâ€ť.
When your blob makes collision with the hole in the ground start the Gravity by making it â€śtrueâ€ť. Hereâ€™s a little example:

// ------------------------------------------------------------>
// setup a gravity
onEnterFrame=function(){
if(Gravity){
//if true, make the blob fall
blob._y++
}
// check if the blob hits one of the holes
if(blob.hittest(hole,true)){
Gravity=true;
}else{
Gravity=false;
}
}
// ------------------------------------------------------------>

This is just one simple ex. If you want to make it right, there are just serval thinks more that you must do,â€¦ try to find more information about platform games.

Good luck!

Martijn Himpers

thx, how do i make a variableâ€¦ is it the thing in the text box when its dynamic and at the bottom?

:p: Making a variable is as simple as typing:

Gravity=true; â€¦orâ€¦ Gravity=false;

The value of Gravity is variableâ€¦true or false.
Other variables are for example:

myName=â€śyhackâ€ť; â€¦orâ€¦ myNumber=123;

The value of myName and myNumber, its variable,â€¦:p:

how bout:

OnClipEvent(enterFrame) {
gravity = 9.8;
_root.char._y += gravity;
}
OnClipEvent(enterFrame) {
if (_root.char.hitTest(ground)) {
_root.char._y -= 9.8;
}
}

OnClipEvent is flash 5,â€¦ i see you have typed twice the clipEvent enterframe.
The character doesnt fall when its standing on the ground, only when its hit a hole.