Wednesday, April 25, 2012

How to use matrix to make an 8bits game map

      My friend, who is learning programming now asked me how to use C++ to create a video game; well a video game need videos(just kidding), I don't know about how to make a huge game like StarCraft, or Call of Duty or Halo, but I can make a 8bits video game by some idea from my mind.
     8bits games are most from old computers or SFC, those video games are very basic programs, and  the very important point in those games is MAP.
    How to make a 8bits map is a very important part of the video games, you can make a Lunatic map, or a very basic map, but the whole game mainly effected by the map; to make a map, what we should use is Matrix, such as:
int Map[20][560]
But how is that possible to make a map for a video game?
we can see this ex. :
int Map [][5]
{{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
  {0,5,5,0,0,0,0,0,0,1,0,0,2,2,0,0,0,0,3,3,0,3,3,0,0,0,0,0},
  {0,0,0,0,0,0,0,0,1,1,0,0,2,2,0,0,0,0,3,6,3,0,0,18,0,0,0,0},
  {0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,0},
  {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}}
See, this looks kinda like a map, as the result, we can use pics to change those number, we can use lots of 8*8 pics to cover those numbers up, and than a 8 bits map done.

No comments:

Post a Comment