I'm learning libgdx. I want to create a 2D FPS game using libgdx, which is not basically a physical science. In that case it will be very bump (for example, bullets killing multiple objects) I have to check the intersecting of each rectangular rectangle with other sprites. Thus, there can be thousands of ghosts, checking each of the other 999 sprites with each passing time is definitely not a good idea.
- In Libgdx is scene2d, which is the finder AP, does it solve my problem? Or
- Should I Use Box 2D Collision Recognition? Or
- Is there any other way that can detect a collision in libgdx?
-
Scene2D
s hits Detection is used for input or touch or maudent. Then used to detect it, if someone isactor
is touched, then clicked ... -
box 2d
There is a 2D physical engine that can not only detect conflicts for you, but it can also do the simulation of physics simultaneously (gravity and similar things) along with collision reaction. - Libgdx provides the
intector
class, which you can use for>overlap
tests for collision detection organization / management on you is dependent.
I want to create a 2D FPS game
< / Blockquote>As much as I know that FPS means "first-person-shooter" -> First shooter with the first person perspective That means, that's 3D.
So much happiness explains what you sayNow for the question of collision detection:
It would be better if you tell us how your game should work, how your world should be managed etc. For example, if your world is a Tilebug, then wall and Detection of collision between the player can be a simple test, if the tile is captured -> collision, if not -> no collision.
It is also important to know the size of your objects, detection of a rectangle-rectangular collision is different than a rectangular-cycle collision identity.
There are 3 solutions for your problem now:
- Use theBox2D
and read the tutorial on how to use it
- Detect collision, read the tutorial and some sample Do some research on taking a look at the projects - let us know more about games, its objects, their shapes, etc.
Comments
Post a Comment