unity Script output
probability
Game Design Lecture
game design definitions
unity
100

void OnCollisionEnter(Collision collision) {    if(collision.gameObject.tag == "Enemy") {        Destroy(gameObject);    } }

When the player game object collides with an object tagged as "enemy" the player game object will be destroyed. The "OnCollisionEnter" function triggers when a collision occurs and Destroy will destroy the gameObject it is attached to.

100

A die is rolled and a coin is tossed. Find the probability that the die shows an odd number and the coin shows a head

1/4

100

There are three types of rules. Operational rules, constitutive rules and

implicit Rules

100

A symbol for Killers in the Bartle’s Player Types.

a club

100

To display a list of all GameObjects in the current scene and their parent-child relationships?

 the Unity Hierarchy window

200

private int score = 0;

void OnTriggerEnter(Collider other) {

    if(other.gameObject.tag == "Coin") {

        score += 10;

        Destroy(other.gameObject);

        Debug.Log("Score: " + score); }}


 Each time the GameObject collides with an object tagged as "Coin", 10 points will be added to the score. The coin object will be destroyed, and the new score will be logged to the console. This happens in the OnTriggerEnter function, which is called when the GameObject enters a trigger collider.

200

A die is rolled 4 times what is the probability of all the outcomes being even?

1/16

200

The snowball effect is prevalent in this type of feedback loop

a positive feedback loop

200

A system where if something gets too high, the game will pull them back for the sake of balance.

 a negative feedback loop

200

A function that dynamically create copies of a GameObject in Unity

 the Instantiate() function

300

public GameObject prefab; void Update() {    if(Input.GetKeyDown(KeyCode.S)) {        Instantiate(prefab, new Vector3(0, 0, 0), Quaternion.identity);    } }

Whenever S is pressed a new instance of the prefab game object will be created at the coordinates 0,0,0 this is done using the Instantiate object.

300

From a standard deck of 52 playing cards, what is the probability of drawing an Ace followed by a King, without replacement?


265216≈0.00603 or 0.603%.

300

Chess is an example of a game that’s deterministic and has this type of information

 perfect information

300

A player that has a high interest in winning but violates implicit rules.

an unsportsmanlike player

300

A Unity component allows you to respond to button clicks

 the OnClick method

400

void FixedUpdate() {

    if(Input.GetKeyDown(KeyCode.Space)) {

        GetComponent<Rigidbody>().AddForce(Vector3.up * 500);

    }

}


Every time the spacebar is pressed, a force of 500 units in the upward direction is applied to the GameObject's Rigidbody. This will likely cause the GameObject to jump upwards, depending on its mass and the physics properties of the Rigidbody.

400

you have 5 kids and 5 seats how many different ways can the kids sit in the seats?

5! = 120

400

Jesse Snell thinks that games are problem-solving activities approached in this attitude.

a playful attitude

400

Categories of information on an object.

attributes

400

A method is called when the script instance is being loaded, before Start()

 the Awake() method in Unity

500

void Update() {

    if(Input.GetKey(KeyCode.W)) {

        transform.Translate(Vector3.forward * 10 * Time.deltaTime);

    }

    if(Input.GetKey(KeyCode.A)) {

        transform.Rotate(Vector3.down * 50 * Time.deltaTime);

    }

}


When the W key is held down the game object moves forward at a constant speed of 10 units per second. If the 'A' key is held down, the GameObject continuously rotates left (counterclockwise) at a rate of 50 degrees per second.

500

you have a deck of cards with replacement and want one ace one king and one queen all from the same suit what is the probability that occurs?

4/52 * 1/52 * 1/52 = 4/140608

We do not care for the suit of the ace because we  care that the king and queen are of the same suit as the ace.

500

The attributes in a game of checkers.

the color, position, and role of pieces

500

A type of rule that represents the underlying structure of a game.

constitutive Rule

500

A system handles input events, such as clicks, and interacts with UI elements, like buttons

 Unity's Event System in the context of UI interactions

M
e
n
u