PDA

View Full Version : creating a character for my game



bombsledder
February 12th, 2004, 05:32 PM
im creating a character for my game and i want this character to go up down left and right. I want him to while using an action to make him look like he is moving.

can someone look at this and tell me how to do this please.


thank you for your time

jbrereton3
February 13th, 2004, 11:16 PM
Hey bombsledder,
I've been making characters lately but the big question is what view are you wanting??? (Side on / Above???)

I'm not excelent with Action Script but tell me your veiw and I'll have a bash at it!!!

jbrereton3

Fargate
February 14th, 2004, 08:54 AM
I know how to do that....but it say's unexpected file format when I download it. Are you using MX 2004?

Fargate
February 14th, 2004, 09:18 AM
Here's a script that you could you use to do what you want seeing as I can't access your game file.


onClipEvent (enterFrame) {
if (Key.isdown(KEY.LEFT)) {
this.play();
this._xscale = -100;
this._x -= 8;
}
}
onClipEvent (enterFrame) {
if (Key.isdown(KEY.RIGHT)) {
this.play();
this._xscale = 100;
this._x += 8;
}
}
onClipEvent (enterFrame) {
if (Key.isdown(KEY.UP)) {
this.gotoAndPlay(4);
this._y -= 8;
}
}
onClipEvent (enterFrame) {
if (Key.isdown(KEY.DOWN)) {
this.gotoAndPlay(4);
this._y += 8;
}
}


You put this script on the movie clip that holds your character animations. Then modify the above so it fits the animations of your character.

this._x and this._y are important lines to modify

as well as the gotoAndPlay("yourframe#)

If you want any more help please repost your fla. in MX format so I can see what you may be doing wrong.

bombsledder
February 16th, 2004, 06:01 PM
ok. thanks im trying to create a 3d game with the character to move each and every direction with different animations.

thanks

InsaneMonk
February 17th, 2004, 06:59 PM
TRIG! *cough*

bombsledder
February 17th, 2004, 08:50 PM
TRig???????

Fargate
February 17th, 2004, 08:58 PM
Trigonometry ;)...

Phantom_Lord
February 19th, 2004, 12:39 PM
hey Fargate i wanna ask you something about your message:

let's suppose i want to make a platform game (like mario bros or metal slug); for the walking character i have more or less a code that's similar to yours:


onClipEvent (enterFrame) {
if (Key.isdown(KEY.LEFT)) {
this.gotoAndPlay(2);
this._x -= 8;
}
}


the instruction "this.gotoAndPlay(2)" is repeated continuously while the left arrow key is down; in this way we don't give time to the animation (for example a character walking or jumping) to play (because it's like we have a stop on frame two). How can i solve this problem?

Fargate
February 19th, 2004, 08:31 PM
Use at least 3 frames for the walking sequence and put a stop(); on your stand still frame. This will make it seem less jerky and more fluent. I think this is what your problem is? Am I wrong?

Phantom_Lord
February 20th, 2004, 07:12 AM
I've found the answer i was lookin' for: a movie clip within a movie clip... Anyway, thanks for your help!