News : The level of daily SPAM has reached insane proportions, all registrations are now manual. I ask you to send me an e-mail (john (at) murga (dot) org), to confirm that you want me to create an account for you.


Post Reply  Post Thread 
Tile based game engine for murgaLua
Author Message
mikshaw
Senior Member
****


Posts: 522
Group: Registered
Joined: Apr 2007
Status: Offline
Reputation: 5
Post: #1
RE: Tile based game engine for murgaLua

Odd thing...
I made a table with a single "map={...}" declaration, and it seems to work, but not as I expected.
Having each table entry enclosed in curly brackets apparently makes each entry a table within the map table. I don't know if this is what you wanted, but I had never thought about the possibilities of this type of setup.

Code:
map={
    {'#','#','#','#','#','#','#','#','#','D','#','#','#','#','#','#','#','#','# ','#' },
    {'#','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_ ','#' },
    {'#','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_ ','#' },
    {'#','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_ ','#' },
    {'#','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_ ','#' },
    {'#','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_ ','#' },
    {'#','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_ ','#' },
    {'#','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_ ','#' },
    {'#','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_ ','#' },
    {'#','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_ ','# '},
    {'#','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_ ','# '},
    {'#','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_ ','# '},
    {'#','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_ ','# '},
    {'#','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_ ','# '},
    {'#','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_ ','# '},
    {'#','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_ ','# '},
    {'#','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_ ','# '},
    {'#','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_ ','# '},
    {'#','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_ ','# '},
    {'#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','# ','# '}
}
fourth_table=map[4]
print(fourth_table[2]) -- a floor tile

This post was last modified: 08-22-2007 06:38 AM by mikshaw.

08-22-2007 06:36 AM
Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

Messages In This Thread
RE: Tile based game engine for murgaLua - mikshaw - 08-22-2007 06:36 AM

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump: