Sign in to follow this  
vicer1234

Sprite Engine & Physics Engine

Recommended Posts

Hi,
I already made a sprite engine through which I have structured a Tile based level. Now I want to integrate a physics engine into it

At present to draw a character it follows :
1) Get the position of the tile like x=1 y= 2
2) Pass this (x,y) to draw() and the sprite is
displayed

Now if I want to use a physics engine, then in order to draw a character
the steps I believe should be:
1) Get the position of the tile like x=1 y= 2 ( as previously)
2) Initiate a physics body with the tile position ie (x=1, y=2)
3) Apply sprite to physics body

Is the above steps correct????????

Also when I have a layers of tile eg: like tile bricks at various height to which the character can jump...then for all those tiles do i need to
1) Initiate a physics body for each

What should be the structure of -- Class PhysicsManager --- that can take care of all the entities that needs physics action...

All suggestions are welcome :)

Share this post


Link to post
Share on other sites
At a very high level, you're on the right track, I think. To be honest, I'd rather not give any specific advice without a better description of your game. Are you working on a platformer/arcade type 2D game (Mario type game) and you want physics to move your character and enable interaction with things in your level? It sounds like this is what you're doing...I kind of want to have a better description of what you want the gameplay to really be like. Depending on the types of interactions you want, physics might or might not even be recommended.

Share this post


Link to post
Share on other sites
Quote:
Original post by grhodes_at_work
At a very high level, you're on the right track, I think. To be honest, I'd rather not give any specific advice without a better description of your game. Are you working on a platformer/arcade type 2D game (Mario type game) and you want physics to move your character and enable interaction with things in your level? It sounds like this is what you're doing...I kind of want to have a better description of what you want the gameplay to really be like. Depending on the types of interactions you want, physics might or might not even be recommended.


Yes, I am working on 2d platformer with tiles. I want the character to collide with collectables, some creatures and drag some boxes etc.

Also I want to know is when I have a layers of tile eg: like tile bricks at various height to which the character can jump...then for all those tiles do i need to
1) Initiate a physics body for each.

How to manage a physicsManager and Actor class?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this