Mouse Questions

Game Editor comments and discussion.

Mouse Questions

Postby rudyj » Tue Feb 03, 2009 1:16 am

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.
rudyj
 
Posts: 17
Joined: Tue Jan 20, 2009 4:46 am
Score: 0 Give a positive score

Re: Mouse Questions

Postby skydereign » Tue Feb 03, 2009 2:06 am

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.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Mouse Questions

Postby jimmynewguy » Tue Feb 03, 2009 11:52 am

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
Working on a probably too ambitious project! Wild-west-adventure-RPG-shooter-thing.
User avatar
jimmynewguy
 
Posts: 1137
Joined: Sat Mar 31, 2007 6:27 pm
Score: 89 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron