ForumsProgramming ForumGravity Problem

6 3031
Kevin4762
offline
Kevin4762
2,420 posts
Nomad

I have a problem with gravity, and it's really annoying.

Code:

onClipEvent(load){
speed=6
}
onClipEvent(enterFrame){
if(Key.isDown(Key.UP)){
_y -= speed
}
if(Key.isDown(Key.RIGHT)){
_x += speed
}
if(Key.isDown(Key.LEFT)){
_x -= speed
}
if(Key.isDown(Key.DOWN)){
_y += speed
}
if(hitTest(_root.wall)){
_y -= 0//right
_y += 6//left
}
}



I've added all the gravity codes to the parts where it was supposed to be placed in, but it breaks up and it won't work.

I don't really know what to do, and I've checked all the Flash sites but there isn't a code I'm using to move the ball. Can someone add the gravity code for me?
  • 6 Replies
Kevin4762
offline
Kevin4762
2,420 posts
Nomad

I realize this is an older version of Flash, had it since 2005, but I can't use my AS3 because it keeps fucking up. Sorry for the inconvenience, but I can't do it.

Louissi
offline
Louissi
66 posts
Peasant

There is no gravity in your code.

Louissi
offline
Louissi
66 posts
Peasant

where is the gravity implementation in your code? I can't see any

Kevin4762
offline
Kevin4762
2,420 posts
Nomad

I was making it so you control the gravity, and I couldn't find any sites that gave me the code for it. The ball has to get from Point A to point B. You control gravity so that you get your ball there. The graphics suck, but concept is sound. Thanks KomputerKurt. I never though about making it into values.

Showing 1-4 of 6