Okay so I’m on Tablua Rasa on the first game development path here is my code so far
# Create your own game!
game.spawnMaze("forest", 4)
# Player Character
player = game.spawnPlayerXY("samurai", 10, 60)
player.maxHealth = 250
player.maxSpeed = 7
player.attackDamage = 10
# Goal to beat the game
game.addDefeatGoal(16)
game.addCollectGoal(20)
# UI Tracking
ui.track(player, "health")
ui.track(game, "defeated")
ui.track(game, "collected")
# Gems
gem1 = game.spawnXY("gem", 30, 60)
gem1.value = 1
gem2 = game.spawnXY("gem", 44, 60)
gem2.value = 1
gem3 = game.spawnXY("gem", 60, 60)
gem3.value = 1
gem4 = game.spawnXY("gem", 12, 43)
gem4.value = 1
gem5 = game.spawnXY("gem", 12, 14)
gem5.value = 1
gem6 = game.spawnXY("gem", 28, 29)
gem6.value = 1
gem7 = game.spawnXY("gem", 45, 12)
gem7.value = 1
chest = game.spawnXY("chest", 60, 12)
chest.value = 150
# Munchkin Generators
mygen1 = game.spawnXY("generator", 27.5, 44)
mygen1.spawnType = "munchkin"
mygen1.spawnAI = "AttacksNearest"
mygen1.maxHealth = 65
mygen2 = game.spawnXY("generator", 28.5, 12)
mygen2.spawnType = "munchkin"
mygen2.spawnAI = "AttacksNearest"
mygen2.maxHealth = 65
mygen3 = game.spawnXY("generator", 52, 27)
mygen3.spawnType = "munchkin"
mygen3.spawnAI = "AttacksNearest"
mygen3.maxHealth = 65
# Extra forest blocks
game.spawnXY("forest", 52, 60)
game.spawnXY("forest", 20, 28)
I am having trouble with it tracking the gems collected and ive went back in to the previous levels and cant figure it out I’m stuck please help