..:: MX Studio Fóruns ::..: Jogo De Carro - ..:: MX Studio Fóruns ::..

Jump to content

Publicidade




Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Jogo De Carro help ae pessoal!

#1 User is offline   lmiyagi 

  • Group: Membros
  • Posts: 3
  • Joined: 06-February 07

Posted 15 February 2007 - 06:07 AM

ola pessoal, blz?

to aki,com um jogo de carro...

http://img264.imageshack.us/my.php?image=carroht1.swf

ta, o carro mexeu com a seguinte action no "carro":
onClipEvent (load) {
var thrust:Number = 5;
var decay:Number = .85;
var maxSpeed:Number = 10;
var xSpeed:Number = 0;
var ySpeed:Number = 0;
var live:Boolean = true;
}
onClipEvent (enterFrame) {
if (live) {
if (Key.isDown(Key.UP)) {
xSpeed += thrust*Math.sin(_rotation*(Math.PI/180));
ySpeed += thrust*Math.cos(_rotation*(Math.PI/180));
this.gotoAndStop(2);
} else {
xSpeed *= decay;
ySpeed *= decay;
this.gotoAndStop(1);
}
if (Key.isDown(Key.DOWN)) {
xSpeed -= thrust*Math.sin(_rotation*(Math.PI/180));
ySpeed -= thrust*Math.cos(_rotation*(Math.PI/180));
} else {
xSpeed *= decay;
ySpeed *= decay;
this.gotoAndStop(1);
}
if (Key.isDown(Key.RIGHT)) {
this._rotation += 5;
}
if (Key.isDown(Key.LEFT)) {
this._rotation -= 5;
}
if (Key.isDown(Key.DOWN)) {
xSpeed -= thrust*Math.sin(_rotation*(Math.PI/180));
ySpeed -= thrust*Math.cos(_rotation*(Math.PI/180));
}
speed = Math.sqrt((xSpeed*xSpeed)+(ySpeed*ySpeed));
if (speed>maxSpeed) {
xSpeed *= maxSpeed/speed;
ySpeed *= maxSpeed/speed;
}
this._y -= ySpeed;
this._x += xSpeed;
}
}

ate ai blz, mas como q eu faço pra ele colidi com a pista?
fiz um Movie Clip e chamei-o de "pista"....
dai eu tmb quero saber como q faz um adversario colidir tmb e pro adversario andar ...

please help-me!!!
0

#2 User is offline   kesc 

  • Group: Membros
  • Posts: 4
  • Joined: 06-April 07

Posted 06 April 2007 - 07:16 PM

Você precisa usar o _root,fazer com que certo local X e certo local Y parem o carro.Não lembro muito bem mas é algo parecido
0

#3 User is offline   ViníciusAN 

  • Group: Membros
  • Posts: 1
  • Joined: 06-April 07

Posted 07 April 2007 - 02:43 PM

pra colidir eu acho q é o comando hitTest()
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic



Publicidade




1 User(s) are reading this topic
0 membro(s), 1 visitante(s) e 0 membros anônimo(s)