Re: Handling building blocks in games?

The way I'm currently making my maps (for an entirely different type of game) is to define 'block' types in a dictionary, then reference the dictionary using an array. For example:

 key = {0 : 'air', 1 : 'brick', 2 : 'glass'}

map = [[0, 0, 0, 0], [0, 1, 1, 0], [0, 2, 2, 0], [1 1 1 1]]

So, map[0, 0] == 0. If I write

key[map[0][0]]

the output will be 'air'.

I hope this is at least somewhat useful, but I'm not entirely sure I understand the issue at hand.

_______________________________________________
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : craigdavid11111 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Dino via Audiogames-reflector

Reply via email to