2. Why Math?
• What do you think?
• What language should we use?
• It doesn’t matter!
• What math have you used before?
3. • Programming is the ultimate puzzle game
• “Controlling complexity is the essence of
computer programming.” -Bertrand Meyer
• As code gets more complex, there are many
ways to get the same result
• There are three areas of complexity in
programming:
• Technology
• Algorithms
• Architecture
3
What is
programming?
5. What is a Data Structure?
• What do you think?
• In computer science, a data structure is a data organization,
management, and storage format that enables efficient access
and modification. More precisely, a data structure is a collection
of data values, the relationships among them, and the functions
or operations that can be applied to the data.
6. - To be able to create & use different data structures effectively
- To be able to create & use custom data structures and operators
- To be able to create & use algorithms, such as a pathfinding algorithm
- To be able to create & use procedural generation algorithms
- To be able to use trigonometry / math for games, such as Vectors, Matrices and
Determinism
- To be able to use concepts like binary masks, bit shifting and custom operators
- To be able to create & use Big O Notation
Learning Outcomes
7. 1. PacBear: A 2D Grid
2. PacBear: Structs & Operators
3. PacBear: Pathfinding
4. PacBear: Pathfinding 2
5. PacBear: Layers & Bitmasks
6. PacBear: Procedural Worlds
7. Clash of Bears: Determinism
8. Clash of Bears: A New Angle
Course outline (1/2)
8. 9. Clash of Bears: A New Angle (2)
10. Clash of Bears: Matrices
11. Clash of Bears: Vector Math
12. Clash of Bears: Implementation
13. Clash of Bears: Gameplay
14. Clash of Bears: Deterministic Steps
15. Clash of Bears: Multiplayer
Course outline (2/2)
12. What will we learn?
• Using a 2D array
• Generate a world on runtime
• Structs vs Classes
• Creating IntVectors
13. Timeline
15 45 10 45 10 45 10
Intro 2D Arrays Creating the World Moving around
14. 2D Matrices
• What is a 2D Matrix?
• A regular array is considered a 1-dimensional array
• A 2D Matrix = 2D Array
• A 2D Matrix is (almost) the same as an array of arrays
• When would we use it?
• Displaying pixels
• Creating snake
• Anything with a grid
17. Challenges
1. Add a ‘Honey’-prefab to the grid.
2. Increase PacBear’s speed
3. Add ‘Collision’ with the walls, using the grid. Don’t use Colliders!
4. Have the Camera focus on & follow PacBear (simple CamFollow
script)
5. Make a fun level!