mirror image

Game Editor comments and discussion.

mirror image

Postby jagheera nex » Sat Sep 08, 2007 9:00 pm

im making a simpole stickman type game and right now i have two main actors, one to go one way and one to go the other way, i did it that way cuz if i do only one actor there would be 2 atacking animations and i don't know how to make the game reconize when the actor is facing one way or another. i think if i can flip the actor horizontily left or right it would solve the problem but i don't know how to program that, someone plz help.
User avatar
jagheera nex
 
Posts: 46
Joined: Sat Jul 28, 2007 4:13 pm
Location: dik
Score: 1 Give a positive score

Re: mirror image

Postby Troodon » Sun Sep 09, 2007 5:50 pm

Game editor can't yet rotate and flip animations but this can be simulated with some ways.
You can for example create a variable which could be -1 when actor looks left and 1 when he looks right. Then just check this and use the needed animation. :)
I can't die, I already tried
~on the forums since GE 1.3.3~
User avatar
Troodon
 
Posts: 1539
Joined: Thu Jan 12, 2006 3:29 pm
Location: HELL
Score: 56 Give a positive score

Re: mirror image

Postby jagheera nex » Sun Sep 09, 2007 6:21 pm

oh i get it so i make a varible 4 each way he is looking and when he looks that way i,... do what exactly, im feel so newbish
User avatar
jagheera nex
 
Posts: 46
Joined: Sat Jul 28, 2007 4:13 pm
Location: dik
Score: 1 Give a positive score

Re: mirror image

Postby jagheera nex » Tue Sep 11, 2007 3:25 am

if you can, can you plz answer in a code pleese :D im not good at reading
User avatar
jagheera nex
 
Posts: 46
Joined: Sat Jul 28, 2007 4:13 pm
Location: dik
Score: 1 Give a positive score

Re: mirror image

Postby Troodon » Tue Sep 11, 2007 6:13 pm

Sorry for not being specific. I was writing in a hurry. (I'm also now writing in a hurry) :lol:
However, you can make like this:
Go to 'attack key down' -> script editor
then create a variable called compass
Then add this code
Code: Select all
if (compass == -1)
{
ChangeAnimation("Event Actor", "attacktoleftanimation", FORWARD);
}
if (compass == 1)
{
ChangeAnimation("Event Actor", "attacktorightanimation", FORWARD);
}

Then add this in the key down of the key when you walk right:
Code: Select all
compass = 1;

and in the key down event of the key when you walk left:
Code: Select all
compass = -1;

And still a small thing, in the create actor of your character:
Code: Select all
compass = 1; //if the actor is looking to right in the beginning


I hope this helps.
NOTE: This is how to do it with left and right! If your game has for example 4 directions, just use 4 compass values. I used -1 and +1 just because it's easy to remember which one is left and which one right. :)
I can't die, I already tried
~on the forums since GE 1.3.3~
User avatar
Troodon
 
Posts: 1539
Joined: Thu Jan 12, 2006 3:29 pm
Location: HELL
Score: 56 Give a positive score

Re: mirror image

Postby jagheera nex » Tue Sep 11, 2007 11:35 pm

thanks so much man works like a charm, lol :D
User avatar
jagheera nex
 
Posts: 46
Joined: Sat Jul 28, 2007 4:13 pm
Location: dik
Score: 1 Give a positive score

Re: mirror image

Postby Troodon » Wed Sep 12, 2007 4:42 am

No problem! :D
I can't die, I already tried
~on the forums since GE 1.3.3~
User avatar
Troodon
 
Posts: 1539
Joined: Thu Jan 12, 2006 3:29 pm
Location: HELL
Score: 56 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron