diff --git a/exercises/13/create_function/131-functions-and-parameters.md b/exercises/13/create_function/exercise.md similarity index 100% rename from exercises/13/create_function/131-functions-and-parameters.md rename to exercises/13/create_function/exercise.md diff --git a/exercises/15/build_files/15-compilation-linking.md b/exercises/15/build_files/exercise.md similarity index 100% rename from exercises/15/build_files/15-compilation-linking.md rename to exercises/15/build_files/exercise.md diff --git a/exercises/15/unit_test/150-unit-test.md b/exercises/15/unit_test/exercise.md similarity index 100% rename from exercises/15/unit_test/150-unit-test.md rename to exercises/15/unit_test/exercise.md diff --git a/exercises/16/unique_ptr_pacman/exercise.md b/exercises/16/unique_ptr_pacman/exercise.md new file mode 100644 index 0000000..f56fabd --- /dev/null +++ b/exercises/16/unique_ptr_pacman/exercise.md @@ -0,0 +1,9 @@ +# Memory and RAII + +(corentin: maybe something about } that destroys things) +We are going to play with using std::unique_ptr as we discussed in the slides. Since we will be reverting these changes +back, do take a copy of the GameState files before we start. We will change PacMan within GameState into a std:: +unique_ptr, once this has been done the code will not compile, because there are further changes needed within +the GameState class. Go through and figure out what needs to be updated. Can we change one of the ghosts into a std:: +unique_ptr? Are there any current design problems we will run into? What do these design issues say about ownership of +data? diff --git a/exercises/17/create_class/17-create-class.md b/exercises/17/create_class/exercise.md similarity index 100% rename from exercises/17/create_class/17-create-class.md rename to exercises/17/create_class/exercise.md diff --git a/exercises/17/make_ghost/17-create-ghost.md b/exercises/17/make_ghost/exercise.md similarity index 73% rename from exercises/17/make_ghost/17-create-ghost.md rename to exercises/17/make_ghost/exercise.md index 8316e8b..cc07b77 100644 --- a/exercises/17/make_ghost/17-create-ghost.md +++ b/exercises/17/make_ghost/exercise.md @@ -5,3 +5,5 @@ behavior. Clyde always chases PacMan so the only thing you should need is where PacMan is currently located. But Clyde also has the scatter behavior as the other ghosts. + +Where are the graphics for Clyde in the assets file and how can we make sure the ghost will be correctly rendered? diff --git a/exercises/17/refactor_out_ghost_state/17-ghost-state.md b/exercises/17/refactor_out_ghost_state/exercise.md similarity index 100% rename from exercises/17/refactor_out_ghost_state/17-ghost-state.md rename to exercises/17/refactor_out_ghost_state/exercise.md diff --git a/exercises/21/is_intersection/exercise.md b/exercises/21/is_intersection/exercise.md new file mode 100644 index 0000000..84f4697 --- /dev/null +++ b/exercises/21/is_intersection/exercise.md @@ -0,0 +1,5 @@ +# std::array and ranged for + +waage: Maybe the "isIntersection" for the AI. Create an array of GridPosition and array of bool and loop through to +check "isWalkableForPacMan" and then return the different kinds of intersections (top/right, right/bottom, bottom/left, +left/top) \ No newline at end of file diff --git a/exercises/23/algorithm_pellets/exercise.md b/exercises/23/algorithm_pellets/exercise.md new file mode 100644 index 0000000..cca8037 --- /dev/null +++ b/exercises/23/algorithm_pellets/exercise.md @@ -0,0 +1,7 @@ +# Iterators and algorithms + +Use algorithms in Pellet and SuperPellet + +# Pellet + +Turn algorithm into raw loop, make students use algorithms. \ No newline at end of file diff --git a/exercises/24/lambda-fy/exercise.md b/exercises/24/lambda-fy/exercise.md new file mode 100644 index 0000000..ae87877 --- /dev/null +++ b/exercises/24/lambda-fy/exercise.md @@ -0,0 +1,3 @@ +# Lambdas + +Find a small function and turn it into a lambda. diff --git a/exercises/exercises-4.md b/exercises/25/pacman_ai/exercise.md similarity index 59% rename from exercises/exercises-4.md rename to exercises/25/pacman_ai/exercise.md index 9ed8409..0fe0f5c 100644 --- a/exercises/exercises-4.md +++ b/exercises/25/pacman_ai/exercise.md @@ -1,15 +1,3 @@ -## Exercises - -# Exercise: PacMan Bot - -PacMan can be controlled with the keyboard, but those inputs can be automated. The only thing that needs to change is -the value within the InputState class. - -Start by giving InputState random values on each update and then program in a fixed set of movement. For example "Go -Right for 3 seconds, then down, right, up, right". This should pickup the first super pellet. - -In this exercise, the input code in processEvents is not needed. - # Exercise: PacMan AI The exercise above is fixed based on the layout of the board and is hard to make generic. @@ -22,7 +10,3 @@ For example if pacman is at an intersection and can go either right or up, and t then pacman will go up. Then while pacman is going up, a ghost enters that path, pacman will go back. You only need to worry about the grid itself and any ghosts on the North/South/East/West axis of PacMan. - -# Exercise: ? - -Extra \ No newline at end of file diff --git a/exercises/25/pacman_bot/exercise.md b/exercises/25/pacman_bot/exercise.md new file mode 100644 index 0000000..323ff4e --- /dev/null +++ b/exercises/25/pacman_bot/exercise.md @@ -0,0 +1,9 @@ +# Exercise: PacMan Bot + +PacMan can be controlled with the keyboard, but those inputs can be automated. The only thing that needs to change is +the value within the InputState class. + +Start by giving InputState random values on each update and then program in a fixed set of movement. For example "Go +Right for 3 seconds, then down, right, up, right". This should pickup the first super pellet. + +In this exercise, the input code in processEvents is not needed. diff --git a/exercises/NOTES.md b/exercises/NOTES.md deleted file mode 100644 index 5896e9a..0000000 --- a/exercises/NOTES.md +++ /dev/null @@ -1,48 +0,0 @@ -# Mod(C++) - Pac-Man Exercise - -## Make Speedy - -1) Make a new ghost class for Speedy -2) Pick the right sprite -3) Pick the right scatter target - -Advanced: - -4) Try to chase PacMan - -Hints: (links) - -## Implement eating of pellets - -1) Make a Pellets class (look at SuperPellets) -2) Implement eating of pellets - -Advanced: - -3) Try to keep score - -Hints: (links) - -## Add cherries - -1) Implement cherries (look at SuperPellets) -2) Change the ghost speed and look - -Hints: (link) - -## Add Levels - -## Add kill screen - -## Add win - -## Add high score (std::filesystem) - -### Ghosts characters and algorithms -These will probably become relevant -* https://en.wikipedia.org/wiki/Ghosts_(Pac-Man) -* [Video: Pac-Man Ghost AI Explained](https://youtu.be/ataGotQ7ir8) -* https://gameinternals.com/understanding-pac-man-ghost-behavior -* https://www.gamasutra.com/view/feature/3938/the_pacman_dossier.php?print=1 -* https://www.slideshare.net/grimlockt/pac-man-6561257 -* http://donhodges.com/pacman_pinky_explanation.htm diff --git a/exercises/advanced/blue_pellet/exercise.md b/exercises/advanced/blue_pellet/exercise.md new file mode 100644 index 0000000..9c2a0b7 --- /dev/null +++ b/exercises/advanced/blue_pellet/exercise.md @@ -0,0 +1,2 @@ +# Blue Pellet? +A pellet that makes the ghosts stop diff --git a/exercises/advanced/game_over/exercise.md b/exercises/advanced/game_over/exercise.md new file mode 100644 index 0000000..bf8c91c --- /dev/null +++ b/exercises/advanced/game_over/exercise.md @@ -0,0 +1,10 @@ +# Exercise: Game Over + +In this exercise you will add a game over state to the game. After PacMan has lost all of his lives the game will be +over. PacMan should not respawn and the ghosts should stop. + +The GameState class has the number of lives and they are already drawn on screen so that information can be used to +indicate the game over state itself. + +If the game is over, the text "Game Over" should be drawn over the game board. You do not need to implement a new game, +for this exercise restarting the application is enough. diff --git a/exercises/advanced/generic_teleporting/exercise.md b/exercises/advanced/generic_teleporting/exercise.md new file mode 100644 index 0000000..1791164 --- /dev/null +++ b/exercises/advanced/generic_teleporting/exercise.md @@ -0,0 +1,8 @@ +# Exercise: Generic Teleporting + +In the game and the exercise above, the teleports are linked to each other. These systems are not very generic. Update +the teleporting system so that two teleport doors are linked with each other. + +For example so you can enter a teleport from somewhere on the bottom row and exit from somewhere on the right column. + +You do not need to allow for many teleports like this, only 2 doors. diff --git a/exercises/advanced/high_score/exercise.md b/exercises/advanced/high_score/exercise.md new file mode 100644 index 0000000..8c47518 --- /dev/null +++ b/exercises/advanced/high_score/exercise.md @@ -0,0 +1 @@ +(std::filesystem) \ No newline at end of file diff --git a/exercises/advanced/hitbox_collision/exercise.md b/exercises/advanced/hitbox_collision/exercise.md new file mode 100644 index 0000000..a506b64 --- /dev/null +++ b/exercises/advanced/hitbox_collision/exercise.md @@ -0,0 +1,3 @@ +# Hitbox collision + +AABB diff --git a/exercises/exercises-3.md b/exercises/advanced/increased_ghost_speed/exercise.md similarity index 86% rename from exercises/exercises-3.md rename to exercises/advanced/increased_ghost_speed/exercise.md index 861e3a9..376db79 100644 --- a/exercises/exercises-3.md +++ b/exercises/advanced/increased_ghost_speed/exercise.md @@ -1,5 +1,3 @@ -## Exercises - # Exercise: Increased Ghost Speed Currently the ghosts move at a fixed rate. But in the original game, the ghosts would move slightly faster and faster as @@ -13,11 +11,3 @@ You could increase the speed after each time the ghost is eaten for example, or after N seconds. Also ask yourself, how would you test this? - -# Exercise: ? - -Extra - -# TODO Changes - -Pinky as main exercise and Clyde as Extra. \ No newline at end of file diff --git a/exercises/advanced/multiple_generic_teleporters/exercise.md b/exercises/advanced/multiple_generic_teleporters/exercise.md new file mode 100644 index 0000000..8dbfb96 --- /dev/null +++ b/exercises/advanced/multiple_generic_teleporters/exercise.md @@ -0,0 +1,5 @@ +# Exercise: Multiple Generic Teleporters + +Continuation from above. Take the generic teleporting system you made and allow for more than 1 set of doors. + +You might want to look into coloring/tinting each pair a certain color so the player will know what door leads to where. diff --git a/exercises/advanced/new_level/exercise.md b/exercises/advanced/new_level/exercise.md new file mode 100644 index 0000000..350f2ed --- /dev/null +++ b/exercises/advanced/new_level/exercise.md @@ -0,0 +1,7 @@ +# Exercise: New Level + +In this exercise you will need to reset the game board but keep score and lives the same. This should happen when PacMan +eats the last pellet or super pellet. + +The ghosts and pacman should go back to their original position and all of the pellets should respawn. This can go on +forever, but you can look at the next exercise for more information. diff --git a/exercises/advanced/vertical_teleport/exercise.md b/exercises/advanced/vertical_teleport/exercise.md new file mode 100644 index 0000000..8ee1f32 --- /dev/null +++ b/exercises/advanced/vertical_teleport/exercise.md @@ -0,0 +1,5 @@ +# Exercise: Vertical Teleport + +The teleporters are programmed to work only on the horizontal axis. Change the board to add teleporters at the top and +bottom row. This also requires a code change when teleporting happens. These new teleporters only need to function like +the existing teleporters and you do not need to add more than one on each row. diff --git a/exercises/advanced/victory/exercise.md b/exercises/advanced/victory/exercise.md new file mode 100644 index 0000000..51e29ec --- /dev/null +++ b/exercises/advanced/victory/exercise.md @@ -0,0 +1,9 @@ +# Exercise: Victory + +As a continuation of the Game Over and New Level exercises. If PacMan beats 3 levels, the game has been beaten and a +victory screen should be shown. + +A count of how many levels have been beaten needs to be stored and this should be checked when transitioning between +levels. + +This should function similarly to the Game Over state but used to indicate that the player won the game. diff --git a/exercises/exercises-1.md b/exercises/exercises-1.md deleted file mode 100644 index e1693f9..0000000 --- a/exercises/exercises-1.md +++ /dev/null @@ -1,30 +0,0 @@ -## Exercises - -# Exercise: Game Over - -In this exercise you will add a game over state to the game. After PacMan has lost all of his lives the game will be -over. PacMan should not respawn and the ghosts should stop. - -The GameState class has the number of lives and they are already drawn on screen so that information can be used to -indicate the game over state itself. - -If the game is over, the text "Game Over" should be drawn over the game board. You do not need to implement a new game, -for this exercise restarting the application is enough. - -# Exercise: New Level - -In this exercise you will need to reset the game board but keep score and lives the same. This should happen when PacMan -eats the last pellet or super pellet. - -The ghosts and pacman should go back to their original position and all of the pellets should respawn. This can go on -forever, but you can look at the next exercise for more information. - -# Exercise: Victory - -As a continuation of the Game Over and New Level exercises. If PacMan beats 3 levels, the game has been beaten and a -victory screen should be shown. - -A count of how many levels have been beaten needs to be stored and this should be checked when transitioning between -levels. - -This should function similarly to the Game Over state but used to indicate that the player won the game. \ No newline at end of file diff --git a/exercises/exercises-2.md b/exercises/exercises-2.md deleted file mode 100644 index b860123..0000000 --- a/exercises/exercises-2.md +++ /dev/null @@ -1,22 +0,0 @@ -## Exercises - -# Exercise: Vertical Teleport - -The teleporters are programmed to work only on the horizontal axis. Change the board to add teleporters at the top and -bottom row. This also requires a code change when teleporting happens. These new teleporters only need to function like -the existing teleporters and you do not need to add more than one on each row. - -# Exercise: Generic Teleporting - -In the game and the exercise above, the teleports are linked to each other. These systems are not very generic. Update -the teleporting system so that two teleport doors are linked with each other. - -For example so you can enter a teleport from somewhere on the bottom row and exit from somewhere on the right column. - -You do not need to allow for many teleports like this, only 2 doors. - -# Exercise: Multiple Generic Teleporters - -Continuation from above. Take the generic teleporting system you made and allow for more than 1 set of doors. - -You might want to look into coloring/tinting each pair a certain color so the player will know what door leads to where. \ No newline at end of file diff --git a/exercises/project-structure.md b/exercises/project-structure.md index b732665..3a1a773 100644 --- a/exercises/project-structure.md +++ b/exercises/project-structure.md @@ -50,3 +50,13 @@ from the player (or a bot). Because updates of game state and drawing the game on screen are completely separate, we can create game state within unit tests and give it arbitrary delta time and call whatever functions we want to simulate the game being played. Most unit tests only focus on one single class but some (like `testFruits`) use the `GameState` class. + +## Ghosts characters and algorithms + +These will probably become relevant +* https://en.wikipedia.org/wiki/Ghosts_(Pac-Man) +* [Video: Pac-Man Ghost AI Explained](https://youtu.be/ataGotQ7ir8) +* https://gameinternals.com/understanding-pac-man-ghost-behavior +* https://www.gamasutra.com/view/feature/3938/the_pacman_dossier.php?print=1 +* https://www.slideshare.net/grimlockt/pac-man-6561257 +* http://donhodges.com/pacman_pinky_explanation.htm diff --git a/exercises/small-exercises.md b/exercises/small-exercises.md deleted file mode 100644 index 60f2da7..0000000 --- a/exercises/small-exercises.md +++ /dev/null @@ -1,11 +0,0 @@ -# Pellet -Turn algorithm into raw loop, make students use algorithms. - -# Lambdas -Find a small function and turn it into a lambda. - -# Blue Pellet? -A pellet that makes the ghosts stop - -# Hitbox collision -AABB \ No newline at end of file diff --git a/exercises/small-exercises2.md b/exercises/small-exercises2.md deleted file mode 100644 index 75611bf..0000000 --- a/exercises/small-exercises2.md +++ /dev/null @@ -1,58 +0,0 @@ -# Functions and Parameter Passing - -In Board.cpp we have functions to detect the state of the game board. Let's add a few helper functions and create unit -tests for them. - -Add a function that will check if a cell on the board is a wall. Then use that function in "isWalkableForPacMan" and " -isWalkableForGhost". Remember you will need to add the function into the Board.hpp header file to be able to use it in -the unit tests. - -# Game - Foundation - -? - -# Compilation, Linking and Assets - -One of the PacMan ghosts is missing and we will implement this ghost later. But for now, let's add the cpp and hpp files -and run CMake to see the file added to our project. Then let's create an empty class called Blinky that looks like the -other Ghost classes but it can be empty at this time. Where are the graphics for Blinky in the assets file and how can -we make sure the ghost will be correctly rendered? - -# Memory and RAII - -(corentin: maybe something about } that destroys things) -We are going to play with using std::unique_ptr as we discussed in the slides. Since we will be reverting these changes -back, do take a copy of the GameState files before we start. We will change PacMan within GameState into a std:: -unique_ptr, once this has been done the code will not compile, because there are further changes needed within -the GameState class. Go through and figure out what needs to be updated. Can we change one of the ghosts into a std:: -unique_ptr? Are there any current design problems we will run into? What do these design issues say about ownership of -data? - -# Classes and Structs - -Within the GameState class, we often call all of the ghost functionality at the same time. So lets create a class that -will contain all the ghosts. It can be called GhostState and the only member variables will be the ghosts. This class -then needs to be contained within GameState instead of the ghosts. Then you need to write the functions for this -GhostState class that are called within the GameState class. - -# std::array and ranged for - -waage: Maybe the "isIntersection" for the AI. Create an array of GridPosition and array of bool and loop through to -check "isWalkableForPacMan" and then return the different kinds of intersections (top/right, right/bottom, bottom/left, -left/top) - -# std::vector - -? - -# Iterators and algorithms - -Use algorithms in Pellet and SuperPellet - -# Lambdas and Function Templates - -? - -# Algorithmic Thinking - -? \ No newline at end of file