Day 8 Unit 2

Unit 2. Quest Game.

Today we will start building a role playing game or RPG. We will also learn about a special type of event called “Broadcast”.

Let’s watch the intro video together.

https://csfirst.withgoogle.com/c/cs-first/en/game-design/quest-game/introduction-to-the-quest-game.html

We have three different startup projects you can choose from. They all contain characters that are already programmed to move based on the arrow keys that users press.

We will first program the stage to change when the player enters an entrance, just like you see in many role playing games.

Here, you can use a trick to copy codes across sprites, instead of having to make the same code over and over again. To copy code between sprites, click the code and drag it on top of each sprite.

Watch the video and program the different stages that players can go to.

https://csfirst.withgoogle.com/c/cs-first/en/game-design/quest-game/places-to-go.html

  1. Program the game to begin on the “town” backdrop.
  2. For each entrance sprite:
    • Program the backdrop to change
    • Hide all entrance sprites when the backdrop changes
    • Show all the entrances when the backdrop changes to “town”

Next, we need to give the player a way back to where he was before, by giving him an “exit” option. When the player’s sprite enters a new location, the exit sprite will show. If the player’s sprite touches the exit sprite, the backdrop will change back to town. 

In fact, you can code this part by just copying over the entrance code blocks from the entrance sprite to the exit sprite, and then tweaking them a little.

https://csfirst.withgoogle.com/c/cs-first/en/game-design/quest-game/add-an-exit.html

  1. Copy the code from the house sprite to the exit sprite.
  2. Exchange the “show” and “hide” blocks.
  3. Change the “switch backdrop” value to “town.”
  4. Remove the “broadcast” block.
  5. Make the exit sprite change costumes depending on the backdrop using the “when backdrop switches” and “switch costume” blocks.

Now that we have set up the stages, we will continue after lunch with the object for the quest.