Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Isometric Map Coordinates #60

Open
shipstar opened this issue Oct 22, 2013 · 2 comments
Open

Isometric Map Coordinates #60

shipstar opened this issue Oct 22, 2013 · 2 comments

Comments

@shipstar
Copy link

I'm playing around with an isometric map I created with Tiled. As far as I can tell, Joybox (and maybe Cocos2D) doesn't handle the isometric angle when I make calls like contains_point? and coordinate_for_point.

isometric

In the map above, Joybox reports the very top-left corner of the screen (black space) as [0,0] in coordinate_for_point. The left corner of the actual map returns [0,4] or [0,5], depending on where you click. This makes sense, but it seems undesirable.

I would expect the left corner of the map (or some other sensible choice) to be [0,0], the bottom corner to be [0,9], the right corner to be [9,9], and so on. (I could also see the bottom corner being [9,0] -- as long as it's consistent, it seems fine.)

Staggered isometric maps would throw another wrench into these works. I'm not sure how I'd solve that yet, but I'm open to ideas.

Are there any plans to support this sort of coordinate system within Joybox? (Does Cocos2D support it?) I imagine that I'd need a lot of other methods on or coordinating with an IsometricTileMap for strategy-style games -- path-finding, for example -- so maybe it makes more sense as a separate gem if I get that far.

Thoughts?

Edit: To be clear, I have No Idea What I'm Doing™ when it comes to isometric games.

@JosephHalter
Copy link

We've recently used Joybox to make an isometric game and simply reverted to the methods provided by cocos2d such as .tileAt instead of which return a sprite from coordinate of the map (such as 0, 0) instead of from a position in pixel like Joybox provides. Sure, Joybox doesn't provide everything out of the box but it's nice to be able to load a tmx so easily. The remaining part you'll probably have to implement on top of it. Or you can also override coordinate_for_point but we found out that it only gets you so far.

@shipstar
Copy link
Author

I totally agree! Not hating on Joybox at all, just trying to provide some ideas of places where the API could be improved/supplemented.

Thanks for suggesting dropping down to Cocos2d — that’s probably the right move here.

On Thursday, November 21, 2013 at 1:27 PM, Joseph HALTER wrote:

We've recently used Joybox to make an isometric game and simply reverted to the methods provided by cocos2d such as .tileAt instead of which return a sprite from coordinate of the map (such as 0, 0) instead of from a position in pixel like Joybox provides. Sure, Joybox doesn't provide everything out of the box but it's nice to be able to load a tmx so easily. The remaining part you'll probably have to implement on top of it. Or you can also override coordinate_for_point but we found out that it only gets you so far.


Reply to this email directly or view it on GitHub (#60 (comment)).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants