I'm working on a mario game
I have the movment for mario down but geting him to go to the right frames/actions I've never realy worked out
could somone help please
this is the script
onClipEvent (load) {
grav = 0
speed = 0
jump = true
scale = _xscale;
}
onClipEvent (enterFrame) {
_y += grav
grav++
_x += speed
speed *= .8
while (_root.ground.hitTest(_x, _y, true) && grav >= 0) {
grav = 0
jump = false
_y--
}
while (_root.ground.hitTest(_x, _y-31, true)) {
grav = 0
_y++
}
while (_root.ground.hitTest(_x+8, _y, true)) {
speed = 0
_x--
}
while (_root.ground.hitTest(_x-8, _y, true)) {
speed = 0
_x++
}
while (_root.ground.hitTest(_x+8, _y-29, true)) {
speed = 0
_x--
}
while (_root.ground.hitTest(_x-8, _y-29, true)) {
speed = 0
_x++
}
if (grav >= 15) {
grav = 15
}
if (Key.isDown(Key.UP) && jump == false) {
grav -= 15
jump = true
}
if (Key.isDown(Key.RIGHT)) {
speed += 1
_xscale=+scale
}
if (Key.isDown(Key.LEFT)) {
speed -= 1
_xscale=-scale
}
if (Key.isDown(Key.RIGHT) && Key.isDown(65)) {
speed += .5
_xscale=+scale
}
if (Key.isDown(Key.LEFT) && Key.isDown(65)) {
speed -= .5
_xscale=-scale
}
}