Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (746)
Games in Android Showcase (226)
games submitted by our members
Games in WIP (828)
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  
  Physics with Box2D in a top-down game?  (Read 4018 times)
0 Members and 1 Guest are viewing this topic.
Offline Coldstream24

JGO Ninja


Medals: 81
Projects: 1
Exp: 4 years


You can fill that void inside with programming, but you'll never return a value.


« Posted 2014-05-17 05:14:02 »

Hey guys
I've been wondering lately about making a top-down game and one of the things I don't want to happen is for movement and things like that to be limited to just tiles (although the world can be). I would also like to know whether it's possible to have:
 - movable objects
 - car physics
 - worlds with depth (not just a flat surface).
I have seen resources on car physics in a top-down game with Box2D, but I'm stumped as to how I'd implement worlds with depth. If I had a body for each tile, and players and whatnot, they'd collide with any tile in the world, regardless of "z-order", wouldn't they? Would Box2D support only colliding with things above a certain z-order, or would I have to implement this myself?
Any resources/links/ideas would be great. Tell me if I need to explain anything in addition to what I've mentioned, but I think I've covered everything.
Thanks!

My website: http://www.onedropgames.com/
My soundcloud: http://www.soundcloud.com/coldstream24
Creator of the Morningside Engine, co-founder of Onedrop Games.
Offline Gibbo3771

JGO Kernel


Medals: 128
Projects: 5
Exp: 1 year


Currently inactive on forums :(


« Reply #1 - Posted 2014-05-17 06:16:37 »

Bo2D has collision filtering.

You can change collision filters on the go, so you can have the player change what layer he is on and what he can collide with.

Have a look at this Collision filtering

"This code works flawlessly first time and exactly how I wanted it"
Said no programmer ever
Offline Coldstream24

JGO Ninja


Medals: 81
Projects: 1
Exp: 4 years


You can fill that void inside with programming, but you'll never return a value.


« Reply #2 - Posted 2014-05-17 06:20:23 »

Wow, that helps a lot! I was looking on that site yesterday and I didn't even think to look at that page. Thank you.

My website: http://www.onedropgames.com/
My soundcloud: http://www.soundcloud.com/coldstream24
Creator of the Morningside Engine, co-founder of Onedrop Games.
Pages: [1]
  ignore  |  Print  
 
 

 
xxMrPHDxx (106 views)
2017-12-31 17:17:51

xxMrPHDxx (41 views)
2017-12-31 17:15:51

xxMrPHDxx (49 views)
2017-12-28 18:11:33

Ecumene (215 views)
2017-09-30 02:57:34

theagentd (324 views)
2017-09-26 18:23:31

cybrmynd (370 views)
2017-08-02 12:28:51

cybrmynd (406 views)
2017-08-02 12:19:43

cybrmynd (374 views)
2017-08-02 12:18:09

Sralse (345 views)
2017-07-25 17:13:48

Archive (1104 views)
2017-04-27 17:45:51
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05
java-gaming.org 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‑gaming.org
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!