Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Level Pack read from Table — Gideros Forum

Level Pack read from Table

GiderosFanGiderosFan Member
edited June 2015 in General questions
I tried out to read my row, cols, and time from a value table (ar2rsawseen) give me this tip :)

My Value Table look like this
local values = {}
 
				-- Level Pack 1
				values[1] = {rows=1, cols=1, time=60}
 
                              -- Level Pack 2
				values[1] = {rows=2, cols=2, time=60}
so i need this values for starting my level.
gotoScene("level", SceneManager.moveFromRight, values[sets:get("curLevel")])
so my problem is i have more level packs.

my Pack.lua looks like this.
packs = {
	{
		name = "First pack",
		levels = 10
	},
	{
		name = "Second pack",
		levels = 10
	},
 
etc...
my question is how can i set the values for every level if i start yet i get the same values from Level pack 1 (level1) not from level pack 2 (level 1).

i thought about
values[1],[1] = {rows=1, cols=1, time=60}
but this is not allowed.

Maybe anyone understand my problem ?!

Comments

  • i think the best way i can solved it is over json or?
  • piepie Member
    Accepted Answer
    I am not sure I understood your need :), but this is allowed
    values[1][1] = {rows=1, cols=1, time=60}
    values[1][2] = {rows=1, cols=1, time=60}
     
    values[2][1] = {rows=1, cols=1, time=60}
    values[2][2] = {rows=1, cols=1, time=60}
    You could write in json those tables instead of coding them in lua. it would be easier to add more levels.

    Likes: GiderosFan

    +1 -1 (+1 / -0 )Share on Facebook
  • Thank you Pie for your help :) yes values[1][1] was what i searched thanks :) yes i think I rewrite it in json it gives me more flexibility.
Sign In or Register to comment.