커뮤니티로 돌아가기

대화

정꾼님의 글에서 이어진 답글 0개

정
정꾼@cksehddl8

자동차강좌 onClipEvent (enterFrame) { if (Key.isDown(Key.LEFT)) { _rotation -= 5; } if (Key.isDown(Key.RIGHT)) { _rotation += 5; } } onClipEvent (load) { speed = 0; } onClipEvent (enterFrame) { // make the car go forward if (Key.isDown(Key.UP)) { speed += 0.4; } // make the car go backwards if (Key.isDown(Key.DOWN)) { speed -= 1; } // tells the car to slow down after the speed of 30 if (Math.abs(speed)>30) { speed *= .7; } // you can change the rotation of the car to your desire if (Key.isDown(Key.LEFT)) { _rotation -= 9; _root.player._rotation -= 9; } if (Key.isDown(Key.RIGHT)) { _rotation += 9; _root.player._rotation += 9; } // here is where the hittest is for the boundary speed *= .98; x = Math.sin(_rotation*(Math.PI/180))*speed; y = Math.cos(_rotation*(Math.PI/180))*speed*-1; if (!_root.land.hitTest(_x+x, _y+y, true)) { _x += x; _y += y; } else { speed *= -.2; } // zoom out/in if ((Key.isDown(Key.UP)) && (_root.player._yscale>=75) && (_root.player._xscale>=75) && (_root.map.speed>=20)) { _root.player._yscale -= 5; _root.player._xscale -= 5;}} 바로이것