Question on frames

Hello all,

So I have a question regarding frames. I am making a game which rains the alphabet and when your character hits the letter, it adds that letter to a printout on screen. My question is this,

if I have this as a a setting for a frame value, for example,

{

x=0,

y = 370,

width = 370,

height = 370

}

and this is equivalent to an image of the letter “A”, is it possible to assign that frame a value of “A” so I can call it in a later function to be set into the words text printout on screen? I have 26 frames from a png alphabet sheet. i call all of them on screen with math.random(1,26) and all 26 have body physics. If they hit my character they disappar or my character does depending on if it is the correct word or not. Can I assign this frame image a value?

Yes.  Just keep a table of tables.

local letterInfo = {} letterInfo['A'] = { x = 0, y =370, width = 370, height = 370 }
1 Like

Yes.  Just keep a table of tables.

local letterInfo = {} letterInfo['A'] = { x = 0, y =370, width = 370, height = 370 }
1 Like