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

Username:   Password: 
 RegisterRegister   
 Mouse-Click reaction parameters
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
skatelhs




PostPosted: Fri May 30, 2003 1:13 pm   Post subject: Mouse-Click reaction parameters

Hey, I want to make it so when i click on a certain area, not just on an x or y value, something happens. so far ivegot somethin along the lines of
code:

var x, y, button, targeta, targetb:int
loop
mousewhere (x, y, button) %gettin mouse location
drawfilloval (x, y, 2, 2, red) %drawing crude crosshair (ive got a better one just not here)
randint (targetx, 1, 100)
randint (targety, 1, 100)
(insert picture command- target.bmp at (x, y)  )
if button=1 and
x=   (i need somethin like a range here,  targetx + or - 10) and
y=  (same thing, i need a range, targety + or - 10) then
put "You hit the target"
end if

kinda confusing for me. If you can let me know how to do a range sort of thing that would be great.
adam
Sponsor
Sponsor
Sponsor
sponsor
Andy




PostPosted: Fri May 30, 2003 2:28 pm   Post subject: (No subject)

just have this
code:

if x< something and x> something+range and y< something and y>something+range then
end if
skatelhs




PostPosted: Sun Jun 01, 2003 1:36 pm   Post subject: (No subject)

yeah, i have that, and its on with randints in the x and y places, but its not working at all
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  [ 3 Posts ]
Jump to:   


Style:  
Search: