Copy link to clipboard
Copied
Hello !
I was searching in Internet for how to make a flash game plataform in Adobe Animate CC. I found this video (is in spanish) tutorial flash - crear juego plataforma - YouTube for make a simple game (I dont want something professional, simple, im a noob ). This code is for ActionScript 2.0, but the new versions of Flash Pro & Animate only accepts ActionScript 3.0
.
I dont know if anyone has a similar code for AS3, transcribe the code to AS3, or help me for how to traduce it (im noob), ill thank you so lot ?
Character Code:
onClipEvent (load) {
xvel = 6;
yvel = 0;
salto = -8;
limite = 10;
}
onClipEvent (enterFrame) {
if (_root.suelo.hitTest(_x, _y+_height/2, true)) {
while (_root.suelo.hitTest(_x, -2+_y+_height/2, true)) {
_y--;
}
yvel = 0;
if (Key.isDown(Key.UP)) {
yvel = salto;
_y += yvel;
}
} else if (_root.suelo.hitTest(_x, _y-_height/2, true)) {
yvel = yvel*-1;
_y += yvel;
while (_root.suelo.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.suelo.hitTest(_x+_width/2, _y, true)) {
_x--;
}
while (_root.suelo.hitTest(_x-_width/2, _y, true)) {
_x++;
}
}
onClipEvent (enterFrame) {
if(Key.isDown(Key.LEFT)){
this._xscale = -100
}else
if(Key.isDown(Key.RIGHT)){
this._xscale = 100
}
}
Code for next room:
onClipEvent(enterFrame){
if(this.hitTest(_root.personaje)){
_root.nextFrame();
}
}
I hope that you help me in this situation, im so excited for my first game in Adobe Animate CC .
that's weak as2 code so you would be better off googling: actionscript 3 platform game tutorial
Copy link to clipboard
Copied
that's weak as2 code so you would be better off googling: actionscript 3 platform game tutorial
Find more inspiration, events, and resources on the new Adobe Community
Explore Now