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 / Clicking and Dragging

Author
Message
Zeus
18
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 8th Aug 2006 16:14
You guys I am so sorry for asking so many questions. But now we need help on clicking and dragging an image. We have three images we want the player to able to click and drag and fill up the grid spaces they wanted to fill. Here's the catch, we also want those 3 images to be sorted out @ random. Anyone who can help at both questions is greatly appreciated.

Thanks!

Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 8th Aug 2006 21:37
Just check if it's being clicked on, and if it is, position at at mousex() and mousey()

Mickm
18
Years of Service
User Offline
Joined: 22nd Apr 2006
Location: Kingston, ON
Posted: 8th Aug 2006 22:46
Heres something i cooked up quickly (only tested a little).



Online Flash Games and Guides .::. http://www.gamestack.org
Online Notebook .::. http://onlinenotes.gamestack.org
Zeus
18
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 9th Aug 2006 01:53
Okay I made to where if the mouse is there it pastes it, but I need it to do it when the mouse is clicked. Do I just use the same process as
clickable images but add

mousex()=mousex()
mousey()=mousey()?

Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 9th Aug 2006 02:02
I don't follow, but it's pointless to do:

mousex()=mousex()
mousey()=mousey()

Basically just so:

if mousex()>posx
if mousey()>posy
if mousex()<posx+sizex
if mousey()<posy+sizey
if mouseclick()
paste image 1,mousex(),mousey()
endif
endif
endif
endif
endif

ofcourse it would be better if you put all these together with the 'and' command.

Zeus
18
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 9th Aug 2006 03:57
Okay. I doesn't paste the image.

Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 9th Aug 2006 04:14
Well use sprite then, w/e...

Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 9th Aug 2006 04:33
You aren't supposed to run that code alone, you are supposed to make it fit with your program...

Zeus
18
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 9th Aug 2006 04:45
Okay! Finally Got it!!

Login to post a reply

Server time is: 2024-09-25 05:23:29
Your offset time is: 2024-09-25 05:23:29