Second mouse click

Game Editor comments and discussion.

Second mouse click

Postby Caaz Games » Fri Apr 06, 2007 8:40 pm

Does anyone know whats wrong with this code?
Mouse Button Down > Script Editor
Code: Select all
ChangeAnimation("Event Actor", "StartD", FORWARD);
AllReadyUp = 1;
if(AllReadyUp)
{
    ChangeAnimation("Event Actor", "StartU", FORWARD);
    AllReadyUp = 0;
}
I need it to change the animation when i click on it, and when i click on it again it will change back. but it doesn't work, no error messege shows up but the second mouse click doesn't work. What am i doing wrong?
You are welcome to join my forum. 4 active members lol but it's a cool place. active... much talking :D it's fun!
http://caaz.freeforums.org/
User avatar
Caaz Games
 
Posts: 729
Joined: Wed Feb 14, 2007 9:09 am
Location: California....knows how to party!
Score: 25 Give a positive score

Re: Second mouse click

Postby Sgt. Sparky » Fri Apr 06, 2007 8:54 pm

__CAAZ__ wrote:Does anyone know whats wrong with this code?
Mouse Button Down > Script Editor
Code: Select all
ChangeAnimation("Event Actor", "StartD", FORWARD);
AllReadyUp = 1;
if(AllReadyUp)
{
    ChangeAnimation("Event Actor", "StartU", FORWARD);
    AllReadyUp = 0;
}
I need it to change the animation when i click on it, and when i click on it again it will change back. but it doesn't work, no error messege shows up but the second mouse click doesn't work. What am i doing wrong?

make it this
Code: Select all
if(AllReadyUp == 1)
{
    ChangeAnimation("Event Actor", "StartU", FORWARD);
    AllReadyUp = 0;
{
ChangeAnimation("Event Actor", "StartD", FORWARD);
AllReadyUp = 1;

:D
hope that helps,
you had it if AllReadyUP,
you did not define what you wanted it to be. :)
Last edited by Sgt. Sparky on Sat Apr 07, 2007 1:06 am, edited 1 time in total.
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

Re: Second mouse click

Postby makslane » Fri Apr 06, 2007 9:04 pm

Code: Select all
if(AllReadyUp)
{
    //Second click
    ChangeAnimation("Event Actor", "StartU", FORWARD);
    AllReadyUp = 0;
}
else
{
   //First click
   ChangeAnimation("Event Actor", "StartD", FORWARD);
   AllReadyUp = 1;
}
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby Sgt. Sparky » Fri Apr 06, 2007 9:50 pm

you could just put the if it is 0 on the bottom and if it is 1 on the top(see my code) :D
Last edited by Sgt. Sparky on Sat Apr 07, 2007 1:08 am, edited 1 time in total.
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

Postby Kodo » Fri Apr 06, 2007 11:04 pm

Caaz, you had..
Code: Select all
AllReadyUp = 1;
if(AllReadyUp == 1)
{

So AllReadyUp is always 1 when you test it, which makes the IF statement completely redundant!!
Inogames: http://www.inogames.com iOS gaming
Firetop Adventure (app store): http://itunes.apple.com/us/app/firetop- ... ?mt=8&ls=1
User avatar
Kodo
 
Posts: 449
Joined: Thu Oct 20, 2005 8:20 pm
Location: UK
Score: 23 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron