220 likes | 678 Views
Building a Game in Scratch. Module 4 Lesson 1. Get out your notes!!. Learning Objectives. To learn about the process of project design. To be introduced to conditional statements in Scratch. Outline for the day. You will make a game today First we will look at Game Design.
E N D
Building a Game in Scratch Module 4 Lesson 1 Get out your notes!!
Learning Objectives • To learn about the process of project design. • To be introduced to conditional statements in Scratch.
Outline for the day • You will make a game today • First we will look at Game Design. • Once the game is designed we will implement the game in Scratch
Design a Game: “Run Away” • When you start a programming project it is a good idea to brainstorm away from the computer. • We will start with a simple game. • It has 2 characters and a background. • Answer the following to help generate ideas about your game. • Complete the following before you get working in Scratch.
Design a Game • Description of your Good Guy character • Description of your Bad Guy character • Description of the Background you would like to use for your game.
Design a Game: Improvements • Enter improvements for your game.
Building the Game • Open Scratch and remove the Cat • Add your two characters. (Good Guy/ Bad Guy) • Add your background • Program the Good Guy’s movements • Select him • Add scripts for right arrow (Change x by 10), left arrow (Change x by -10), up arrow (Change y by 10), down arrow (Change y by -10).
Program the Bad-Guy • Sample description of motion • He will be moving forever (Forever loop) • Change x by (Pick random -20 to 20) • Wait 0.2 sec • Change y by (Pick random -20 to 20) • Wait 0.1 sec • Turn (pick random -90 to 90) • If on edge, bounce • Test it. Does the bad guy move around randomly? • Modify as needed to get the motion you would like.
Sample Bad Guy Code Refine these values to improve the Bad Guy’s movements.
Ouch!!! • Getting the Good Guy to react to bumping into the bad guy. • This will need to be checked forever. (Loop) • Say Ouch • Change the character (fisheye, you can pick another effect) • Test
Extensions • Enhance the Good Guy functionality by including a costume change when moving in different directions • Add special movement keys for the Good Guy. A jump, … • Alter the speed and motion of the Bad Guy to make it more realistic. • Turn in the current version of your game • YourNameMod4Lesson1