Easy tutorial for making an overhead RPG flash game PART 1 - Movement. Any questions or concerns, leave a comment!
Actionscript:
charspeed = 5;
onEnterFrame = function () {
if (Key.isDown(Key.RIGHT)) {
_root.char._rotation = 90;
_root.char._x += charspeed;
}
if (Key.isDown(Key.LEFT)) {
_root.char._rotation = 270;
_root.char._x -= charspeed;
}
if (Key.isDown(Key.UP)) {
_root.char._rotation = 0;
_root.char._y -= charspeed;
}
if (Key.isDown(Key.DOWN)) {
_root.char._rotation = 180;
_root.char._y += charspeed;
}
if (Key.isDown(Key.RIGHT) && Key.isDown(Key.UP)) {
_root.char._rotation = 45;
}
if (Key.isDown(Key.LEFT) && Key.isDown(Key.UP)) {
_root.char._rotation = 315;
}
if (Key.isDown(Key.RIGHT) && Key.isDown(Key.DOWN)) {
_root.char._rotation = 135;
}
if (Key.isDown(Key.LEFT) && Key.isDown(Key.DOWN)) {
_root.char._rotation = 225;
}
};
dude u were so much better on ur old tuts u explained it all and stuff
N30nTuTorials 2 years ago