00:00
00:00
Newgrounds Background Image Theme

rabidcamper 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!

MiniTut: Keyboard+Object

Share Collapse

Author Comments

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!

Log in / sign up to vote & review!

Very nice

The "TUT" or "MINI-TUT" was notbad it is helpfull my opinion is that there should be some music maybe something subtle and light, Here was a nice tutorial I found this to be pretty interesting these tutorials are pretty good and they did a lot of help back in the day, not sure they can do much use today but they are still "GREAT-TUTORIALS" of the flash program and such, anyways great tutorial here.

~~THINGS TO IMPROVE ON~~
my opinion is that there should be some music maybe something subtle and light

~X~

Did not understand how to play thoug..

ADR3-N responds:

I have actually been considering deleting this. I was like ... 12

Also wow, you're fast!

Good, but needs music

You guys used some excess actionscript, but I'm fine with it, good job anyway, seing as it passed. :)

ADR3-N responds:

thx

nice tut

Now I've learned some great actionscripting thanks to you. Maybe we can work together sometime on a flash or something.

ADR3-N responds:

ok, cool

Sis, why so short?

It was helpful and all, but seriously, why one screen? When I get flash I'll come back to this.

ADR3-N responds:

Eh, idk. Lazy I guess

Credits & Info

Views
7,048
Faves:
2
Votes
12
Score
1.82 / 5.00

Uploaded
Aug 12, 2007
7:23 PM EDT