Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Dkcrame
D
Dkcrame
Community Contributor
Quizzes Created: 1 | Total Attempts: 228
| Attempts: 228 | Questions: 10
Please wait...
Question 1 / 10
0 %
0/100
Score 0/100
1. Here's a code fragment of a For loop. The For loop increments the variable called i. When the For loop ends what is the final value of i? Here's the code fragment: var i:int = 0; for(i = 0; i < 361; i++){      print("What's the final value of i?"); }

Explanation

The final value of i is 360 because the for loop increments i by 1 each time it runs, starting from 0. The loop continues as long as i is less than 361. Since 360 is the last value of i that satisfies this condition, it is the final value of i when the loop ends.

Submit
Please wait...
About This Quiz
Programming Trivia Quiz Questions! - Quiz

Dive into the Programming Trivia Quiz Questions to challenge your knowledge on JavaScript game development. This quiz assesses your understanding of function roles in game scripts, loop logic, and object instantiation, enhancing your coding skills in a practical context.

Personalize your quiz and earn a certificate with your name on it!
2. In the file bullet.js there is a function there that causes the bullet to detect if it collides with something. When that function does trigger, where would the bullet be positioned? Phrase it like this "120 in z".

Explanation

The bullet would be positioned at 1000 in the x-axis when the collision detection function triggers.

Submit
3. In the file Main.js, there is  an unused function that you can delete. What's the name of the function?

Explanation

Functions do something. This one has a name but it doesn't actually DO anything. What's the EXACT name of the function, omit the word "function" and the parentheses.

Submit
4. In question number 6, I asked about an unused function. In Invader.js, which function is unused?

Explanation

not-available-via-ai

Submit
5. Answer this: var x:int = 25; var y:int = 48; if(x + y < 74){      print("That's right."); }else{     print("That's wrong."); }

Explanation

Type in the EXACT print out. That's without the print statement, the parentheses, and the double quotes... The exact phrase, capitalisation and punctuation.

Submit
6. In the file Main.js, there is a function that creates a new Invader. What is the name of the function?

Explanation

The correct answer is "Instantiate". In the file Main.js, there is a function that creates a new Invader, and the name of that function is "Instantiate".

Submit
7. There is  a function in ship.js that runs when the ship object comes into being. That function runs which line?

Explanation

The correct answer is bullet.transform.position.x = 1000; because the question states that there is a function in ship.js that runs when the ship object comes into being. Since the function is not specified in the question, we can assume that it is not relevant to determining the correct line. Therefore, we can focus on the lines provided and choose the one that sets the x position of the bullet transform to 1000.

Submit
8. In Invader.js there is a function there called OnTriggerEnter. It accepts a collision object which I have assigned to a variable called col. I can get the name of the collision object by calling this: col.gameObject.name So I'm looking for three collision objects in a series of if statements which are those names?

Explanation

The correct answer is "leftBarrier", "rightBarrier", and "bullet". These are the names of the collision objects that the code is looking for in the series of if statements. The OnTriggerEnter function accepts a collision object named "col", and by calling "col.gameObject.name", we can retrieve the name of the collision object. The code is checking if the name of the collision object matches any of the three specified names: "leftBarrier", "rightBarrier", and "bullet".

Submit
9. In the file bullet.js, I have two variables with two different variable types. Which of the following below is not one of them?

Explanation

There's more than one answer...

Submit
10. In the Invaders.js file there are a total of four functions. Which function moves each invader a step down when it gets to the boundary of the game area?

Explanation

The correct answer is "moveInvadersDown()". This function is likely the correct answer because it follows the standard naming convention for functions in JavaScript, which is camel case. The function name starts with a lowercase letter and each subsequent word is capitalized. Additionally, the function name accurately describes what it does, which is moving the invaders down when they reach the boundary of the game area.

Submit
View My Results

Quiz Review Timeline (Updated): Oct 23, 2024 +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Oct 23, 2024
    Quiz Edited by
    ProProfs Editorial Team
  • Dec 19, 2013
    Quiz Created by
    Dkcrame
Cancel
  • All
    All (10)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
Here's a code fragment of a For loop. The For loop increments the...
In the file bullet.js there is a function there that causes the bullet...
In the file Main.js, there is  an unused function that you can...
In question number 6, I asked about an unused function. In Invader.js,...
Answer this: ...
In the file Main.js, there is a function that creates a new Invader....
There is  a function in ship.js that runs when the ship object...
In Invader.js there is a function there called OnTriggerEnter. It...
In the file bullet.js, I have two variables with two different...
In the Invaders.js file there are a total of four functions. Which...
Alert!

Advertisement