I can't figure out what I did wrong (Tabula Rasa)

var player = game.spawnPlayerXY('captain', 39, 34);
player.maxHealth = 500;
player.attackDamage = 50;
game.addSurviveGoal(60);
game.addDefeatGoal(2);
game.spawnXY("forest", 36, 30);
game.spawnXY("forest", 40, 30);
game.spawnXY("forest", 44, 38);
game.spawnXY("forest", 45, 30);
game.spawnXY("forest", 44, 46);
game.spawnXY("forest", 28, 30);
game.spawnXY("forest", 28, 39);
game.spawnXY("forest", 44, 54);
game.spawnXY("forest", 36, 53);
game.spawnXY("forest", 27, 54);
game.spawnXY("forest", 26, 60);
game.spawnXY("forest", 18, 54);
game.spawnXY("forest", 19, 30);
game.spawnXY("forest", 19, 39);
game.spawnXY("forest", 19, 22);
game.spawnXY("forest", 19, 14);
game.spawnXY("forest", 27, 13);
game.spawnXY("forest", 54, 30);
game.spawnXY("forest", 62, 30);
game.addMoveGoalXY(73, 58);
var generator = game.spawnXY("generator", 10, 12);
generator.spawnType = "ogre";
generator.spawnDelay = 10;
game.spawnXY("fire-trap", 71, 24);
game.spawnXY("potion-large", 27, 22);
game.spawnXY("gem", 71, 9);
game.spawnXY("gem", 53, 47);
var boss = game.spawnXY("ogre", 64, 53);
boss.maxHealth = 1500;
var enemy = player.findNearestEnemy;
var distance = player.distanceTo(boss);
var fs1 = game.spawnXY("fire-spewer", 44, 61);
fs1.direction="vertical";
var bosshelper = game.spawnXY("soldier", 73, 8);
game.addCollectGoal(2);
game.spawnXY("soldier", 9, 58);
player.maxSpeed = 20;
boss.maxSpeed = 2;
ui.track(player, "health");
ui.setText("levelName","Dylan's Level");
ui.setText("directions", "Welcome to my level! You have to defeat that boss on the other side of that forest, dodge the fireballs! There are helpers scattered around to help you. Your health as you can see is 500, the bosses has 1500 health! Good Luck!");
boss.behavior = "FearsTheLight";
game.spawnXY("lightstone", 71, 38);
boss.attackDamage=25;

When I try to play it right now it’s glitching, can you help. Also I am looking for some interesting unique code that’ll work. Javascript

2 Likes

How is it glitching?

2 Likes

Hi, @Dylan_Runnels , welcome to the forum!! :partying_face: :partying_face:
This is a place you could get help, have fun
Can you give a screen shot?

1 Like

Or could you just try and simply what your problem is. It is kind of confusing right now.

1 Like

Is this a valid state?
Maybe its fearsTheLight?
I dont know.

3 Likes

behaviors are with capital (I think, I haven’t done any codecombat levels in like 4 months), and yes, it is a valid state, but that could be the problem

1 Like

Yes that is a valid state, I did figure it out

1 Like

I fixed it, non of the enemies would attack me

I did fix it, thank you!

I did fix it, the enemies refused to attack me

Okay! Glad you were able to fix it. Sorry that I wasn’t able to help out much. Due to IRL stuff that was going on. If you ever need more help feel free to ping me and I’ll do my best to help you out.

1 Like

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.