Jump to content
  • Advertisement
Sign in to follow this  
Aqua Costa

Help with 2d game

This topic is 3250 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Ive made a little 2D game using Directx 9 The game contains 2 layers: background sprite and terrain sprite , and the player sprite Full Game: http://img249.imageshack.us/i/gamea.png/ Background Sprite: http://img217.imageshack.us/i/backgroundo.png/ Terrain Sprite: http://img109.imageshack.us/i/terrain.png/ Player Sprite: http://img513.imageshack.us/i/playerk.png/ My question is how can I know playerY based on the terrainY in playerX position Like when player clicks right button, player sprite moves x = x+1 and y = terrain.getY(player.x) Can someone tell me how can I do that?

Share this post


Link to post
Share on other sites
Advertisement
in the case of this specific sprite , i belive a height map will help you.
what you should do is to write a tool that goes throught each colum of the terrain sprite and checks it's height(based on the color values), then write all the heights into a text file and use in your game.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!