PDA

View Full Version : [AS2] Puzzle game help


Hackor Pickel
09-11-2008, 08:07 PM
ok, as you can tell by my post count i am new to this site, i'll get straight to the point, i'm not a complete idiot to actionscript, i am making this "puzzle game" at the moment, with a character selection at the main screen, i have made a four-way character profiles to make the characters move, but i cannot seem to make any of the characters when selected move, the movement when only the original character is present "faces" the way he is moving, basicaly, i'm asking for an effective, not too hard way to make a, uhhh, character selection.
like thing thing arena would be awsome, but that's too hard right if anyone has figured that out. or just a simple "click this character, or this one"
sorry for the wall of text and the messy explanation...
i'll try to give as much info as needed
I'm using AS 2.0 if that helps...

raydowe
09-11-2008, 10:44 PM
Man, you need to slow down. That was definitely a wall of text with few periods. You'll have to explain your situation more clearly for me to understand the problem. You should post some problematic parts of your code, or even the entire fla.

The more effort you put into your posts, the more others will put into helping you.

Hackor Pickel
09-12-2008, 07:21 PM
umm, ok. so this is how i move my characters:

onClipEvent(enterframe){
if(Key.isDown(Key.DOWN)){
this._y +=3;
this.gotoAndStop("Char1down");
}
}
onClipEvent(enterframe){
if(Key.isDown(Key.LEFT)){
this._x -=3;
this.gotoAndStop("Char1left");
}
}
onClipEvent(enterframe){
if(Key.isDown(Key.UP)){
this._y -=3;
this.gotoAndStop("Char1up");
}
}
onClipEvent(enterframe){
if(Key.isDown(Key.DOWN)){
this._y +=3;
this.gotoAndStop("Char1down");
}
}
and on the Character movieclip i have four frames labeled "char1down", "char1up" ect.
this all works perfectly to move the character like this (http://www.swfcabin.com/open/1221239465)
but when i try to make a character selection, it does not move the character's "face" where it is going, it still moves, but onlys faces one way, which is right.

basically what i'm asking for is a better way to do a character selection,
the way i make it at the moment is this:

on (release) {
gotoAndStop(3);
character = 1;
}

that is the code for the button which you click to choose your character

onClipEvent (enterFrame) {
if (_root.character == 1) {
this.gotoAndStop(1);
} else if (_root.character == 2) {
this.gotoAndStop(43);
} else if (_root.character == 3) {
this.gotoAndStop(64);
} else if (_root.character == 4) {
this.gotoAndStop(22);
} else if (_root.character == 5) {
this.gotoAndStop(83);
}
}

that is the code i put onto the MC for the characters.
so if anyone could add to that, or something completely different, or help in any way, i'll be very grateful :/

KWarp
09-13-2008, 08:12 AM
That code is quite hideous. You could keep trying to work with it, but adding more functionality will get harder with every feature.

I recommend you put all your characters in separate movie clips for one. Then have the character selection decide which one to add to the game. I've forgotten how to do that in detail in AS2. Sorry.

Hackor Pickel
09-13-2008, 11:32 AM
ok thanks for the help anyway, i'll have a go doing that.