Postei recentemente no youtube um vĂdeo tutorial sobre criação de um game de carro em flash mx, e o usuário: juninhosantosMr reclamou o script, tentei responder mas estava dando erro, entĂŁo postarei aqui os cĂłdigos, seguem abaixo: carro: onClipEvent(load){ speed = 0; } onClipEvent (enterFrame) { if (Key.isDown(Key.UP)) { speed += 0.5; } if (Key.isDown(Key.DOWN)) { speed += -0.2; } if (Math.abs(speed)>10) { speed *= .7; } if (Key.isDown(Key.LEFT)) { _rotation -= 12; } if (Key.isDown(Key.RIGHT)) { _rotation += 12; } speed *= .98; x = Math.sin(_rotation*(Math.PI/180))*speed; y = Math.cos(_rotation*(Math.PI/180))*speed*-1; if (!_root.land3.hitTest(_x+x, _y+y, true)) { _x += x; _y += y; } else { speed *= -.10; } } chegada: onClipEvent (enterFrame) { if (_root.chegou, hitTest(_root.carro)) { _root.gotoAndPlay(2); } } Para acompanhar os trĂŞs vĂdeos tutorias: vĂdeo 1: http://www.youtube.com/watch?v=MYw1H7THo_U&feature=related vĂdeo 2: ...
Comentários
Postar um comentário