Jump to content
  • Advertisement
Sign in to follow this  

About 2d scene

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

hello every body ,ths maybe a very basic question , but i don't know anything about that . please help me :How can i create a simple map (or scene ) for 2d game ???

Share this post

Link to post
Share on other sites
Well, what kind of game are you trying to make? :)

I guess most 2D games that ppl on gamedev.net make are probably tile-based... In this case, you can probably roll your own map editor, it's not too hard. Or google to see if someone else has written a good 2D map editor you can use.

Share this post

Link to post
Share on other sites
I'm feeling mellow (been at the ole' peach brandy) so I thought I'd expand on roos' response - as you did say you knew nothing about it.

A 2d map is often created using a set of identically-size tiles. For example, you could have a set of 4 tiles representing :

1 : Deep water
2 : Shallow water
3 : Beach
4 : Land

Then you'd need to have a map that was just a 2d array of tiles that you've used; for example, a simple watery-beach scene could be created using this map:

1 1 1 1 1
1 1 2 2 2
1 2 2 2 3
2 2 3 3 3
3 3 3 4 4

You get the idea. The map can now be saved and altered (either by hand, or by writing an editor, as previously suggested).

So - you have your tiles stored singularly in memory. You have a 2d array (of ints, for example) as your map. When rendering, you work out what tiles are visible, and then plot the associated sprites, based upon the map.

And that's about it!

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!