Is it possible to specify a table by number and count the rows/columns?
I have created a 3D maze game (tables are amazing and I can't wait for writeable tables) and I am checking the maze boundaries by counting the rows and columns of the maze layout table for each level. It works great for level 1, but now I am ready to increment game.currentlevelnumber to 2 and I want to count the rows and columns from a different table (e.g. "Level2Maze"). Is there a way to automate this? Here's how I've set things up:
game.playerX is the column value within the maze (so if I started at column 1 and moved "east" one step, I am now at playerX=2).
In a maze with 6 columns, I want the player to not move past the 5th column, as the 6th column is the external wall of the maze.
When attribute playerX = tableColCount(game.Level1Maze)-1 --> do not allow the player to move that direction
So what I really want to be able to do is:
When attribute playerX = tableColCount(table:game.currentlevelnumber)-1 --> do not allow the player to move that direction
game.playerX is the column value within the maze (so if I started at column 1 and moved "east" one step, I am now at playerX=2).
In a maze with 6 columns, I want the player to not move past the 5th column, as the 6th column is the external wall of the maze.
When attribute playerX = tableColCount(game.Level1Maze)-1 --> do not allow the player to move that direction
So what I really want to be able to do is:
When attribute playerX = tableColCount(table:game.currentlevelnumber)-1 --> do not allow the player to move that direction
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Comments
however i have yet to try it but i think my way would be whenever a new level needs loading changed table name to the next level's table name by using a game text attribute. Will try it out myself too later :P
http://www.deepblueapps.com/Deep_Blue_Ideas_Ltd./GSTemplateFR_TBC.html
In case you're wondering, I am just a happy customer, sharing a valuable tool.
Sam
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User