wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

03 Text Adventure Worksheet

Total questions: 30

Worksheet time: 8hrs 30mins

Name
Class
Date
1.

Which kind of variable can be seen by any function within the class and will live as long as the parent object?

a)

local

b)

class-level

c)

universal

d)

global

2.

What term is used to describe a variable that exists and is visible to a particular section of code?

a)

public

b)

private

c)

in-scope

d)

underwater

3.

Given the code below, which of the two functions are able to use the "mystery" variable?

a)

Start() only

b)

Update() only

c)

both Start() and Update()

d)

No functions can use the mystery variable

4.

Given the code below, which of the two functions are able to use the "mystery" variable?

a)

Start() only

b)

Update() only

c)

both Start() and Update()

d)

No functions can use the mystery variable

e)

Not in-scope in any function

5.

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)

public or [SerializeField]

b)

visible

c)

global

d)

private

6.

When you add a Canvas to a Unity project, where does it appear?

a)

In the Hierarchy panel

b)

In the Inspector panel

c)

In the Assets area

d)

In the MonoDevelop IDE

7.

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

a)

Canvas

b)

Camera

c)

Sprite

d)

Animator

8.

What do you call something that provides some sort of functionality to a GameObject?

a)

An object

b)

An image

c)

A widget

d)

A component

9.

Which component will allow you to position and rotate your sprite on the screen?

a)

The Location component

b)

The Rotation component

c)

The Property component

d)

The Transform component

10.

Which of the following are properties of the Transform component?

a)

Position

b)

Rotation

c)

Scale

d)

All of these

11.

What is a script considered when you add it to a GameObject?

a)

An object

b)

An image

c)

A widget

d)

A component

12.

What new line of C# code should you add to the top of your script to enable access to the Text object?

a)

using UnityEngine.UI;

b)

using Text;

c)

using Canvas;

d)

access UI.Text;

13.

Which of the following variables uses the proper name conventions?

a)

playerscore

b)

playerScore

c)

PlayerScore

d)

PLAYERSCORE

14.

Using [SerializeField] in front of declaring a variable allows us to do what?

a)

Serialize all the fields on the Game Object.

b)

Declare a variable from a different namespace.

c)

Assign/update the value of the variable from within the Inspector window.

d)

Make the variable public to all scripts.

15.

Which of the following statements about a Text object in the Hierarchy and a Text variable in a script are true?

a)

They are linked by dragging the Text object onto the script variable in the Inspector panel

b)

The object and variable names must always be the same

c)

You will often see multiple script Text variables linked to the same Text object

d)

All of these are true

16.

Given a Text variable named "playerHealth", which of the following lines of code will successfully set the variable's string contents to "Critical"?

a)

playerHealth = "Critical";

b)

Text.playerHealth("Critical");

c)

playerHealth.text = ("Critical");

d)

playerHealth.setText("Critical");

17.

____________ is a class that lets us store data in stand alone assets

a)

GameObject

b)

Scriptable Object

c)

Monobehaviour

d)

using.UnityEngine

18.

What keyword do you use in front of a function name to show the function returns no data?

a)

null

b)

void

c)

empty

d)

All functions must return some data

19.

What keyword do you add to a function declaration so it will be visible outside the class?

a)

public

b)

visible

c)

private

d)

void

20.

Select the correct answer that declares a function that returns a value.

a)

public String GetStateStory()

b)

public string GetStateStory()

c)

public void string GetStateStory()

d)

public void GetStateStory()

21.

Each of the ____ in an array has the same data type.

a)

subscripts

b)

elements

c)

objects

d)

structures

22.

Initial values provided when initializing an array are separated by ____.

a)

;

b)

.

c)

,

d)

/

23.

Which of the following lines correctly declares an array variable named "grades" that is of type "float"?

a)

float[ ] grades;

b)

grades[ ] float;

c)

float(grades);

d)

float grades;

24.

Knowing that the 1st element in an array has index value 0, write an expression that shows how to access the 3rd element in an array called “friends”.

a)

friends[0]

b)

friends[1]

c)

friends[2]

d)

friends[3]

25.

How would you make an array variable visible in the Unity Inspector panel for the script component?

a)

Right-click on the array variable and select "Publish"

b)

Write the array variable name in all capital letters

c)

Select "Edit" and then "Array" from the Unity IDE menu

d)

Make the array variable public using [SerializeField]

26.

Which statement is most accurate in describing when it is possible to use the var keyword to declare a variable?

a)

When the variable is at the top of our class.

b)

When we are declaring but not initializing the variable

c)

When we are both declaring and initializing a variable in such a way that it is clear what type of variable we have created

d)

When we need to return a variable but it doesn't matter what type of variable is returned.

27.

How do you assign a custom font to a Text control in Unity?

a)

Double-click on the font in the asset folder

b)

Drag the font from the asset folder onto the "Font Source" property in the Font Creator panel

c)

Type in the full font filename, including extension, in the Inspector panel

d)

Drag the font to the Hierarchy as a child object of the parent Text object

28.

What is a loop?

a)

A circular graphic on the screen

b)

A single line of code in a script file

c)

A function or set of statements that will run until a condition is met

d)

The circular motion of some sprites on the screen

29.

Which of the following statements is NOT placed inside the parentheses when defining a for() loop?

a)

A return statement

b)

An initialization statement

c)

A conditional statement

d)

An iteration statement

30.

Which of the following for() loops defines an index variable that would safely access every element in the "friends" array, no matter how many elements it held?

a)

for (int i=0; i < 5; i++)

b)

for (int i=0; i < friends.Length; i++)

c)

for (int i=0; i <= friends.Size(); i++)

d)

for (int i=1; i <= friends.Length; i++)