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

Username:   Password: 
 RegisterRegister   
 Any way to easily determine coordinates in the Run Window?
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Pearse




PostPosted: Thu Dec 09, 2010 6:16 pm   Post subject: Any way to easily determine coordinates in the Run Window?

For collision detection of static items/walls, im using logic like this:

if y>= 100 and x >= 25 and x<= 50 then
y := 100
end if

So basically if variable Y is found to be more then 100 and variable X is found in between 25 and 50, you cannot proceed any further then 50.

The only problem is, I can't really tell which numbers to use. Not using exact numbers will lead to further problems. I can only eyeball it, and while it works its slow and inefficient. Is there any way I can instantly get the coordinate of any point in the run window?

Also, the static items/walls are a part of a large picture taking up the entire window, so I cant just use the coordinate of wear I draw the items because they aren't separate.

thanks
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Thu Dec 09, 2010 6:54 pm   Post subject: RE:Any way to easily determine coordinates in the Run Window?

It helps if the same numbers (such as from a map file) are used to both render the level and used for collision. If you are drawing from one set of data and using a separate set of data for collisions, that can easily lead to problems.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
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: