Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (710)
Games in Android Showcase (212)
games submitted by our members
Games in WIP (784)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Platformer Style with Depth  (Read 2163 times)
0 Members and 1 Guest are viewing this topic.
Offline Jimmt
« League of Dukes »

JGO Kernel

Medals: 167
Projects: 5
Exp: 6 years

« Posted 2013-02-24 01:11:39 »

So, I've been wondering whether to make my game true 2d, or 2d with depth like in the old TMNT arcade games. I would have outright picked 2d with depth, as it looks a lot better and expands gameplay, but I'm not too sure how I would perform collision with that (would the box2d shipped with libgdx work? I honestly don't know). I looked at this thread: but there was only 1 reply, "You'll need to decide whether you're doing 2D or 3D. That's more an art decision than a programming one"
There's probably other problems with 2d and depth that I haven't thought of, but any help is appreciated.
Offline davedes
« Reply #1 - Posted 2013-02-24 01:51:01 »

I would use a 3D collision system (eg. bounding boxes). The rendering would be fake... simply adjust a sprite's Y value and size based on the Z value of the entity's bounding box. Order your sprites by layer (background, middleground, foreground) and then by Z position / depth.

Also see this answer:

Offline relminator
« Reply #2 - Posted 2013-03-04 13:30:58 »

Why not go full 3d with 2d collisions?

You can just leave 3D out of the picture by setting your gameplay at z == 0 just like I did with this game (2d sprites are still in a 3D world, but collisions are in 2D):

Source is in the /source folder.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Mike

« JGO Spiffy Duke »

Medals: 149
Projects: 1
Exp: 6 years

Java guru wannabe

« Reply #3 - Posted 2013-03-04 13:57:17 »

Because in the old TMNT games and so on you can actually walk in the depth axis.

I'd do it with 3d collisions. but fake the rendering like davedes suggested.


My current game, Minecraft meets Farmville and goes online Smiley
State of Fortune | Discussion thread @ JGO
Offline Jimmt
« League of Dukes »

JGO Kernel

Medals: 167
Projects: 5
Exp: 6 years

« Reply #4 - Posted 2013-03-05 23:57:16 »

Sorry for the extremely late reply, but I've been pretty busy. How do you suggest I go by bounding boxes, just have a thickness/depth variable in each player/enemy class? Will this still work with a high-level library like libgdx's box2d?
Pages: [1]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.

numerical (85 views)
2017-02-21 07:32:16

numerical (86 views)
2017-02-21 07:31:46

theagentd (190 views)
2017-02-18 13:42:33

theagentd (194 views)
2017-02-18 13:35:16

h.pernpeintner (1356 views)
2017-01-24 22:39:11

h.pernpeintner (1344 views)
2017-01-24 22:38:32

Galdo (1905 views)
2017-01-12 13:44:09

Archive (1988 views)
2017-01-02 05:31:41

0AndrewShepherd0 (2524 views)
2016-12-16 03:58:39

0AndrewShepherd0 (2312 views)
2016-12-15 21:50:57
List of Learning Resources
by elect
2016-09-09 09:47:55

List of Learning Resources
by elect
2016-09-08 09:47:20

List of Learning Resources
by elect
2016-09-08 09:46:51

List of Learning Resources
by elect
2016-09-08 09:46:27

List of Learning Resources
by elect
2016-09-08 09:45:41

List of Learning Resources
by elect
2016-09-08 08:39:20

List of Learning Resources
by elect
2016-09-08 08:38:19

Rendering resources
by Roquen
2016-08-08 05:55:21 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!