I’m trying to understand better the tables and the “if” – “then”
but all the codes I see they are too advanced for me.
I see a lot of this:---------------------------------
if self.j>1 then
if (gemsTable[self.i][self.j-1]).isMarkedToDestroy == false then
if (gemsTable[self.i][self.j-1]).gemType == self.gemType then
markToDestroy( gemsTable[self.i][self.j-1] )
end
end
end
or this -------------------------------
for i = 1, 8, 1 do
for j = 1, 8, 1 do
if gemsTable[i][j].isMarkedToDestroy then
isGemTouchEnabled = false
transition.to( gemsTable[i][j], { time=300, alpha=0.2, xScale=2, yScale = 2, onComplete=enableGemTouch } )
– update score
score = score + 10
scoreText.text = string.format( “SCORE: %6.0f”, score )
scoreText:setReferencePoint(display.TopLeftReferencePoint)
scoreText.x = 60
end
end
end
But I don’t get it. All I see is a complete game code, and it’s already too much.
Is there any where I can study this “if” and “tables” but in an extremely beginners way?
like the simplest possible way, just 1 image 1 table 1 if
Please let me know where can I study this.
Victor
