Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Lesson 04 Number Wizard UI

Total questions: 30

Worksheet time: 8hrs 30mins

Name
Class
Date
1.

When using Random.Range(min, max) where min is an integer of 1 and max is an integer of 5, what are are the possible values we can return?

a)

1, 2, 3, 4

b)

0, 1, 2, 3, 4

c)

0, 1, 2, 3, 4, 5

d)

1, 2, 3, 4, 5

2.

When creating standalone PC/Mac builds it's always good manners to provide players with an easily accessible way to quit the game.

a)

True

b)

False

3.

Using "Application.Quit() pretty much does nothing when used in the editor.

a)

True

b)

False

4.

Application.Quit() always needs to be connected to a button and this is done using a public method.

a)

True

b)

False

5.

The following function call will return random values in what range?int result = Random.Range(0, 7);

a)

1, 2, 3, 4, 5, 6

b)

0, 1, 2, 3, 4, 5, 6

c)

1, 2, 3, 4, 5, 6, 7

d)

1 or 7 only

6.

When using Random.Range() with integers, min is inclusive and max is exclusive.

a)

True

b)

False

7.

When displaying our guess to the player, why do we need to use ToString() and not just display our integer as it is?

a)

To avoid the issue where our number has too many decimal places to display within our text box.

b)

Because we are presenting both words and numbers in our guess box and need a way to combine those values.

c)

We are using a text field so we can make our guess font look pretty, and our text field requires data as a string.

d)

So that we can confuse the player, keep them guessing.

8.

What would the following code output to the Console window?

a)

The values 0, 1, 2 in that order

b)

The values 0, 1, 2, 3 in that order

c)

The values 1, 2, 3 in that order

d)

The values 1, 2 in that order

9.

What would the following code output to the Console window?

a)

The values 4, 3, 2, 1, 0 in that order

b)

The values 3, 2, 1, 0 in that order

c)

The values 4, 3, 2, 1 in that order

d)

The values 0, 1, 2, 3, 4 in that order

10.

Why do we use [SerializeField] in front of our variables when declaring them?

a)

To make our variables global so that they can be used by any script

b)

Because it is often quicker / easier to make changes to our variables in the inspector than in our code.

c)

To declare that our variables are private to a specific class.

d)

Because it ensures that the variable is attached as a component to the relevant parent game object.

11.

What is one advantage of marking a class member variable as "[Serializefield]" in a Unity project?

a)

The variable will be hidden from all other classes

b)

The variable can be modified only by your script's code

c)

Initial values can be set directly from the Unity IDE

d)

The variable can hold more than one value

12.

What keyword do you add to a variable declaration so it will be visible outside the class and managed in the Unity Script component Inspector?

a)

Serializefield

b)

visible

c)

global

d)

private

13.

Which of the following class variables can be freely read and modified by code outside the object?

a)

private float cost;

b)

[Seiarlizefield] int score;

c)

protected string message;

d)

visible bool gameOver;

14.

Debug this code. We are trying to trigger OnPressHigher() from a button press, but it is not working. Why?

a)

We have forgotten to add a semi-colon after our method declaration.

b)

We always need to declare our min variable within the scope of the method - it is currently out of scope.

c)

we have forgotten to add a return type to our method, it should not be void.

d)

We have forgotten to add the public access modifier at the start of our method.

15.

Which of the following statements will successfully load a scene indexed as "0"?

a)

SceneManager.LoadScene (0);

b)

Load("SecretRoom");

c)

Scene.AddLevel("SecretRoom");

d)

SceneManager.LoadScene ("0");

16.

Let's debug some code. Why won't this code work as expected?

a)

We have forgotten to add a semi-colon after LoadNextScene()

b)

SceneManager should not have a capital 'S' given that it is referring to a class

c)

We have forgotten to add a return type in our LoadNextScene() method - it should not be 'void'.

d)

The name of the declared variable is different to the name of the variable we are passing in to our method.

17.

Which of the following "using" statements should be placed at the top of a script that wants to change scenes?

a)

using UnityEngine.UI;

b)

using UnityEngine.SceneManagement;

c)

using Scenes;

d)

using SceneManager;

18.

What is the name of the dialog you use to enter a list of your scenes that are available in a standalone game, with the default scene placed at the top of the list?

a)

Scene Manager

b)

Project Manager

c)

Build Settings

d)

Scene Loader

19.

How do you attach a script function to a Unity Button?

a)

Double-click on the script in the Assets panel, then select the function name

b)

Type in the name of the function next to the "Function" setting in the Inspector panel

c)

Click the plus button under the On Click() setting, select a GameObject from the Hierarchy, and then select a function on a script attached to that object

d)

Drag the script asset onto the Button object in the Hierarchy panel

20.

What happens when a user clicks on a Unity button?

a)

Unity will automatically call the OnClick() function on any script attached to the Button object

b)

Unity will automatically call the OnClick() function on all scripts found within that scene

c)

You can query for that button click state within an Update() function

d)

Unity will call a function you have selected on an object you have selected under the On Click() panel

21.

When we play the game and click on the "Lower" Button nothing happens. Why is that?

a)

We have not provided the appropriate sprite image.

b)

Navigation is set to automatic.

c)

We have not assigned an On Click Function

d)

The button needs a material to be set.

22.

Which of the following best describes a flowchart?

a)

A series of detailed comments in your code

b)

A chart measuring the speed of program flow

c)

A visual diagram of code decisions, actions and program flow

d)

User documentation that describes how to work with your software

23.

Which of the following flowchart shapes is used to connect other shapes together to show program flow?

a)

Arrow

b)

Dashed line

c)

Wavy line

d)

Thin rectangle

24.

What GameObject is included when you create a new Unity Scene?

a)

Main Sprite

b)

Main Script

c)

Main Background

d)

Main Camera

25.

When you create a Unity Button, it will become a child of which object in the Hierarchy?

a)

Sprite

b)

Camera

c)

Canvas

d)

Animator

26.

What other object is automatically created with a new UI Button?

a)

Text

b)

AudioListener

c)

Camera

d)

Sprite

27.

Which package can we use to make our font look nicer than the default font?

a)

TicTac Pro

b)

TeshMesh Pro

c)

TexMex Pro

d)

TextMesh Pro

28.

What term is used to describe a change in an image width and height, in pixels, while still showing the entire image area?

a)

Resizing

b)

Cropping

c)

Converting

d)

Rasterizing

29.

What process is used to remove the unwanted parts of an image in order to display only a smaller area?

a)

Resizing

b)

Cropping

c)

Converting

d)

Rasterizing

30.

Which of the following image formats support transparency, which is often important for game sprites?

a)

JPG

b)

BMP

c)

TIFF

d)

PNG and GIF