• Advertisement

Archived

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

Scrolling in isometric engines

This topic is 6212 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

Hi , I am working on an isometric engine with tile size of 64x32. For displaying I''m using the following procedure (simplified) where screenx,screeny are the fine map coordinates.
  var x,y,plotx,ploty:integer;
  begin
    x0:=screenx mod 64;
    y0:=screeny mod 32;
    for y:=-1 to 32 do
      begin
        for x:=-1 to 11 do
          begin
            PlotX:=X*64+(Y AND 1)*(32)-X0;
            PlotY:=Y*16-Y0;
            map[screenx div 64 + x , screeny div 32 + y].draw(plotx,ploty);
          end;
      end;
  end;

The problem is that I cannot scroll the map on the Y coordinate. The movement is done by simply incrementing or decrementing screenY. In this case the map "jumps" very weird when the first row to display if even. I guess it''s because of the displaying procedure but I can''t find a way to fix it. If someone could help me I would be very greatfull. Thanks. [Edited by - pasman on March 7, 2006 10:44:56 AM]

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
I''m not sure what the C++ operator is (I know QBasic and VB, but am just beginning to learn C++) but in BASIC it is Int(). Try wrapping your divisions in Int() or whatever its C++ equivalent is. I was having the same problem in my VB DX7 tile engine, and though the logic was a little different, changing Cint(roudning - what you''re doing) to Int(w/o rounding) fixed it.

Try that.

Share this post


Link to post
Share on other sites

  • Advertisement