Clicking Help
Author |
Message |
Preet
|
Posted: Mon Nov 26, 2007 3:08 pm Post subject: Clicking Help |
|
|
Listen guys im working on a game for school and im trying to mak a click button so that it exits when i click. This is whan I have so far but its not working can someone help me please. I also want the other buttons to work.
Thanks!
var click, x, y : int
drawbox (340, 340, 380, 320, black)
locatexy (350, 330)
put "Play"
drawbox (340, 240, 445, 260, black)
locatexy (350, 250)
put "Instructions"
drawbox (340, 180, 380, 160, black)
locatexy (350, 170)
put "Exit"
loop
exit when click = 1 and 340 <= x and x <= 380 and 180 <= y and y <= 160
end loop |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Nick
|
Posted: Mon Nov 26, 2007 3:13 pm Post subject: RE:Clicking Help |
|
|
i recently made my own button
other than that check to make sure the x and ys are correct or look up turing's GUI |
|
|
|
|
|
HeavenAgain
|
Posted: Mon Nov 26, 2007 4:24 pm Post subject: RE:Clicking Help |
|
|
whats the point of the loop at the end? mouse isnt updated, and if you are going to do graphic, dont use put, look up draw font , or font draw... |
|
|
|
|
|
Preet
|
Posted: Tue Nov 27, 2007 9:34 am Post subject: Re: Clicking Help |
|
|
can someone please correct this and repost it.
Thanks!!!! |
|
|
|
|
|
Preet
|
Posted: Tue Nov 27, 2007 9:46 am Post subject: Re: Clicking Help |
|
|
Forget it guys I got it. I just forgot the mousewhere comand.
Thanks Anyways!!! LOL!!! |
|
|
|
|
|
Jestar
|
Posted: Tue Nov 27, 2007 9:54 am Post subject: Re: Clicking Help |
|
|
ok so all i made it stop when you click exit...you can fix it up..its pretty messy.
code: | var click, x, y : int
var button : int
click := 0
procedure clicking
drawbox (340, 340, 380, 320, black)
locatexy (350, 330)
put "Play"
drawbox (340, 240, 445, 260, black)
locatexy (350, 250)
put "Instructions"
drawbox (340, 180, 380, 160, black)
locatexy (350, 170)
put "Exit"
loop
mousewhere (x, y, button)
locate (1, 1)
exit when button = 1 and x >= 340 and x <= 375 and y >= 160 and y <= 180
end loop
end clicking
clicking
put "You clicked EXIT"
|
|
|
|
|
|
|
Preet
|
Posted: Tue Nov 27, 2007 10:39 am Post subject: Re: Clicking Help |
|
|
Thanks Man!!! |
|
|
|
|
|
Jestar
|
Posted: Tue Nov 27, 2007 10:51 am Post subject: Re: Clicking Help |
|
|
No problem. i set it so when it exits it says you clicked the exit button..so you can change it to whatever you want it to do. |
|
|
|
|
|
Sponsor Sponsor
|
|
|
|
|