Codigos de Action_Script

Codigos para jogo de Dress"Up :

CODIGO PARA A CAMISA:

 

on(press){

startDrag("");

}

on(release){

stopDrag();

}

 

CODIGO PARA A CALÇA:

 

on(press){

startDrag("");

}

on(release){

stopDrag();

}

 

Codigos para jogo em Shoting"Up :

onClipEvent(load){

 Mouse.hide();

 }

 onClipEvent(enterFrame){

 _x=_root._xmouse;

 _y=_root._ymouse;

 }

 

stop();

 

_root.tiros +=1;

 

on (press) {

 this.gotoAndStop(2);

}

 

 tiros = 0;

 stop();

Codigo para jogo em Plataforma :

Jogador

 

onClipEvent (load) {

xvel = 6;

yvel = 1;

salto = -12;

limite = 10;

}

onClipEvent (enterFrame) {

if (_root.solo.hitTest(_x, _y+_height/2, true)) {

while (_root.solo.hitTest(_x, -2+_y+_height/2, true)) {

_y--;

}

yvel = 0;

if (Key.isDown(Key.UP)) {

yvel = salto;

_y += yvel;

}

} else if (_root.solo.hitTest(_x, _y-_height/2, true)) {

yvel = yvel*-1;

_y += yvel;

while (_root.solo.hitTest(_x, _y-_height/2, true)) {

_y++;

}

} else {

_y += yvel;

if (yvel<=limite) {

yvel++;

}

}

_x += (Key.isDown(Key.RIGHT)-Key.isDown(Key.LEFT))*xvel;

while (_root.solo.hitTest(_x+_width/2, _y, true)) {

_x--;

} while (_root.solo.hitTest(_x-_width/2, _y, true)) {

_x++;

}

}

 

passa de fase

 

onClipEvent (enterFrame) {

if (this.hitTest(_root.jogador)) {

_root.gotoAndPlay(3);

}

}

 

Vcam

 

onClipEvent (enterFrame) {

_y += (_root.jogador._y-_y)/4;

_x += (_root.jogador._x-_x)/4;

}

 

fundo

 

parentColor.setTransform(camColor.getTransform());

function camControl() {

parentColor.setTransform(camColor.getTransform());

var scaleX = sX/this._width;

var scaleY = sY/this._height;

_parent._x = cX-(this._x*scaleX);

_parent._y = cY-(this._y*scaleY);

_parent._xscale = 100*scaleX;

_parent._yscale = 100*scaleY;

}

function resetStage() {

var resetTrans = {ra:100, rb:0, ga:100, gb:0, ba:100, bb:0, aa:100, ab:0};

parentColor.setTransform(resetTrans);

_parent._xscale = 100;

_parent._yscale = 100;

_parent._x = 0;

_parent._y = 0;

}

var oldMode = Stage.scaleMode;

Stage.scaleMode = "exactFit";

var cX = Stage.width/2;

var cY = Stage.height/2;

var sX = Stage.width;

var sY = Stage.height;

Stage.scaleMode = oldMode;

var camColor = new Color(this);

var parentColor = new Color(_parent);

this.onEnterFrame = camControl;

camControl();

this.onUnload = resetStage;

 

restarte

 

onClipEvent(enterFrame) {

if(_root.jogador.hitTest(this)) {

_root.jogador._x = 58.0

_root.jogador. y = 93.0

}

}

 

Mais codigos ? pesquise no meu canal do outube ou no google : canal do youtube  Murilobbb45

Procurar no site

© 2010 Todos os direitos reservados.