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

Username:   Password: 
 RegisterRegister   
 How Do u make Counters that adhere to Graphics?
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
icedesi




PostPosted: Wed Jan 07, 2004 7:03 pm   Post subject: How Do u make Counters that adhere to Graphics?

Ok, theres a simple program k? I've Set it so that it 'SHOULD' work that whenever the mouse is on the co-ordinates of the ball and is clicked, that it will create a counter at the top to display how many times it has been clicked. The Problem is, It wont work for some odd reason, i've even reviewed Hacker Dan's tutorial's on counters, but they didn't apply to Graphics, i was wondering if i could get help on this.

Quote:

setscreen ('offscreenonly')
setscreen ('graphics:vga')
var x,y,b:int
var counter:real
counter := 0
mousewhere (x,y,b)
drawoval (156,150,25,25,1)
loop
if buttonmoved ("down") and x-24 > 156 and x+24 < 156 and y-24 > 150 and y + 24 < 150 then
counter := counter +1
put counter
View.Update
end if
end loop



Help is much appreciated, Thank you.
Sponsor
Sponsor
Sponsor
sponsor
Dan




PostPosted: Wed Jan 07, 2004 10:21 pm   Post subject: (No subject)

wow, the problem is not with the couter it is with your:

closion dection is wrong

mousewhere (x, y, b) needs to be in the loop and not in the if

View.Update needs to be in the loop and not in the if

put couter needs to have a locate on top of it and not in the if

drawoval cant be in the if ether and has to be in the loop
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
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  [ 2 Posts ]
Jump to:   


Style:  
Search: