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 8820851
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:42:38+00:00 2026-06-14T05:42:38+00:00

We’re working on a Javascript game that is developed and defined based on 2D

  • 0

We’re working on a Javascript game that is developed and defined based on 2D board coordinates.

We are trying to convert the X,Y coordinates that we currently have (ie, 0,0) into the corresponding ISO coordinates for use with crafty.js.

The reason we are doing this is because the server randomly generates a game board that is a traditional 15×15 grid of spaces, and we would like to render it in isometric 3D, but crafty JS uses a strange coordinate system that starts in the upper left of the screen.

How would we map a 2D grid to the following image, with the upper left board space mapping to either (0,6) or any of the ? annotations?

enter image description here

  • 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-14T05:42:39+00:00Added an answer on June 14, 2026 at 5:42 am

    I’m working in crafty as well, attempting to make a 17×17 board. Currently I’m simply using a map to covert every location to it’s corresponding Crafty location. I realize it’s incredibly hacky, probably slow, but I honestly don’t have time.

    I noticed above that the numbers are a bit off in the image above. Here’s a little better visualization of how Crafty works in this situation. The white numbers are the raw data I get from the server, and the black numbers are what Crafty needs to render this board:
    Crafty Layout

    I’ve basically worked it out to a somewhat useful equation (but only useful when creating the map):

    Even rows (starting at 0)
    - y (row) = starting at row number (base 0) then increment by 1 for each x (column)
    - x (col) = previous odds's first x, then follow pattern: +0, +0, +1, +1, +2, +2...
    Odd rows (starting at 0)
    - y (row) = starting at row number (base 0) then increment by 1 for each x (column)
    - x (col) = +1 to previous even's first x, then follow pattern: +0, +1, +1, +2, +2, +3...
    

    So I have a map below that seems to work (this is the rawToCrafty map):

    //Row 0
    "00.00": { "y": 0, "x": 8 }
    "01.00": { "y": 1, "x": 8 }
    "02.00": { "y": 2, "x": 9 }
    "03.00": { "y": 3, "x": 9 }
    "04.00": { "y": 4, "x": 10 }
    "05.00": { "y": 5, "x": 10 }
    "06.00": { "y": 6, "x": 11 }
    "07.00": { "y": 7, "x": 11 }
    "08.00": { "y": 8, "x": 12 }
    ...
    

    Yes there are better ways, but this is the brute force way. Good luck!

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

Sidebar

Related Questions

I have a small JavaScript validation script that validates inputs based on Regex. I
I have a French site that I want to parse, but am running into
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I am currently running into a problem where an element is coming back from
I'm trying to create an if statement in PHP that prevents a single post

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.