00:00
00:00
Newgrounds Background Image Theme

GasGrass just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

Actionscript codes here!

390,058 Views | 7,981 Replies
New Topic

Response to Actionscript codes here! 2010-04-26 16:01:50


....I even made my own thread about this, but maybe one of you can help me here.

Here's the code:

man_walk();

}
function man_walk (Key): void {

switch (Key) {

case "LEFT" :
man._rotation = 270;
man._x -= 4;
man.gotoAndStop(2);
break;

case "RIGHT" :
man._rotation = 90;
man._x += 4;
man.gotoAndStop(2);
break;

case "UP" :
man._y -= 4;
man._rotation = 0;
man.gotoAndStop(2);
break;

case "DOWN" :
man._y += 4;
man._rotation = 180;
man.gotoAndStop(2);
break;

default:
break;
}

}

Im trying to make the code for movement of a character for an rpg game much easier to read by putting it into a switch method, only problem is that I need a keylistener, but I dont know how to put one in my code, and connect it back to the program for this code to work.

Again, all I'm doing is trying to make the code that makes a character move using WASD keys more simpler, but I dont know the Full Code or the exact way how. So, all I need is just some help....

And for God's sake, someone help me, lol! I've been on like 10 different forums, with almost no luck xD....thanks in advance. ~Devicer4321

Response to Actionscript codes here! 2010-04-26 17:16:51


This thread is not for asking questions (that's what the actual forum is for), it's for sharing cool snippets of code.

Seeing however that this has not been the case for years, and most of the snippets here are outdated anyway, I think it's time we lock this baby up.

Thread from '03; I salute you.