Newgrounds.com — Everything, By Everyone.

Checking login status…

USERNAME:

PASSWORD:

Logging in…

Logged in as:
.
Logging out…
Inbox My Account Log Out


Forum Topic: Player movement!...

(183 views • 5 replies)

This topic is 1 page long.

<< < > >>
None

TheV

Reply To Post Reply & Quote

Posted at: 10/23/06 06:17 PM

TheV NEUTRAL LEVEL 01

Sign-Up: 10/21/06

Posts: 31

This is a question regarding character movement for games....
So, I imported 3 images of a character walking forward into a sequence and
converted it into a movie clip. Its part of one layer and has 3 frame things...if that helps.
Anyways, how can I move my character and change its animation regarding the direction its appointed towards? Moreover, how can I make the character BE animated when it moves? and how can it stop at a keyup event? I couldnt find any detailed tutorials....please help!


None

Cybex

Reply To Post Reply & Quote

Posted at: 10/23/06 06:20 PM

Cybex NEUTRAL LEVEL 20

Sign-Up: 03/04/05

Posts: 7,746

At 10/23/06 06:17 PM, TheV wrote: This is a question regarding character movement for games....
So, I imported 3 images of a character walking forward into a sequence and
converted it into a movie clip. Its part of one layer and has 3 frame things...if that helps.
Anyways, how can I move my character and change its animation regarding the direction its appointed towards? Moreover, how can I make the character BE animated when it moves? and how can it stop at a keyup event? I couldnt find any detailed tutorials....please help!

This and this and this should give you a good start.


None

DarkMana

Reply To Post Reply & Quote

Posted at: 10/23/06 06:30 PM

DarkMana DARK LEVEL 22

Sign-Up: 04/04/05

Posts: 2,363

I'm feeling helpful today, so here you go. I'm going to assume you know how to make the player move and simply want to know how to make it play the relevant animation to each direction.

Inside of the player movieclip, have one frame for each direction. On each frame, have another movieclip of the animation for that direction. The label the direction frames 'up', 'left', whatever directions you have (no quotes around them, though). Then on the player movieclip, add this line of script to the block for each direction:

_root.player.gotoAndStop("direction");

Make sure to change direction for each block to the actual frame label you set, with quotes around it.

Now, you want to stop the walking animation when you stop moving, right? So after all the blocks of code for the different directions, add something along the lines of this:

if (!Key.isDown(Key.UP) && !Key.isDown(Key.DOWN) && !Key.isDown(Key.LEFT) && !Key.isDown(Key.RIGHT)) {
_root.player.gotoAndStop("stop frame");
}

Remember to change stop frame to the label of the frame within your player movieclip where the player is standing still (or whatever animation you want it to play when you aren't moving).

I hope I helped XD

[ P4 3.2GHz | 2GB RAM | RADEON X1650 | SB X-FI | DEATHADDER | G15 K/B | X-540 5.1 ]
BUILDING: CM590 | ASUS P5Q PRO | E8400 | MUSHKIN PC2-8000 2x2GB | RADEON 4850

BBS Signature

None

TheV

Reply To Post Reply & Quote

Posted at: 10/23/06 07:04 PM

TheV NEUTRAL LEVEL 01

Sign-Up: 10/21/06

Posts: 31

Inside of the player movieclip, have one frame for each direction. On each frame, have another movieclip of the animation for that direction. The label the direction frames 'up', 'left', whatever directions you have (no quotes around them, though). Then on the player movieclip, add this line of script to the block for each direction:

Sorry im new with Flash I dont understand... This is what i did. I inserted 4 blank keyframes and in each I imported images of my character facing each direction (up,down,left,right).
Then I got lost. You said, On each frame, have another movieclip of the animation for that direction How do I do that?


None

TheV

Reply To Post Reply & Quote

Posted at: 10/24/06 12:48 PM

TheV NEUTRAL LEVEL 01

Sign-Up: 10/21/06

Posts: 31

Ok :) I figured out how its done! Just one more problem... The player's speed is fine but
his legs are still moving really fast. How do I modify that?


None

Thereap

Reply To Post Reply & Quote

Posted at: 10/24/06 02:43 PM

Thereap EVIL LEVEL 04

Sign-Up: 08/14/05

Posts: 51

Edit it inside the movieclip.


All times are Eastern Daylight Time (GMT -4) | Current Time: 11:52 PM

<< Back

This topic is 1 page long.

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!