Report
Save
Cancel
offline
rino
27 posts
Nomad
Posted September 24, '09 8:08pm UTC
I am making a platform game in AS2 for school and everything works, but the rotation of the character to the ground. The problem is, is that the character hits the symbol box and not the image inside it.So does anyone know how to make it hit the image and not the symbol box around it Here is the code: onClipEvent (load) { speed = 4; jump = 0; jumpheight = 9; gravity = 0.5; scale = _xscale; wid = _width/2; heig = _height/2; } onClipEvent (enterFrame) { _y -= jump; jump -= gravity; if (Key.isDown(Key.LEFT)) { _x -= speed; _xscale = -scale; } if (Key.isDown(Key.RIGHT)) { _x += speed; _xscale = +scale; } while (_root.ground.hitTest(_x, _y+heig, true)) { _y--; jump = -5; inair = false; if (inair == false && Key.isDown(Key.UP)) { jump = jumpheight; inair = true; } } while (_root.ground.hitTest(_x, _y-heig, true)) { jump = -jump; _y++; } while (_root.ground.hitTest(_x+wid, _y, true)) { _x--; } while (_root.ground.hitTest(_x-wid, _y, true)) { _x++; } } onClipEvent (enterframe) { if (_root.ground.hitTest(_root.player[" oint"])){ _root.player._rotation -= 1; trace("hit" ; }else{ _root.player._rotation +=1; trace("not" ; } }