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!!!
Publicidade
|
|
Page 1 of 1
Jogo De Carro help ae pessoal!
#2
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
Share this topic:
Page 1 of 1
Similar Topics
| Topic | Forum | Started By | Stats | Last Post Info | |
|---|---|---|---|---|---|
|
Game baseado em "Scott Pilgrim" homenageia jogos clássicos; veja trailer
|
Notícias |
Notícias
|
|
|
|
Carro elétrico desperta interesse, mas permanência é incerta
|
Notícias |
Notícias
|
|
|
|
Asp enviando var pro flash
Ajuda rapida! HELP |
Flash & ActionScript |
raseckefa
|
|
|
|
Coluna de Artigos de Jogos no Portal
|
Jogos |
Danilo Santana
|
|
|
|
Pac-Man humano usa 111 pessoas para recriar jogo clássico
|
Notícias |
Notícias
|
|
|
|
Carro da Audi vai subir montanha sem motorista
|
Notícias |
Notícias
|
|
|
|
menu pop-up
HELP!!!!!! |
Dreamweaver |
marly prado
|
|
|
|
Jogo em flash
|
Flash & ActionScript |
Wouf
|
|
Publicidade
|
|

Help













