Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

com

Drawing walls in SDL for a 2d tile engine?

This topic is 5769 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

How would i go about drawing some simple walls in SDl for my 2d based tile engine?

Share this post


Link to post
Share on other sites
Advertisement
If I understand correctly...

Do a regular tile engine, and for each tile mark wether you can pass through it or not. You can make "walls" (or anything else you want) impassable. Then you just have to use a texture for a wall. The only thing you have to be careful of is when coding the character movement across the map; make sure to check of the tile the character is moving to is passable. If not then do not move the character.

Share this post


Link to post
Share on other sites
SDL is a 2D API. You said Z-Axis...hence you want a 3D API, look into OpenGL. And there are tiles that can look like walls.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote:
Original post by com
But the problem is i need actual walls, not textures that look like walls.


Actuall walls only exist in the real world If you see a wall in a game it is a texture that looks like a wall...

So, see the above poster

Share this post


Link to post
Share on other sites
quote:
Original post by com
But the problem is i need actual walls, not textures that look like walls.
Drywall, concrete or padded?

Share this post


Link to post
Share on other sites

  • 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!