Jump to content

Arrays And Or While Loops


unknown gamer

Recommended Posts

Alright, what I have is a 10x3 table that has numbers from 1-30 as the td values. Lets call that a level card. So in this game as the user completes levels a database will get updated with the number of levels created. Say a user has completed 15 levels, the database will say 15 and I want the first 15 tds on the level card to have a different background colour. I've thought about using a while loop but I was unsure on how to go about that, same with an array. So can someone maybe help me get started with this?-Thanks in advance

Link to comment
Share on other sites

I assume you're using a loop to print the 30 tds, so all you need is a counter to keep track of the max level they've completed, and an if statement inside the loop to check the counter and see which color to use as the background.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...