Jump to content

Tips on isometric games with PixiJS


pxzin
 Share

Recommended Posts

Hi people, 

I'm about to start a personal project and I'm thinking to go with pixijs. Is about a city builder isometric-game. I would like to know if anyone have any tips, suggestions or can point me directions of the problems I may find ahead.

Several years ago, I did a lil project with PixiJS for my graduation and I remember have a good time with it. But couple years before I had a real pain trying to come up with a isometric game in Construct 2, so I'm quite afraid of follow up with this genre.  

Any advice will help, since I'm starting blank.
Thank you all.

Link to comment
Share on other sites

Hello!

There's one small isometry demo:

https://pixijs.io/examples/#/plugin-projection/iso-basic.js

However that's not how I usually do isometry. Usually I just use Y scaled by 0.5. You even don't need those "x+z" "x-z" coordinates, if you want to make tiles - take whole two-dimensional array and remove "odd" cells. Like, use only "black" cells of chess board. Then the only problem is to detect which tile is under mouse, but then it will be the only place where you have a isometry math. Everything else is just "x=x'; y = y' / 2"

I have many things to tell about isometry: how to sort elements, how to make walls on tiles and intersect/sort them too, but I want to sleep. Try to do something, then I'll give you more info.

and Welcome to the forums!

Edited by ivan.popelyshev
Link to comment
Share on other sites

5 minutes ago, ivan.popelyshev said:

I have many things to tell about isometry: how to sort elements, how to make walls on tiles and intersect/sort them too, but I want to sleep. Try to do something, then I'll give you more info.

I'll sure like to talk about that in the future!! 

Ok, so I'll start to try it and came back when I get something to show. 

Thank you very much.

Link to comment
Share on other sites

  • 6 months later...

Hello fellow indie devs,

I am knee-deep in a new game and would love any and all resources you have on doing isometric rendering with pixi. There is precious little content out there on the web on this topic!

I am currently doing it as in that example - which confuses me, since most pre-created game sprites and artwork is already rendered isometrically! (Is this even the right way to say it?)

My understanding is that the example game is just a 2d game with the camera perspective changed - scaling the Y so that it renders from a different angle. How would I use something like these assets in such a layout? https://jpcu.itch.io/isometric-kitchen-sprites

My prototype uses the example as a template, but I render the character sprites with the equal and opposite scaling to make it look like they are not rendered isometrically (since...they're not). Attached is a screenshot of what I am talking about. Hopefully I am being clear. It really seems to me like there is probably a better way, I just cannot for the life of me find anything on the web on this topic.

Thank you in advance for any help you're able to provide.

Screenshot 2020-08-05 15.35.28.png

Edited by dpaola2
more detail
Link to comment
Share on other sites

well, there's diagonal "texture.rotate" options but its experimental, no one use it :) https://pixijs.io/examples/#/textures/texture-rotate.js

Honestly, in your case its better to make everything manually. Isometry to world is just "y_screen = y_world * 2" , simple equation, just move sprites accordingly and it'll be fine.

Link to comment
Share on other sites

For anyone else looking on the topic, I found this resource to be really useful: http://clintbellanger.net/articles/isometric_math/

I had to be careful and not use the dimensions of the sprite file itself but the actual dimensions of the tile I wanted to use within that file (which in my case was slightly smaller).

Thanks for your response, I might have more questions in the near-term future :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...