We will be creating a spaceship that simulates real movements in space. The spaceship will fire a laser beam that can destroy targets. The spaceship will.

Slides:



Advertisements
Similar presentations
Create a Simple Game in Scratch
Advertisements

In this tutorial, we are going to create: A race car that the user can control with the arrow keys for direction and speed. A simulated road with a striped.
Create a Simple Game in Scratch
Harry Potter Scratch Game
Adventures in Animation Harry Potter Game Pranali Choubal Kunal Shaw Barb Ericson Dec 2007.
Helicopter Game Tutorial
A Christmas Scratch game
Code Club Session 3 Shark Eats Fish. Picture of finished product here.
This game is loosely based on the Whack-A- Mole arcade game.  Each game starts with 45 seconds of play.  Moles randomly pop out of holes on the landscape.
Mrs. Chapman. Tabs (Block Categories) Commands Available to use Script Area where you type your code Sprite Stage All sprites in this project.
Learn… Create… Program. Manipulation of Multiple Media Connects with youth culture Scratch is a new graphical programming language designed to support.
Racing Car Game Using the keys to control a sprite.
Extending the Pong Example Barb Ericson Georgia Tech June 2011.
Digital Art in Scratch part 1 Barb Ericson Georgia Tech Oct 2010.
Mr. Wortzman. Tabs (Block Categories) Available Blocks Script Area Sprite Stage All sprites in this project.
Fish Chomp. The screen where you can see what happens when you play your game is called the STAGE. The SCRIPT BANK is where the types of instructions.
Code Club Session 2 Dance Party. What will we learn ?  How to change the background  How to create animations  How to make objects talk to each other.
Introduction to Scratch!
How to make Space Invaders
Using MIT Scratch for Programming and Control Exercise 3 Ball Game Year 9 ICT Autumn Term 2007.
How to make a Shooting Target game in Scratch!. WE ARE GOING TO MAKE A TARGET GAME. This game will have: A Target that will move when clicked. A Timer.
2015 CSE/EGR Summer Camps 1 Computer Science Concepts 1. What is an algorithm? 2. Binary information coding 3. Programming concepts via Scratch Designed.
GAME:IT Helicopter Objectives: Review skills in making directional sprites Create objects that shoot and destroy for points Create random enemies on the.
Geometry. The screen where you can see what happens when you play your game is called the STAGE. The SCRIPT BANK is where the types of instructions are.
Digital Art in Scratch part 1 Barb Ericson Georgia Tech May 2011.
Fish Chomp. The screen where you can see what happens when you play your game is called the STAGE. The SCRIPT BANK is where the types of instructions.
Unit 3 Music and Sound Evangel College S.2 ICT.
Creating a Simple Game in Scratch Barb Ericson Georgia Tech June 2008.
Game Maker Galactic Mail Advanced Group: Complete Galactic Mail, then start developing an independent project.
Image #1 Getting Started
Scratch Another computer programming language Developed by MIT in 2003
Making a Sprite Dance Barb Ericson Georgia Tech June 2011.
Create a Halloween Computer Game in Scratch Stephanie Smullen and Dawn Ellis Barb Ericson October 2008.
Computer Programming Modeling a Passive Solar Home.
Variables and Random Numbers Computer App Session 4.
Marble Racer. The screen where you can see what happens when you play your game is called the STAGE. The SCRIPT BANK is where the types of instructions.
Using MIT Scratch for Programming and Control Exercise 1 Creating movement Year 11 DTG 2012.
Cloning in Scratch Computer App Session 6. Cloning in Scratch Learning Objectives: I will clone sprites in Scratch to create copies of an existing sprite.
Using MIT Scratch for Programming and Control Exercise 4 – Cat and Dog game Year 9 ICT Autumn Term 2007.
Programming a Shooter Game Design.
Scratch for Interactivity Dr. Ben Schafer Department of Computer Science University of Northern Iowa.
Get Going On ….. Load the word file ‘Glossary’ and complete it. You will have homework today.
How to create a basic game in Scratch. The Scratch Stage The Scratch stage is 480 pixels wide and 360 pixels high x increasesx decreases.
1 CSC 221: Computer Programming I Fall 2009 Introduction to programming in Scratch  animation sprites  motion, control & sensing  costume changes 
Scratch Part 2 – Character Commands. What does a command do?  Commands in programming allow an object whatever it is to do something. In the case of.
Computer Programming Modeling a Passive Solar Home.
Creating a Simple Game in Scratch Barb Ericson Georgia Tech May 2009.
Introducing Scratch Learning resources for the implementation of the scenario
Game Maker Tutorials Introduction Clickball IntroductionClickball Where is it? Shooting Where is it?Shooting.
School of Computer Science Space School 2015 Programming a Lunar Lander Game.
Index Background Costumes Making object walk smoothly Controlling an object with the keyboard Control an object with the mouse Changing costume when hit.
Scratch Helicopter Game
Create a Halloween Computer Game in Scratch
Scratch for Interactivity
Interacting Sprites Module 3: Investigation 1
© A+ Computer Science -
Understanding the Geometric Shape Code
Creating a Tank Game in Scratch
Scratch for Interactivity
Lesson 1 Introduction to Scratch Basic blocks
Flappy bird Demo: Lesson 5 Flappy bird Demo:
Image #1 Getting Started
Game Over Module 4 Lesson 2.
Game development using Scratch
Creating a Simple Game in Scratch
CSC 221: Introduction to Programming Fall 2018
Catch Game Cards Catch Game Cards Make a Card Go to the Top Fall Down
Presentation transcript:

We will be creating a spaceship that simulates real movements in space. The spaceship will fire a laser beam that can destroy targets. The spaceship will be able to pass through the edges of the screen Controls:  Up arrow will provide forward thrust  Right and left arrows will turn the ship

Since we are going to be creating a spaceship, set the stage background to be stars. It can be found in the Nature folder.

Draw a Spaceship sprite. Make sure you point the ship to the right. Make two costumes, one with flames and one without.

Variables Create the following Variables: (For this sprite only) DirectionChange NewX NewY Thrust

We need to create three event scripts: Up Arrow Right Arrow Left Arrow We will begin with the Up Arrow script. when Space Key pressed Drag a when Space Key pressed block to the Ship sprite script area and change it to up arrow. repeat until when up arrow key pressed Connect a repeat until block to the when up arrow key pressed block.

not repeat until Under Operators, drag an not operator block into the repeat until block.

key up arrow pressed? not Go to Sensing and put a key up arrow pressed? block into the not block.

next costume repeat until Put a next costume block in the repeat until block.

change DirectionChange by repeat until Put three change DirectionChange by blocks into the repeat until block. Change the variables to Thrust, NewX, and NewY

change Thrustby Put a value of 0.1 in the change Thrust by block.

multiplication Drag two multiplication operator blocks into the script area.

Thrust multiplication Put the Thrust variable block into the left side of both multiplication operator blocks.

sqrt of 10 multiplication Put a sqrt of 10 block on the right side of each multiplication block.

sqrt of 10sin of 10 Change one of the sqrt of 10 blocks to sin of 10

sqrt of 10cos of 10 Change the other sqrt of 10 block to cos of 10

Thrust * sin of 10change NewX by Put the Thrust * sin of 10 block into the change NewX by block.

Thrust * cos by 10change NewY Put the Thrust * cos by 10 block into the change NewY block

direction sin ofcos of Go to motion and put a direction block into the sin of and cos of blocks.

switch to costume NoFlames repeat until not key up arrow pressed? Put a switch to costume NoFlames block underneath the repeat until not key up arrow pressed? block.

set Thrust to 0 switch to costume NoFlames Put a set Thrust to 0 block under the switch to costume NoFlames block.

Now that we have finished the Up Arrow scripts, we need to do the Right Arrow script and Left Arrow script. when right arrow key pressed Create a when right arrow key pressed block and connect the blocks as shown in the image to it.

when right arrow key pressed when right arrow key pressed Create a duplicate of the when right arrow key pressed blocks by right clicking the when right arrow key pressed block and clicking duplicate. Alter this newly duplicated block so it matches the image to the right.

Up, Right, and Left represent the user controls for the ship. However, the ship will not move until we put the Action code for the computer to take the commands and translate them to movement. when Green Flag clicked Create a when Green Flag clicked block and connect the specified blocks as shown in the image to the right.

when Green Flag clicked Create another when Green Flag clicked block and connect the blocks as shown in the image to the right. This will reset the variables and allow the ship to pass through the edges of the screen.

Click the Green flag and test your ship!

We want a laser beam to travel to a target and then stop traveling when it hits a target. We also want the laser beam to go back to the ship and hide when not being fired. Click Paint New Sprite and draw a laser beam.

Create the variables as shown in the image to the right for the Laser sprite.

when Green Flag clicked Create a new when Green Flag clicked block and connect the blocks as shown in the image to the right to it. This allows the laser beam to travel a set distance and check its status (fire or not fired)

when space key pressed Create a new when space key pressed block and connect the blocks as shown in the image to the right to it. This makes it so when the laser is fired, it’s fired in the same direction the ship is facing.

Test your laser beam!

Our final step is to create targets for our space ship to shoot at. Create a new Sprite. For this newly created sprite, create a new when Green Flag clicked block and connect the blocks as shown in the image to the right. This will glide the target sprite around in random directions.

Complete the when Green Flag clicked block by connecting the additional blocks as shown in the image to the right. This will now cause the sprite to disappear and re-appear if it is hit by the laser beam.

Congratulations! You’ve finished creating your own space ship game. See the next slide for challenges.

Play a sound every time the laser beam is fired and whenever the laser successfully hits a target. Add a score feature that increments when the laser beam hits the target and decrements when the target hits the space ship. Add more targets Implement your own creative features!