Advertisement

Mouse problem killing me!

Started by March 15, 2001 08:32 AM
0 comments, last by robinei 23 years, 10 months ago
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.
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...

This topic is closed to new replies.

Advertisement