Archived

This topic is now archived and is closed to further replies.

Mouse problem killing me!

This topic is 6117 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Ok I have a mouse routine going(actually the one found in Jim Adams'' tutorial) but it''s not accurate. I''ve tried infinitely many different things tryng to make it accurate, but nothing helps. This is a big problem as the screen then will jump back and fourth when smooth scrolling as it''s used to locate the upper left cell. So I have disabled scrolling altogether until I get this fixed. But I have made it so that when you click somewhere on the screen the routune will place a grass tile in that map cell. This can be used just to see how unaccurate it really is . The source and binary can be downloaded here: http://www.angelfire.com/games3/robinei/ If you have solved this problem previously, please review my code and tell me what I''m doing wrong. I''ve looked through previous posts on this topic but couldn''t find an answer. The project file is for Dev-C++ and the engine is written in SDL, so you probably can''t compile to see if your modifications work, but please try to look at the code nontheless. I really need help on this one and I''m quite desperate, so please reply.

Share this post


Link to post
Share on other sites
Oh never mind, I''ve solved it by using a drawing procedure that just goes throygh every cell, checking if it''s visible, and if it is draw it at a screen coordinate given by a couple of equations.
Null if you''re reading this let me just say that it looks as if I ended up where you said after all Quad trees could be useful you know...

Share this post


Link to post
Share on other sites