Games Programming in Scratch

Slides:



Advertisements
Similar presentations
Sprite-visual object (actor on the stage) Scripts- Tells actors (sprites) what to do.
Advertisements

Summer Computing Workshop. Introduction to Variables Variables are used in every aspect of programming. They are used to store data the programmer needs.
A Christmas Scratch game
Write Your First Computer Game!. Coding: Programming Languages Just like you can speak Chinese to someone who understands Chinese to tell them what to.
Mrs. Chapman. Tabs (Block Categories) Commands Available to use Script Area where you type your code Sprite Stage All sprites in this project.
Scratch Programming Session 9 of 10 Review elements to use in stories, games, etc.
SCRATCH This Design Notebook belongs to:. 3 What are the different ways you interact with computers? List your answers here: 5.
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.
Scratch the Cat. Object Oriented Programing Writing computer programs Based on Objects Instead of Actions Based on Data Instead of Logic.
Ms. Deveny Second Semester  Introductions  Interview your table partner  Name  Why taking CPD  Computer experience  Favorite game?
Spiral Rider PAGE 1. Set Up Scene 1.Add Stage-underwater scene 2.Add crab sprite 3.Add two fish sprites PAGE 2.
Learning the skills for programming Advanced Visual Programming.
2015 CSE/EGR Summer Camps 1 Computer Science Concepts 1. What is an algorithm? 2. Binary information coding 3. Programming concepts via Scratch Designed.
1 Understand how to use Scratch to: – Animate a sprite – Add sound to your script – Use the forever command to create a loop Lesson 2: Learning Objectives.
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.
Using Lists Games Programming in Scratch. Games Programming in Scratch Extension – Using Lists Learning Objectives Create a temporary data store (list)
Introduction to Computer Programming - Project 2 Intro to Digital Technology.
Programming a Shooter Game Design.
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.
University Learning in Schools Computing Games Programming Lesson 5.
I have used Scratch, to program a guide to internet safety. This is done by using QR codes to make it more interactive and interesting for people playing.
Lives and Scoring Games Programming in Scratch. Games Programming in Scratch L2 Lives and Scoring Learning Objectives Define a variable Understand the.
Making a Flappy Birds Game PART 2 – MAKING THE BIRD FLAP AND FALL – AND DEVELOPING THE GAME FURTHER (ADDING ADDITIONAL CHARACTERS, GOODIES, ENEMIES AND.
School of Computer Science Space School 2015 Programming a Lunar Lander Game.
Scratch Programming Cards
Scratch Helicopter Game
Movement Game Design (Scratch).
Create a Halloween Computer Game in Scratch
Customise & Explain your game
Broadcasting (Adding a new level)
Programming & Scratch.
Scratch for Interactivity
Exploring Mathematical Relationships Module 5: Investigation 3
Building with Numbers Module 4: Investigation 3
Scratch Unit Overview We are going to look at computer programming and how to create your very own computer game The piece of software we will be using.
Randomising the behaviour of Sprites
Interacting Sprites Module 3: Investigation 4
Games Programming in Scratch
Diamond Hunt Mock Programming Project.
Scratch – Simple Programming
Computing Year 7 - Unit 2 Programming Basics Scratch Basics.
Scratch for Interactivity
Loopy Motion Control.
Introduction to Object-Oriented Programming
Explain what touch develop is to your students:
The One Where You Scratch
Introduction to TouchDevelop
For -G7 programing language Teacher / Shamsa Hassan Alhassouni.
Scratch – Simple Programming
Sensing and Variables.
Go to =>
BBC Microbit.
Tonga Institute of Higher Education
Lesson Objectives To understand how to make sprites interact
Go to =>
Go to =>
ICT Gaming Lesson 3.
Year 3 (National Numeracy Strategy) (Based on DFEE Sample Lessons)
Building a Game in Scratch
Game Over Module 4 Lesson 2.
Exploring Computer Science Lesson 4-12
Sensing and Variables.
Explain what touch develop is to your students:
Creating a Simple Game in Scratch
Exploring Computer Science Lesson 4-12
Scratch 7B IT 1.
Scratch – Simple Programming
Presentation transcript:

Games Programming in Scratch Lives and Scoring Games Programming in Scratch

Learning Objectives: We are learning to… Understand and use variables in a program Annotate a program with comments to explain scripts

Today’s Lesson Learning Objectives: Understand and use variables in a program Annotate a program with comments to explain scripts Excellence I can extend my program to use variables of my own idea and fully explain scripts I have created using comments Developing I can use multiple variables in a program and add comments to explain how they are used Secure I can describe the purpose of variables and use them in a program following instructions given Foundation I can with support use variables in a program

But, at the moment.. What happens when one sprite touches another one? So far… Planned idea for our game Added ‘Sprites’ that move in Scratch Main Character that moves with arrow keys 2nd Character that moves on it’s own (Don’t worry, we will change these to your own chosen characters later!) But, at the moment.. What happens when one sprite touches another one?

What ‘should’ happen when one sprite touches another? When? Forever / When clicked / On a key-press Condition? If touching… / If time exceeds… / If x = y… What do you want to happen? Change colour / end game / go back to start

If Spaceman touches Asteroid then Game Over Looping and Selection The easiest possible answer might be… If Spaceman touches Asteroid then Game Over If... Then Forever loop The ‘loop’ is used here to keep checking ‘if’ the Astroid is touching the spaceman, and ‘if’ it is, ‘then’ it says “Game Over” and stops then game.

Looping and Selection Loops and Selection can be used to do LOTS of different things in program (and a game). Repeat sounds or movement Repeat counting something Check if touching something Check a score or lives And loads loads more things!

Modifying your game Today’s Task 1 Open your game from last lesson For ‘Main Character’, change your ‘Movement’ controls so that they use ‘Forever’ and ‘If…then’ blocks ---------------------------------------------------------------- Delete the original ‘movement events’ (e.g. up, down, left, right) Add these ‘blocks’ instead NOTE!: This will make the ‘up arrow’ work. You need to extend it to add the other directions!

What is a ‘Variable’? A variable represents a location in memory This location is used to hold a value which you assign to it. You can change the value in the program. You give a variable a name, which you use to refer to it, for example to set an initial value, change, use or output the value. For example: A variable called “Lives” might hold the value “3”. Set Lives = 3

Variables

Writing the algorithm Discuss in pairs! 2 mins What are the steps required to set the starting value of lives and reduce that by one when one sprite touches another?

Programming Lives When game starts Start with 3 lives Check constantly If.. you are touching an enemy Subtract 1 life

Adding ‘Lives’ to game using Variable Today’s Task 2 Adding ‘Lives’ to game using Variable Create a ‘Variable’ under Data, and call it ‘Lives’ Then add the following blocks to your game Change this to the whatever your ‘Enemy’ is called Think about the Algorithm! When game starts Start with 3 lives Check constantly If.. you are touching an enemy Subtract 1 life Test it out… Does it work? What is it doing?

NEXT: Scoring What will these blocks do in your game? What makes you earn points in the game? Collecting something? Beating a timer? Solving a problem? Use of Show and Hide blocks for items to collect What will these blocks do in your game?

Adding item to ‘pick-up’ (collect) Today’s Task 3a Adding item to ‘pick-up’ (collect) Add a new sprite from the library for something that you are going to ‘collect’ (e.g. Apple, Coin)

Adding ‘Score’ to game using Variable Today’s Task 3b Adding ‘Score’ to game using Variable Create a ‘Variable’, and call it ‘Score’ Then add the following blocks to your game to the object you want to collect! e.g. Coin, Apple Test it out… Does it work? What is it doing?

Variable display settings Show or Hide Integer variable Slider Large or Small (With or without label) Moveable

Ending the game How could you add an ‘ending’ to the game? What should make the game stop? Could be a running of ‘time’ or ‘lives’ maybe? We will look at the ‘lives’ option. What would be the steps (algorithm) for using ‘lives’ to stop the game? When game starts Check constantly If.. Lives = 0 Say message “Game Over!” Stop all game

Add ‘Ending’ to the game Today’s Task 3b Add ‘Ending’ to the game Add the following blocks to your ‘Main Character’ Try it out! Does it work?

Adding Comments in Scratch Comment boxes in Scratch help you, and others, understand your code at a later date Commenting is good practice for professional programmers