Jump to content

How to Make a 2D Game


Recommended Posts

I know it may be counter-intuitive but one of my thoughts is to use Leadwerks for a 2D game. I'm thinking either a platformer or a game like

. The question is, how do you implement a 2D game in Leadwerks?


My first thought was to create two massive planes, one on each side of the characters, which prevents them from moving in the Z plane. That, combined with resetting all rotations to face the correct way each frame should solve most problems. But what if some characters are wider than others? Do I put down multiple planes? This seems a bit awkward.


The second thought was that maybe Newtown's already thought of this. I didn't see this in the Bodies wiki but perhaps there's a way to set it to ignore Z movement. Or, is there a way to detect Z movement and apply a negative force to counter it?


Any thoughts and suggestions are appreciated. This is also my first post on the forums so hello all!


Oh, finally: how do you access the two locked tutorials on the wiki? I sent Josh an email a few days ago but I guess he's busy.



Link to comment
Share on other sites

Modern 2D games have always a little 3D effect in them too, look for example how Little Big Planet was made.

It's basically a 2D platformer, but you can sometimes move 1 meter in Z-direction too, for example when climbing a stairway up.

That can be done in Leadwerks without any special tricks, you just make your level 2 meter deep.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

Thank you. From macklebee's post, it looks like I'll need to investigate 2d joints, as I'm very likely not a good enough programmer to modify the newton code. Lumooja, believe it or not, I've thought of Little Big Planet before this but that just seems a step more difficult, as in something to implement after one figures out how to do single-plane 2D with a 3D engine.


In addition to all this, I've used the wonderful pmask collision library before. It's strictly 2D but I can see the possibility of not using Newton and implementing it instead. It would be some extra work, somehow analyzing the 3D world and creating a 2D collision array from it, but it could be done.

Link to comment
Share on other sites

This question was asked in the old forum here.

I limited the movement to 2D with the code posted there which works fine.

For the rotation I found no similar way, so please let me know if you solve it.

To limit the rotation I'm using two big boxes between which my ship moves. I had to adjust the body damping, so that

the boxes don't decelerate the ship to much.

But what if some characters are wider than others? Do I put down multiple planes? This seems a bit awkward.

Yes :)

All my ships will have the same z-size to avoid this trouble. Especially in Multiplayer

using multiple planes/boxes.


Julio (the newton maker) wrote that he is working on something to limit movement to 2D.

But I don't know how far he is.

Btw: Which newton version is LE 2.3 using?

Core2DuoE6570 / Windows7 64bit / 4 Gb RAM / Geforce GTX 260 896Mb / LE 2.3

Dell Inspiron 1720 / Vista SP2 / C2D 2.4 / 8600 GM

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.

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.


  • Create New...