Broadcasting (Adding a new level)

Slides:



Advertisements
Similar presentations
Create a Simple Game in Scratch
Advertisements

Create a Simple Game in Scratch
Code Club Session 3 Shark Eats Fish. Picture of finished product here.
Write Your First Computer Game!. Coding: Programming Languages Just like you can speak Chinese to someone who understands Chinese to tell them what to.
Scratch Programming Session 9 of 10 Review elements to use in stories, games, etc.
Racing Car Game Using the keys to control a sprite.
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.
Using MIT Scratch for Programming and Control Exercise 6 – Creating a Scratch Packman Year 9 ICT Autumn Term 2007.
Scratch Programming Lesson 2 First glance to programming logic.
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.
Creating a Simple Game in Scratch Barb Ericson Georgia Tech June 2008.
Create a Halloween Computer Game in Scratch Stephanie Smullen and Dawn Ellis Barb Ericson October 2008.
Introduction to Computer Programming - Project 2 Intro to Digital Technology.
How to create a sprite Delete a sprite (e.g. the cat) by right clicking on it and choosing delete. Go to the bottom right hand corner of the stage and.
Scratch for Interactivity Dr. Ben Schafer Department of Computer Science University of Northern Iowa.
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.
Lives and Scoring Games Programming in Scratch. Games Programming in Scratch L2 Lives and Scoring Learning Objectives Define a variable Understand the.
Introduction to Scratch We will be using the Scratch Environment today, so please log in to the Scratch website (scratch.mit.edu)
Creating a Simple Game in Scratch Barb Ericson Georgia Tech May 2009.
School of Computer Science Space School 2015 Programming a Lunar Lander Game.
LEARNING SCRATCH: PRESENTATION 4 PRESENTATION 1: GETTING STARTED 1 Broadcast Messages Today, we'll learn how to get our sprites to act together, and build.
Scratch Programming Cards
Movement Game Design (Scratch).
Create a Halloween Computer Game in Scratch
Customise & Explain your game
Commands in Scratch.mit.edu
Module 1: Investigation 2 Repeating and Alternating Patterns
Games Programming in Scratch
Scratch for Interactivity
Exploring Mathematical Relationships Module 5: Investigation 3
Building with Numbers Module 4: Investigation 3
Games Programming in Scratch
Scratch 7B IT1.
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.
How to work with your sprite
Randomising the behaviour of Sprites
Interacting Sprites Module 3: Investigation 4
Games Programming in Scratch
Diamond Hunt Mock Programming Project.
Today's Ninja Challenge: Make Better GhostBuster Game
Scratch – Simple Programming
Scratch for Interactivity
Scratch Programming Intro
Stopwatch Cards Stopwatch Cards
Learn… Create… Program
Scratch – Simple Programming
Log onto a computer first then ….
Sensing and Variables.
Areas of the SCRATCH 2 Screen
Go to =>
Recap the basics Lesson 1.
Hour of Code.
Stopwatch Cards Stopwatch Cards
Go to =>
Stopwatch Cards Stopwatch Cards
Game Over Module 4 Lesson 2.
Introduction to Snap Programming
Recap the basics Lesson 1.
Stopwatch Cards Stopwatch Cards
Game development using Scratch
Sensing and Variables.
Creating a Simple Game in Scratch
Stopwatch Cards Stopwatch Cards
Scratch 7B IT 1.
Stopwatch Cards Stopwatch Cards
Scratch 7B IT 1.
Scratch – Simple Programming
Presentation transcript:

Broadcasting (Adding a new level) Games Programming in Scratch

Today’s Lesson Learning Objectives: Understand the purpose of repeat loops and procedures (broadcasts) Use a broadcast in your own Scratch program Excellence I can extend my program with additional features of my own ideas, making confident use of looping and broadcasts Developing I can make use of broadcasts for different features within my program and explain the benefits of their use Secure I can make use of loops and broadcasts within my program following examples given, as well as describing their basic purpose Foundation I can make use of loops in my program with support and describe why they are used

What is better? Both of the scripts below do the same thing, they draw a square shape, but which is better… This... or This... WHY?

Efficiency of Code (Using ‘Loops’) Used to repeat commands automatically Can specify how many times or make it happen forever Shorter code = Smaller program = Better to look at + Easier and quicker for computer to run

Dance Efficiency of Code (Using ‘Procedires’) Here’s another question… Why is… Dance Better than… Left foot forward Left foot back Right foot forward Right foot back Raise arms Clap Lower arms

Efficiency of Code (Using ‘Procedures’) Can be called or used as many times as needed without having to write out the whole ‘Dance’ instructions each time And again… Shorter code = Smaller program = Better to look at + Easier and quicker for computer to run

Procedures or ‘Broadcasting’ Look at the following example: When does the code block on the right run? It runs all of these actions in the ‘Procedure’ each time the sprite touches the ‘Shark’

Concurrent Events Using a broadcast can also make two things happen at the same time Both blocks of code will run concurrently (at same time!)

Adding ‘Next Level’ using Broadcast Today’s Task 1 Adding ‘Next Level’ using Broadcast Use a ‘Broadcast’ to create more levels in your game… 1) Create a variable called ‘Level’ On the ‘Main Character’ 2) Add events to ‘reset’ the level to 1 when game starts 3) Add a ‘forever’ loop to check when the Score has got to 10 (or whatever number you want) before ‘Broadcasting’ Next Level event

Adding ‘Next Level’ using Broadcast Today’s Task 1 Adding ‘Next Level’ using Broadcast Use a ‘Broadcast’ to create more levels in your game… On the ‘Enemy’ 4) Add events to ‘change’ the level by 1 and reset score to 0 when it receives ‘Next Level’ broadcast To make the game get gradually harder, you can… 5) Change the ‘move 10 steps’ of the enemy, and replace it with the ‘Level’ variable number (so that as the levels go up, so does the speed of the enemy!)

Doing more things with ‘Next Level’ Broadcast Today’s Task 2 Doing more things with ‘Next Level’ Broadcast There are more things you can do when the ‘Next Level’ broadcast message is sent within the game Stage – Make the background change each time you go up a level. Enemy – Make an extra ‘clone’ enemy every time you go up a level Main character – Make the main character do something (like flash/change costume) when go up a level

Today’s Task 3 Comment your Code

Finding Ideas for other ‘Broadcast’ uses How do other games in the Scratch library make use of Broadcasting? Type broadcast into the search box and look at the code using the See Inside button. How could you build some of these ideas into your own game?

Broadcast – Your own idea! Today’s Task 4 Broadcast – Your own idea! Broadcasts can be used for lots of different things. Try to now add another broadcast to your game for a different idea… You could use it to: Change the colour of a sprite temporarily (Looks) Change the costume (Look under the Costume tab) Change the background to create a new level