GAME 106 Study Guide

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/43

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

44 Terms

1
New cards

What is a low level programming language?

Binary. Harder to understand but more efficient language.

2
New cards

What is a high level programming language?

 

Easier to understand but less efficient. Example: C#

3
New cards

Which kind of language is C#?

High level programming language.

4
New cards

What are variables?

Stores information in your program.

5
New cards

What is a primitive data type?

A very basic data types. Example: Numbers, True and False, Characters.

6
New cards

What are some basic primitive variables used in C#?

int (integer), bool (boolean), char (single character), float (number with decimal)

7
New cards

How do you declare a variable?

public/private, type of variable, name of variable, then ;

8
New cards

What is an if statement?

A condition statement. If this is true, then execute the code.

9
New cards

How do you write an if statement in C#?

if (condition)

{

block of code

}

10
New cards

How do AND and OR work?

And is && and or is ||. Conditional.

11
New cards

How do you use a while loop?

while();

{

}

12
New cards

How do you use a for loop?

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

{

what you want to loop

}

13
New cards

How do you use a switch statement?

switch()

{

case

}

14
New cards

What is a function/method?

Block of code that does something. The type, the name, then the parameters.

15
New cards

How do you create a function/method?

public void NameOfFunction()

{

}

16
New cards

How do you call a function/method?

void Update()

{

randomName();

}

17
New cards

What is a recursive function/method?

A function that calls itself to calculate a result.

18
New cards

What is an enum?

A list of options/named values.

19
New cards

What is an int?

An integer. A whole number (no decimals)

20
New cards

What is a float?

A number that is a decimal/ fraction numbers.

21
New cards

What is a string?

A sequence of multiple characters.

22
New cards

What is a class?

A fundamental block of C# programming that defines a blueprint for object. Huge instruction of code.

Example:

public class raycast : MonoBehaviour

23
New cards

f after a number is means that the number is a

float

24
New cards

void Awake()

is called first, just after a prefab is instantiated.

25
New cards

void Start()

is called before the first frame update.

26
New cards

void Update()

is called once per frame.

27
New cards

void FixedUpdate()

is called 60 times a second, independent of the framerate.

28
New cards

void LateUpdate()

is called after after update.

29
New cards

What is a Static Variable?

A type of variable that only exists in that class that its attached to. For Example:

If you have a static variables for house called Material and set it to stone from bricks, every house in the level would then have those same materials.

30
New cards

What is a Static Method?

A function that belongs to the class itself, not to any one instance. It can be called directly from the class, without needed a specific object. They can’t act on individual instances unless you pass the instance to them as a parameter.

31
New cards

What is an Object?

An existing thing that can have attributes and methods attached.

32
New cards

What is an Instance?

A single occurrence of a class. An individual object made from that said class. For example:

A class is a blueprint of a house and an instance is a house made from that blueprint.

33
New cards

How do you use an Enum?

enum (name of enum goes here)

{constant/value #1, constant/value #2, constant/value #3, etc}

note: constants are read only variables / named values.

34
New cards

How do you write a comment in C#?

Write // before the line of code to comment out the entire line. To comment out multiple lines, use /* before the group of comments and */ after to close the comment.

35
New cards

How do you use a for each loop?

Specifically used for going through an array.

36
New cards

What is an Array?

Holds variables.

37
New cards

How do you use an Array?

Firstly, the array type with brackets, then the name of said array, then equal sign, then curly brackets containing the names of the variables/objects, finishing with semicolons. For example:

string[] cars = {"Volvo", "BMW", "Ford", "Mazda"};

or

int[] myNum = {10, 20, 30, 40};

38
New cards

What is a Sorting Algorithm?

Sorts an array/list into a more orderly fashion. For example:

Original: [10, 3, 4, 7]

After Sorting Algorithm: [3, 4, 7, 10] or [10, 7, 4, 3]]

39
New cards

What is a Two Dimensional Array?

Two axis list.

Example:

[0,0] [1,0] [2,0]

[1,0] [1,1] [1,2]

[2,0] [2,1] [2,2]

40
New cards

What is a List?

Holds objects and its information.

41
New cards

What is whitespace in C#

Any space or lines with no code in code editors like Visual Studio. Doesn’t change the code itself.

42
New cards

Why use a for loop?

Great to use for code that’s set to run a specific number of times. While loops can also be used in the same way, but for loops works better/ more efficient in this case.

43
New cards

What is a switch statement?

A type of statement where it goes through different cases in a switch expression. Example:

int day = 4;
switch (day) 
{
  case 1:
    Console.WriteLine("Monday");
    break;
  case 2:
    Console.WriteLine("Tuesday");
    break;
  case 3:
    Console.WriteLine("Wednesday");
    break;
  case 4:
    Console.WriteLine("Thursday");
    break;
  case 5:
    Console.WriteLine("Friday");
    break;
  case 6:
    Console.WriteLine("Saturday");
    break;
  case 7:
    Console.WriteLine("Sunday");
    break;
}
// Outputs "Thursday" (day 4)

44
New cards

What does void mean when declaring a method?

That the method has no returning value.