I am trying to make a 2D side scrolling action game similar to “Dan The Man”. However, I am stuck as to how to manage the level physics.
Initially I though to create the ground terrain as an image for each level and use that. However, I soon realized that this would be hard because I won’t be able to get the “actual” ground height at certain columns. Instead, it would return me the entire image’s height.
Next, I tried to store the entire map in a 2D array. While this worked for me and allowed for easy collision checking, the animation was not smooth as the player moved in discrete tile steps.
If I make the player move via the pixel coordinates, while the animation was much smoother, I was no longer able to store the player in the tile map as the player could be in two tiles at once making it harder to detect collisions.
I wish to hear your opinions as to how would you approach such a predicament. I would also appreciate it if anyone could link some similar examples for me to look and learn from on my own .
Thank You in advance.