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.
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.
OnClipEvent(load) {
gravity = 9.8;
}
OnClipEvent(enterFrame) {
if (_root.blob.hitTest(hole)) {
_root.blob._y -= gravity;
}
}
Creating engaging and entertaining content for designers and developers since 1998.