[Solved] Can someone help me figure this out?


#1

On the first game development island (level 14) it won’t spawn what I’ve typed in for code.

Here is my program so far.

// Skeletons are afraid of lightstones.

var player = game.spawnHeroXY("champion", 15, 35);
player.attackDamage = 60;
player.maxSpeed = 8;

game.addSurviveGoal();
game.addDefeatGoal();

// Spawn a "generator"
game.spawnXY("generator",21,20)
generator.spawnDelay=5
generator.spawnType="skeleton"
generator.maxHealth=100
// Spawn a "lightstone"
game.spawnXY("lightstone",65,52)
// Now beat your game!

(As you can see, the specifics for a hero to spawn was already put in place. I set for the generator to be spawned, but that didn’t even appear either. I feel like I’m overlooking something…)


#2

Can you preformat your code according to the FAQ? :slightly_smiling_face:


#3

I THINK so. Is this good? I didn’t realize the grey box around the code was so important. lol


#4

FYI in JavaScript always add a semicolon at the end for every code.


#5

I wanted it formatted for lua :grinning:


#6

Then instead of var use local


#7

It still says that it is incorrect. :frowning:


#8

Can you take a screenshot of the error?


#9


#10

Ohh! You are now doing python! To change go to game menu and change your programming language to Lua!


#11

Oh! Haha. Had a blonde moment. Thanks!