06-26-2013 11:58 AM
hey,
I'm tring to create a basketball game, and I don't know how I can make two diffrent events with event_left_click_up on the same callback function.
to furthue explain,
I want to click on the canvas and then a power bar will start running
second click on the same canvas will stop it and the ball will start moving.
thank u all in advance
barak
06-26-2013 01:32 PM
One possible solution could be to use a variable that is toggled between 0 and 1:
switch ( event )
{ case EVENT_LEFT_CLICK_UP:
if ( !toggle )
{
// start running
}
else
{
// stop running
}
toggle = !toggle;
break;
}