Hello Everyone, So, I have been looking into using slick2D and phys2D to build on a game idea I have. I have looked through the demo code and phys2D looks very easy to use and understand for a standard platformer style game. However, I want to build a semi-isometric brawler style game ... think Double Dragon, Final Fight, or Castle Crashers. What I am wondering is, can phys2D be used easily in a game like this? Allow me to elaborate:
My thought for the generic level layout was to have an area along, lets say, the bottom half of the screen. This area is the ground basically. The player can freely walk up or down in this area: (please pardon the crappy ascii art) ____________________________ \ \ \ x \ \____________________________\
The thing I am having trouble wrapping my head around is how I can use phys2D to handle the physics for, lets say, a character jumping. I understand applying a force in the y direction and gravity pulling the "body" back down, but I assume that in order to know when to stop falling, there needs to be a body to collide with in the "world". Referencing the "art" above, it seems to me as if I really need a "body" box for the character, and a bounding "line" for the lowest y coordinate of the character.
Without having written a scrap of code yet, I am just trying to think all of this through to see if I can pull off this style of game using phys2d. My thought was, unlike a platformer style game where non-passable tiles have a "body" shape that the character's "body" shape can collide with, I would need to have my character's "body" shape colliding with another box that followed him around and was always "under" him. This way, if he jumped forward, the "floor" body shape would simply change position to follow him around, giving him a physical "body" to collide with and land on. Later on I can add tiles that simulate varying heights that you can jump up onto, but baby steps first.
This approach seems reasonable to my, probably naive, mind since it would be somewhat similar to something like a moving platform in a platform game. This is just an invisible platform that follows the character around. I welcome any thoughts or advice! Perhaps there is a much simpler way to handle a game like this using phys2d and I just lack the knowledge to see it.
Thank you!
|