Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7900243
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T08:55:14+00:00 2026-06-03T08:55:14+00:00

I am making an isometric game and I only managed to create a zigzag

  • 0

I am making an isometric game and I only managed to create a zigzag isometric map. My original idea was diamond shape but I cant manage to do so.

Diamond:
coobird.net/img/tile-diamond-good-order.png

Zigzag:
coobird.net/img/tile-zigzag-compact.png

Here is a bit of my code to show you what is happening:

World:

  public void chunkGenerate() {
    moduleX = ((ListManager.getTileWidth()*8));
    moduleY = ((ListManager.getTileHeight()*8));
    for (int x = 0; x <= width; x++) {
        for (int y = 0; y <= height; y++) {
            if ((x%moduleX) == 0) {
                if ((y%moduleY) == 0) {
                    chunkList.add(new Chunk(x,y));
                }
            }
        }
    }
          }

Chunk:

 public void Generate() {
    for (int x = 0; x < 8; x++) {
        for (int y = 0;y< 8; y++) {
            tileList.add(new Tile(location.getX()+(x*ListManager.getTileWidth()),location.getY()+(y*ListManager.getTileHeight()),0));
        }
    } 
}

Rendering:

        for (Chunk c : w.getChunkList()) {
            g2d = (Graphics2D) g.create();
            for (int i = 0; i<c.getTileList().size(); i+=2) {
                g2d.drawImage(test2, (c.getTileList().get(i).getLocation().getX()+c.getTileList().get(i).getOffset().getxOffset()), (c.getTileList().get(i).getLocation().getY()+c.getTileList().get(i).getOffset().getyOffset()+w.getvOffset()), this);
                g2d.drawImage(test2, (c.getTileList().get(i).getLocation().getX()), (c.getTileList().get(i).getLocation().getY()+w.getvOffset()), this);
            }
            for (int i = 1;i<c.getTileList().size(); i+=2) {
                g2d.drawImage(test2, (c.getTileList().get(i).getLocation().getX()), (c.getTileList().get(i).getLocation().getY()+w.getvOffset()), this);
                g2d.drawImage(test2, (c.getTileList().get(i).getLocation().getX()+c.getTileList().get(i).getOffset().getxOffset()), (c.getTileList().get(i).getLocation().getY()+c.getTileList().get(i).getOffset().getyOffset()+w.getvOffset()), this);

            }
        }

I need help with making the map into a diamond, instead of zigzag. If you need further information on the code, comment below. Also one bug with this code is that there is like a 1 pixel wide space every couple of tiles. I don’t know why.. I tried adjusting the offsets, didn’t help..
Current offsets: (Tile constructor)

 offset = new IsometricOffset(21,11);

Closest I got to having no space was 20,10 but there was still a tiny space

here is a pic:

http://img845.imageshack.us/img845/6242/picbz.png

Thanks for the help!
edit:
Apparently two of the tiles on the screen are actually only 1 tile in the engine. I am working on fixing it.

EDIT:

Changed and got this:
img526.imageshack.us/img526/3121/test333.png

drawing:

        for (Chunk c : w.getChunkList()) {
            /*for (int i = 0; i<c.getTileList().size(); i++) {
                g2d.drawImage(test2, (c.getTileList().get(i).getLocation().getX()), (c.getTileList().get(i).getLocation().getY()+w.getvOffset()), this);
            }*/
            for (int i = 0;i<c.getTileList().size(); i++) {
                g2d.drawImage(test2, (c.getTileList().get(i).getLocation().getX()+c.getTileList().get(i).getOffset().getxOffset()), (c.getTileList().get(i).getLocation().getY()+c.getTileList().get(i).getOffset().getyOffset()+w.getvOffset()), this);

            }
        }

(I tried drawing without the offsets it drew the same thing as the picture)
Generating:

    for (int x = 0; x < 8; x++) {
        for (int y = 0;y< 8; y++) {
            tileList.add(new Tile(location.getX()+(x*ListManager.getTileWidth()/2),location.getY()+(y*ListManager.getTileHeight()/2),0));
        }
        location.setX(location.getX()+ListManager.getTileWidth()/2);
        location.setY(location.getY()+ListManager.getTileHeight()/2);
    } 

After experimenting:

Generate:

        public void Generate() {
    for (int x = 0; x < 8; ++x) {
        for (int y = 0;y< 8; ++y) {
            tileList.add(new Tile(location.getX()+(y*ListManager.getTileWidth()/2),location.getY()-(y*ListManager.getTileHeight()/2),0));
        }
        location.setX(location.getX()+ListManager.getTileHeight()/2);
        location.setY(location.getY()+ListManager.getTileWidth()/2);
    } 
}

result: This is the closest i got:
http://img814.imageshack.us/img814/3450/bombombom.png

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T08:55:16+00:00Added an answer on June 3, 2026 at 8:55 am

    Try to imagine your map rotated by 45 degree.

                  (0, 3)
           (0, 2)        (1, 2)
    (0, 1)        (1, 1)        (2, 2)
           (1, 0)        (2, 1)
                  (2, 0)
    

    And the rendering cycle must be like that:

    x = 0, y = 100,
    for (dx = 0; dx < 3; ++dx) {
        for (dy = 0; dy < 3; ++dy) {
            drawTile(x + dy * width / 2, y - dy * height / 2);
        }
        x += width / 2;
        y += height / 2;
    }
    

    UPD: Proof of working.

    Code (actionscript, but there is no difference for algorithm):

    var x:Number = 100, y:Number = 100, 
        dx:Number, dy:Number, px:Number, py:Number,
        halfWidth:Number = 40, halfHeight:Number = 20,
        s:Sprite = new Sprite(),
        g:Graphics = s.graphics;
    
    g.lineStyle(1, 0xffffff);
    for (dx = 0; dx < 3; ++dx) {
        for (dy = 0; dy < 3; ++dy) {
            px = x + dy * halfWidth;
            py = y - dy * halfHeight;
    
            g.moveTo(px - halfWidth , py);
            g.lineTo(px, py - halfHeight);
            g.lineTo(px + halfWidth, py);
            g.lineTo(px, py + halfHeight);
            g.lineTo(px - halfWidth, py);
        }
        x += halfWidth;
        y += halfHeight;
    }
    
    addChild(s);
    

    Result:

    good looking tiles

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm willing to make a isometric game but I'm having hard time with the
Making a game with OpenGL/GLUT and C++. I've heard the easiest way to manage
Im making a game in Java with a few other people but we are
Making a simple map app, plan on adding buttons to mark specific locations But
Making a ship game because I am incredibly original.. With that aside, I have
Although the context of this question is about making a 2d/3d game, the problem
Making a new shooter game here in the vein of Galaga (my fav shooter
I have an isometric map which I draw to the canvas. When I try
Making good progress on rails now, but hit a snag on heroku deployment. After
Making an uno game for a project. all 108 cards are located in a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.