We are new to Code Combat and trying to understand coding. I (mom) need help to show my son (age 14) how to get past this level he is on. He has some beginning knowledge of code and I have little to none so it is tough getting through this. I hate that we bought this and even after contacting Code Combat and getting some hints in a reply from the CEO, we still can’t get past this. Honestly, it all give me a headache, but I am determined to press through and not get too frustrated!
He is on Game Development- part 16 called Time to Live. The code he tried and then edited with hints from the CEO are… (what is the best way to copy and paste the code here for people to see it?- I think it would help if the line numbers were there, but I don’t know how to copy and paste that)
Pass an argument to addSurviveGoal() to specify a time.
This means the player must survive for 20 seconds.
Spawn a generator with spawnXY
Remember to assign the spawned generator to a variable!
Use the variable to configure the generator below.
Set the generator’s spawnType to “munchkin”
mySpawn = game.spawnXY(“generator”, 36, 30)
Use spawnHeroXY to spawn a hero for the player.
Remember to assign the spawned hero to a variable!
hero = game.spawnHeroXY(55, 16)
Set the hero’s maxHealth to 100
Set the to 10