Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / How do I use the mouse click on a sprite?

Author
Message
Hunter
20
Years of Service
User Offline
Joined: 10th Oct 2003
Location:
Posted: 7th Dec 2003 04:12
I'm making a game where you have to click on the object that pops up on screen as fast as you can but I don't know how to let the mouse pointer react to the object. I try clicking on it but my score does not add up or nothing happens at all! I know how to do all the stuff but this is my only problem. Help. This is the major of my game and I can't get it to work!!!
Mico
20
Years of Service
User Offline
Joined: 7th Dec 2003
Location:
Posted: 7th Dec 2003 20:20
how do u get the image to pop up???
the_winch
21
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 7th Dec 2003 20:22
You can make a very small sprite at position it at the mouse pointer and check for colision between the mouse sprite and other sprites.


Or because you can get the positions of the sprite, SPRITE X(), SPRITE Y(), SPRITE WIDTH() and SPRITE HEIGHT(). And you can get the postion and state of the mouse MOUSEX(), MOUSEY() and MOUSECLICK() you just need a bit of maths to work out if the mouse pointer is over the sprite.

dbpro : p166mmx @ 233 : 256mb : sb 128pci : sis onboard

Login to post a reply

Server time is: 2024-09-21 11:55:20
Your offset time is: 2024-09-21 11:55:20