Play Home Contribute Github Join Us! Discourse Staff Members Github Contribution Guides Team

[SOLVED] How do you make lightning in game dev 2?

how do you make lightning in game dev 2?

What do you mean by lightning?

like in rotten forest

I can do the grow spell but not any others. can you help with that to?

Where can you cast only grow? On rotten forest or in the game dev 2 level?

I mean in game design 2

You can only make units grow because the units in game dev levels only can attack, move and speak, they can not cast any spells. You can make units bigger by changeing their scale propety, not by casting grow.
As for the lightning, you can not do that in game dev levels as far as I am aware of.

but I can use the spell! the shaman can cast it with unit.cast(“grow”, unit)

game.spawnMaze(“forest”, 1)
game.spawnXY(“forest”, 12, 20)
player = game.spawnPlayerXY(“skeleton”, 36, 30)
player.say(“Level 1: A DEADLY ENEMY”)

def yesSir(event):
unit = event.target
unit.say(“Yes sir!”)
if unit.type != “shaman”:
unit.behavior = “AttacksNearest”
else:
friends = unit.findFriends()
for friend in friends:
if unit.canCast(“grow”):
unit.cast(“grow”, friend)

def spawnRandomEnemy(x, y):
random = game.randomInteger(1, 4)
if random == 1:
enemy = game.spawnXY(“munchkin”, x, y)
return enemy
if random == 2:
enemy = game.spawnXY(“scout”, x, y)
return enemy
if random == 3:
enemy = game.spawnXY(“thrower”, x, y)
return enemy
if random == 4:
enemy = game.spawnXY(“shaman”, x, y)
return enemy

spawn1 = {‘x’: 18, ‘y’: 12}
spawn2 = {‘x’: 22, ‘y’: 12}
spawn3 = {‘x’: 26, ‘y’: 12}

def spawnRandomEnemies(bossSpawnType, bossVerdict, minionAnswer, pos1, pos2, pos3):
boss = game.spawnXY(bossSpawnType, 12, 12)
boss.scale = 1.5
boss.say(bossVerdict)
boss.behavior = “Defends”
enemy = spawnRandomEnemy(pos1.x, pos1.y)
game.setActionFor(enemy, “hear”, minionAnswer)
enemy2 = spawnRandomEnemy(pos2.x, pos2.y)
game.setActionFor(enemy2, “hear”, minionAnswer)
enemy3 = spawnRandomEnemy(pos3.x, pos3.y)
game.setActionFor(enemy3, “hear”, minionAnswer)
return boss

boss = spawnRandomEnemies(“ogre”, “Defend the base from undead!”, yesSir, spawn1, spawn2, spawn3)

Oh, maybe you can use only the unit’s coming spells and abilities ( like Pender’s mana blast or Senic’s heal).

I think so because I can use senicks heal

Well, I did not know that. Good to know.

Does this answer your question about the shaman casting grow?

thx (20 characters long)

1 Like

You’re welcome! :slightly_smiling_face: