Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Change code from AS2 to AS3

New Here ,
Feb 28, 2016 Feb 28, 2016

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 .

TOPICS
ActionScript
658
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Feb 28, 2016 Feb 28, 2016

that's weak as2 code so you would be better off googling:  actionscript 3 platform game tutorial

Translate
Community Expert ,
Feb 28, 2016 Feb 28, 2016
LATEST

that's weak as2 code so you would be better off googling:  actionscript 3 platform game tutorial

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines