Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Clicking Help
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Preet




PostPosted: 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
Sponsor
sponsor
Nick




PostPosted: 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




PostPosted: 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




PostPosted: Tue Nov 27, 2007 9:34 am   Post subject: Re: Clicking Help

can someone please correct this and repost it.



Thanks!!!!
Preet




PostPosted: 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




PostPosted: 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




PostPosted: Tue Nov 27, 2007 10:39 am   Post subject: Re: Clicking Help

Thanks Man!!!
Jestar




PostPosted: 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
Sponsor
sponsor
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 8 Posts ]
Jump to:   


Style:  
Search: