Course2 lesson18

Choose the right code to assign function onSpawn to one soldier in the game with event type “spawn”
Soldier.on(“spawn”,onSpawn)
Game.setActionFor(“soldier”,”spawn”, onSpawn)
Soldier.on(onSpawn, “spawn”)
Game.setActionFor(soldier,”spawn”, onSpawn)
What does the code setActionFor do?
Set a code to a munchkin to attack
Set a function to a character to attack
Set a function to one character
Set a function to a specific type of character
What does the code unit=event.target do here?
Targets the character that going to be spawned to the game
Targets the enemy that the hero needs to attack
Targets the character that the function onSpawn is going to be assigned to
In this code which character is going to say “attaaaack”?
Soldiers
Archers and soldiers
Archers
Choose the right examples of game data?
Time of the game
The hero’s health
Number of enemies defeated
All of the above
Choose the right code to track and display the time of the game
Ui.track(“time”,game)
Ui.track(game, time)
Ui.track(game, “time”)
Ui.track(time,game)
Choose the right code to generate a random number between 15 and 70 and store it to the variable x
X = game.randomInteger(15, 70)
X = game.RandomInteger(15, 70)
X = game.randominteger(15, 70)
X = Game.RandomInteger(15, 70)
What’s an event handler?
A code to handle an event.
A function that can be assigned to a character in the game
A code that makes an event occurs
{"name":"Course2 lesson18", "url":"https://www.quiz-maker.com/QPREVIEW","txt":"Choose the right code to assign function onSpawn to one soldier in the game with event type “spawn”, What does the code setActionFor do?, What does the code unit=event.target do here?","img":"https://www.quiz-maker.com/3012/CDN/87-4206397/dgsdffdgfd-4x-100.jpg?sz=1200"}
Powered by: Quiz Maker