Computer Science Canada Mouse Question |
Author: | beedub [ Mon May 12, 2003 8:34 pm ] | ||
Post subject: | Mouse Question | ||
kkkk... here it is... i need some help with mouse action (when i press a certain image)..... here is the image that i need help with:
MOD EDIT: Title has been changed. Do not make general topics. -Asok |
Author: | beedub [ Mon May 12, 2003 8:36 pm ] |
Post subject: | |
also... sorry im not actually helping ne one... i need actually learn how to "ture"to be cable to help people... lol.. but when ever i make some n00bish games ill be sure to post it.. |
Author: | Dan [ Mon May 12, 2003 8:58 pm ] |
Post subject: | |
i am asuming you know the mouse codes... basickly you do closion dection but with the mouse's quartents and the loaction of the image. tutorial on colsion dection: http://www.compsci.ca/bbs/viewtopic.php?t=75 rember to look down for info on dection for difrent shaps and i think there is info on mouse closion dection. also for mouse codes go here: http://www.compsci.ca/bbs/viewtopic.php?t=6 |
Author: | beedub [ Mon May 12, 2003 9:19 pm ] |
Post subject: | |
i know this is kinda sad.. but.. i am so confused... ... looks like im not cut out for this sheit |
Author: | void [ Mon May 12, 2003 9:19 pm ] | ||
Post subject: | |||
jeeze dan...he clearly stated he was n00b...that means NEWbe....the NEW meaning he NEW to the language...ya...im just kidding man...i was bored as hell...and i came across this.. SUGGESTION: if your just doing a program that has nothing in the background but this button...like...if the color of the button is not like the color of anything else that you have on the screen on the moment...then use whatdotcolor..of the location...since your a n00b...im gonna post the syntax...dont just copy and be satisfied...im doing this coz personaly i learned best from examples when i started programming...so im assuming you might be like me...if you can learn how to use the code without copying...then ur better off because you can manipulate it in other programs u make...(as you can see...im am very against the copying of codes..but posting them helps you learn)
|
Author: | beedub [ Mon May 12, 2003 9:20 pm ] |
Post subject: | |
TY>>> |
Author: | Tony [ Mon May 12, 2003 9:22 pm ] |
Post subject: | |
yeah... dan often scares people with his replies... but he does pay the bills and edits some PHP so I think we should let him stay an admin for a little while longer |
Author: | beedub [ Mon May 12, 2003 9:25 pm ] |
Post subject: | |
i agree.. lol just trying to get bits... even tho i dont really know what they do... cept they give you a glow on ur name... hopefully ill get that soon...anyways srry...and ty dan for being a good admin... and payer of bills |
Author: | beedub [ Mon May 12, 2003 9:28 pm ] |
Post subject: | |
omg... i am so srry... for taking up this whole post.. but.. i need some help with the collision detection part of it... if i want the circle (posted earlier).. to be pressed any where on it.. how would i fit that into the code that void posted earlier... |
Author: | Tony [ Mon May 12, 2003 9:32 pm ] |
Post subject: | |
well void's code checks for the color of the circle, so technically you can click a same colored square anywhere else on the screen for it to work So your circle can be places anywhere on the screen. (Gotta be unique color though). If you want a mathimatical aproach, you chould check out circle collision detection ( in tutorials). You basically just see how far away you clicked from the center of the circle. |
Author: | beedub [ Mon May 12, 2003 9:38 pm ] |
Post subject: | |
thats what i have been trying to do... but i just cant seem to be able to... make it go to a differetn screen when it is pressed |
Author: | Tony [ Mon May 12, 2003 9:40 pm ] |
Post subject: | |
thats cuz void's code is wrong. Buttom color is 113 but he's checking for 114 In the if statment, the color must be the same as of your button |
Author: | beedub [ Mon May 12, 2003 9:41 pm ] |
Post subject: | |
omg thats it... i am such a stupid kid... there we go |
Author: | beedub [ Mon May 12, 2003 9:49 pm ] |
Post subject: | |
it works perfectly now.... |
Author: | Homer_simpson [ Mon May 12, 2003 9:57 pm ] | ||
Post subject: | |||
these 2 functions may help you...
|
Author: | void [ Tue May 13, 2003 10:30 am ] |
Post subject: | |
yea...i dont think a twelve year old understands how the equation for finding radius unsing x and y works....also...i dont they have even learned simple y=mx+b stuff....if you do know how to do that....thats great hello....and oh yea..im sorry for having 114 as the color ....eheheeehehe .....it should work fine now tho.....by the way...what kind of game are you making?....or what is the point of your program |
Author: | beedub [ Tue May 13, 2003 4:46 pm ] |
Post subject: | |
its ok... lo.l.. but ya i know most coding.. like x y rad and sheit like that... i also learned y+mx+b... but the thing i dont know all the function codes....and how to use em... and sometimes when you go to help on turing its not the exsact you wanted.. |
Author: | beedub [ Tue May 13, 2003 4:47 pm ] |
Post subject: | |
i might actuyally do a mouseover aswell.. i know how to do it... but i am doing so the user knows that it is picked.. |
Author: | void [ Tue May 13, 2003 6:07 pm ] |
Post subject: | |
yea... i never found tutorials that helpful either...i learn by examples....mouse over is really easy...make two pictures...and when you do that collision detection thing..go like this if the parameters (x,y,x2,y2) are right then replace the picture with this one if the mouse is clicked then cls end if end if you get? |
Author: | beedub [ Tue May 13, 2003 9:56 pm ] |
Post subject: | |
okee dokee.... ya i just take the examples and change coordinates and stuff.. |