Page 1 of 1

Mouse Questions

PostPosted: Tue Feb 03, 2009 1:16 am
by rudyj
I am working on my game and I have a couple of questions for the GE gurus out there.

Is there a way to show the mouse only on certain screens such as you menu and hide it during gameplay.

Also I converted my ship like space invaders to use the mouse for movement instead of the arrow keys. I went to convert the fire using the mousedown function but it only fires if I am clicking on the mouse. I know that is the way it is suppose to work but when I use the create actor function it does not give me the option to select the left mouse button.

Re: Mouse Questions

PostPosted: Tue Feb 03, 2009 2:06 am
by skydereign
I am not sure this is the best way, but... When in game mode, your ship follows the mouse. So if you have a mouse enter event, change the cursor to a transparent image. I'm not sure what you want for the mouse, but if I do understand, you can set the mouse button down event to flip a variable shooting to 1. Upon mouse up, it resets to 0. Then in the draw actor, you put an event that creates the actor. The 4 can be changed to the proper time for firing. It is the delay between shots, assuming that is what you want. I believe this is easy enough to understand.
Code: Select all
if (shooting>0)
{
   shooting++;
   if (shooting==4)
   {
      // create the projectile
      shooting=1;
   }
}


Make sure to add the mouse button up that sets shooting to 0.

Re: Mouse Questions

PostPosted: Tue Feb 03, 2009 11:52 am
by jimmynewguy
make the mouse (in game proporties(?)) show = no
then have an actor follow the mouse that looks like a mouse
but on create actor disable all events that involve the mouse mouse up, down, enter, and exit so it will be ignored
then with the shoot variable, change the transparency instead :)
i can make a demo if it makes more sense that way