Okay, this is the first mini tuturial which I hope'll turn into a series, I dunno about the others' thoughts on it. (sorry, no preloader, we had no time to whip one up or download one since there were some bugs and there was a deadline we had preset, plus, this comp here is on a 400 processor which often causes it to crash when doing flashes)
Please review! :D
READ THIS:
There is no sound because we had too many complaints about how people didn't want to listen to music while reading. They said it was distracting. Anyway, it's a tuturial on how to move an object with your keyboard using Action Script.
Note- it was supposed to move in a circle kinda so It'd stay in your sight range while you tryed to move it. I disabled up and down because people would play with it and make it move in front of the text.
I tryed to make it as neat as possible. (I made the panel and experimental ship) The script is below, so you can copy and paste it into your little A.S. box. SORRY IF IT'S A LITTLE HARD TO READ!
- - - -
SCRIPT USED: (FIXED!)
onClipEvent (enterFrame) {
speed += 5;
}
if (Key.isDown(Key.UP)) {
speed += 5;
}
if (Key.isDown(Key.DOWN)) {
speed -= 5;
}
if (Math.abs(speed)>20) {
speed *= .7;
}
if (Key.isDown(Key.LEFT)) {
_rotation -= 15;
}
if (Key.isDown(Key.RIGHT)) {
_rotation += 15;
}
speed *= .60;
x = Math.sin(_rotation*(Math.
PI/180))*speed;
y = Math.cos(_rotation*(Math.
PI/180))*speed*-1;
if (!_root.land.hitTest(_x+x , _y+y, true)) {
_x += x;
_y += y;
} else {
speed *= -.8;
}
}
- - - -
Credits:
Andrea364: Art and layout design
Soul-Eating-Reaper07: Scripting the ship and script (in the right side of the panel)
Haley87: Steps and descriptions
Hope you enjoy!