Problem with the Mouse/Cursors

Started by rodriguez1222, Sat 17/09/2005 05:37:26

Previous topic - Next topic

rodriguez1222

Im working on a k-1 educational game.  What I'm attempting is a mini game wherein the user will be given a three or four letter word with a picture and a few of the letters missing.  Also presented on the screen is a line of letters for the user to choose from.

So far what Ive done is made it so when the user enters the mini game, all other pointers are unavailable except for the arrow pointer.  From there the user clicks on  a letter an that becomes his cursor.  He then clicks on the empty spaces to spell out the word.  When a word is complete it disappears and a new word and picture present themselves.

The problem is this:  Sometimes the pointer doesn't accept the letter the first time it is clicked but it grabs it the second time.
I'll try to explain.. sorta confusing...

On the screen I have the letters A, B, C, F, H.  The first word is: _AT with a picture of a hat.  The user clicks the letter H and it becomes the cursor, then he can click the blank spot to form the word HAT.  The word disapears and the next word: _AT appears with a baseball bat.  The user clicks the B and it becomes the cursor but when he tries to click the blank space he gets the message for an incorrect attempt.  However if he clicks the B again it brings back the correct response.

Any suggestions?  I know you gurus could probably look at this and tell me where I'm going wrong.

Other than this and my own silly mistake a few days ago when I was stuck on the animations, this engine is amazing.  Thanks a million for the opportunity to create with it.

Scorpiorus

Quote from: rodriguez1222 on Sat 17/09/2005 05:37:26The user clicks the B and it becomes the cursor but when he tries to click the blank space he gets the message for an incorrect attempt.Ã,  However if he clicks the B again it brings back the correct response.

Seems like a logical mistake, we need the actual script code to try helping further, can you post it here?

rodriguez1222

This is in the room script:

mouse.DisableMode (eModeInteract);
mouse.DisableMode (eModeLookat); 
mouse.DisableMode (eModePickup);   
mouse.DisableMode (eModeTalkto); 
mouse.DisableMode (eModeUseinv); 
mouse.DisableMode (eModeWait); 
mouse.DisableMode (eModeWalkto);   
mouse.EnableMode (eModePointer);
mouse.UseModeGraphic (eModePointer);

This is in the C object under the 'Any Click on Object' option

mouse.EnableMode (eModeLetterC);
mouse.UseModeGraphic (eModeLetterC);
mouse.Update ();

The word '_ AT' is set up:
if cursor mode is (12) ::which is the cursor mode of LetterC::
Display Message (0)
Remove Object (5) ::which is the word to reveal the words underneath::



Scorpiorus

Quote from: rodriguez1222 on Sat 17/09/2005 21:45:18
This is in the C object under the 'Any Click on Object' option

mouse.EnableMode (eModeLetterC);
mouse.UseModeGraphic (eModeLetterC);
mouse.Update ();

You see, mouse.EnableMode only makes modes available so that you can cycle through them on clicking the right mouse button but it doesn't actually change the *current* cursor mode -- mouse.Mode do that:

mouse.EnableMode (eModeLetterC);
mouse.Mode = eModeLetterC;
mouse.UseModeGraphic (eModeLetterC);
mouse.Update ();

You need to alter other scripts too and see if it helps.

rodriguez1222

Thanks!  Perfect!

I saw the mouse.Mode command in the manual, but I couldnt get it to work in the proper context, I thought I tried everything, guess I tried everything except the way you put it. 

Thanks bunches.

SMF spam blocked by CleanTalk