What is z after the following python code?
x = 6
y = x -2
z = x + y
z equals 10
What does the draw loop do?
Draw the items of the game.
Why do most programs have input and output?
To interact with the user. Input allows the user send the program data and output shows the user the result of the program.
How to detect when a player presses the space button?
keyboard.space
ants?
ANTS!
What does the following python code do?
name = input("What is your pet's name?")
print(name, "I like that name!")
It takes input from the user and will print the input the user entered followed by I like that name.
Update the variable and data in the game.
What are the two main types of loops?
For loop (do for a set number of times)
While loop (do while something is true)
What will this piece of code do?
player.x = player.x + 2
Will move the players x position to the right.
Why are problems in a program called a bug?
Actual bug where found in the computer causing issues
If x is 8 what is y after the following python code?
if x > 10 or x == 1:
y = 1
elif not (x > 3 and x < 7 ):
y = 2
else
y = 3
Y = 2
How do we make a new item in the game?
Create an actor with the Actor function.
What is an infinite loop and why would you use it?
A loop will run forever -> you want the loop to run forever - you want the program to always be checking to something
What data structure could you use to keep track of multiple enemies in a game?
List
What is behind the giant screen right now?
A Chicken
What is y set to after the following python code?
list = ["a", "b", "c", "d", "e"]
y = list[3]
y = "d"
Why do we use an update loop in a game?
So we can respond to player input and change values, images, based on that input.
Why is python considered a high level programing language?
It "easily" understood by programmers, but it needs to be translated down to Binary in order for computers to understand.
What would the following code do?
player.y = player.y - 2
It would move the player towards the top of the screen
What is the newest wood type in Minecraft?
Bamboo
What does the following python code do?
list = [0,2,4,6,8]
for i in range(0, len(list))
list[i] = list[i] + 2
Loops through each index of the list and at each index of the list it adds 2 to the number that is in that position so each item will be 2 greater.
list will now equal [2,4,6,8,10]
How many times does the update loop run a second?
60
What is this binary number in decimal?
1011 (Hint binary is a 2 based system)
1011 = 11
2^3 +0 + 2^2 + 2^0
8+0+2+1 = 11
How do tell if two items intersect?
Use the colliderect function
What is gravy?
A fruit!