For a while now I have been interested in isometrics world. Creating isometric art, playing games like Sim City and Roller Coaster Tycoon. 3 Years ago I also used the Phaser Isometric Plugin to create a isometric game demo.
Sadly this plugin is not supported anymore since Phaser 2 became Phaser CE. There was a port for Phaser 3, but that has also not been updated for at least 2 years now.
I based the demo on the following tutorial for Phaser 2 and rewrote that for the newest version of Phaser. Scene management and depth sorting are now native to Phaser 3 and I used Webpack to support bundling and ES6.
There are still some things to consider though. Using the plugin 3 years ago I was able to create physics for game objects so the character could push boxes around and jump on top of them. In my demo this is not possible at all, there is only basic character movement and basic collision detection. I want to improve on this but I am not yet sure how…
What I really need is some Isophysics which supports not just the x- and y-axis but also a z-axis (height in isometric space). The demo I have now uses a 2d top view to convert 2d coordinates into iso coordinates, maybe I can create an additional 2d side view for the height. And I know Phaser now also supports isometric tilemaps, but I need to check how this works with collision and physics before I can implement that.
I like your approach using a 3d framework, but I am not sure how it will work for isometric view in phaser. Is this ammo shape rendered in the scene? Do we just use it to detect collisions invisibly? Is it overkill?
Do you have a demo where we can see how this works?
Demo.
H for Help, W for Wireframe which shows the collision shapes.
You use it the same way as a 2d physics engine. It’s just 3d, there’s no rendering.
These days I wouldn’t bother with 2D isometric, I think. Depth sorting is a real pain (basically impossible). In the olden days we had no choice…
Just use Three.js (like enable3d, with ammo integrated), use an orthographic projection, and then rotate the camera like so:
Hm, I just implemented 2d depth sorting for my phaser 3 demo. But it might become real hard when a third axis is introduced. I like the simple 2d game art though.
I definitely need to look into enable3d, seems like a much more simple way to create isometric projections. Might even be easier than learning Unity if you already know Phaser like me.
I think that stuff is fun when there is some simple game logic
And yeah I think it should even be possible to use 2d animated spritesheets in enable3d. (There is also a demo with a 2d rectangle moving around in 3d space synced with a 3d cube so why not, right?)
I wouldn’t advice it For masochists only.
It’s basically one big hack, just to make something work (lots of magic numbers). I created my own performance/debug version of Bullet/Ammo, and since I can’t find my Emscripten settings, you won’t be able to build the source.
I’m sure @yannick could whip something similar up quite quickly to get you started with enable3d (if that’s still a thing, I’ve been away from jsdev).