Intro CS – Broadcasting Messages Lesson Plan 8. Goals  Using broadcasting to track events across sprites and act on them.

Slides:



Advertisements
Similar presentations
Summer Computing Workshop. Introduction to Variables Variables are used in every aspect of programming. They are used to store data the programmer needs.
Advertisements

Understanding an Apps Architecture ASFA Computer Science: Principles Fall 2013.
Code Club Session 3 Shark Eats Fish. Picture of finished product here.
Scratch Programming Session 9 of 10 Review elements to use in stories, games, etc.
1 Session-I & II CSIT-121 Spring 2006 Session Targets Introducing the VC++.NET Solving problems on computer Programming in C++ Writing and Running Programs.
Bellevue University CIS 205: Introduction to Programming Using C++ Lecture 4: Enhancing Your Program.
Write an equation to represent Simon’s exercise program. The equation should be in slope- intercept form.
Madlib-Input, Strings, and Lists in Scratch Barb Ericson Georgia Tech June 2011.
Bug Session Two. Session description In this session the use of algorithms is reinforced to help pupils plan out what they will need to program on their.
Scratch Understanding some programming techniques using Scratch Resetting, Parallelism and Events.
INTRODUCTION TO SCRATCH. About Me Resources Scratch Website Learn Scratch Washington-Lee Computer.
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.
A Scratch tutorial. Description: You have 6 bullets to shoot at 2 targets. Every time you hit any of them you get two extra bullets but the targets get.
Meet Me on Mars Lesson 7 Variables and Messages. Events and Variables 1. Click the _________ button 2. When ________ clicked, set ______ to ____ 3. Now,
Programming 3/16/15 3/16 Looping, Arrays, Objects 3/17 Object-Oriented Design and Becoming a better Programmer 3/18 Introduction of Conditionals 3/19 Introduction.
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.
Learning the skills for programming Advanced Visual Programming.
CoderDojo Roscommon. Today's Ninja Challenge: Create a GhostBuster Game Like This.
Moving Around in Scratch The Basics… -You do want to have Scratch open as you will be creating a program. -Follow the instructions and if you have questions.
Summer Computing Workshop. Introduction  Boolean Expressions – In programming, a Boolean expression is an expression that is either true or false. In.
QUIZ! You can bring notes you took during class Any concept/topic we’ve covered may be up for grabs.
Scratch Programming Lesson 4 Question asking and answering.
GAME:IT Helicopter Objectives: Review skills in making directional sprites Create objects that shoot and destroy for points Create random enemies on the.
Variables. Todays Lesson  In todays lesson you are going to:  Learn to use variables  Learn to ask for user input  Learn to save the users response.
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.
Advanced Work with Embedded and Summative Assessment Dr. Steve Broskoske Misericordia University EDU 533 Computer-based Education.
Intro CS – Screens and Variables Lesson Plan 9. Goals  Using sprites as full screens (Start screen, Game over)  Using layering to control ordering of.
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.
Introduction to Computer Programming - Project 2 Intro to Digital Technology.
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.
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.
Making a Flappy Birds Game PART 2 – MAKING THE BIRD FLAP AND FALL – AND DEVELOPING THE GAME FURTHER (ADDING ADDITIONAL CHARACTERS, GOODIES, ENEMIES AND.
Instructions Get the Jeopardy Template working 1)You will need 25 questions and 25 answers. 2)After carefully considering your presentation content, create.
Intro CS – Costumes and Variables Lesson Plan 6. Goals  Understanding Costumes, Ordering, Naming  Switching Costumes with Switch and Next  Using Variables.
Intro CS – Logic & Operators Lesson Plan 5. Goals  Students can explain basic logical operators  AND, OR, NOT  Students can create truth tables for.
Intro CS – Probability and Random Numbers Lesson Plan 6a.
Intro CS – Loops, making animations & films Lesson Plan 3.
Learning to use a ‘For Loop’ and a ‘Variable’. Learning Objective To use a ‘For’ loop to build shapes within your program Use a variable to detect input.
Intro CS – Keyboard and mouse input Lesson Plan 7.
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
Intro CS – Costumes and Variables
Development Environment
Intro CS – Screens and Variables
Broadcasting (Adding a new level)
Intro CS – Loops, making animations & films
Exploring Mathematical Relationships Module 5: Investigation 3
Intro CS – Loops & Creating Shapes
Madlib-Input, Strings, and Lists in Scratch
Intro CS – Probability and Random Numbers
Intro CS – Keyboard and mouse input
Scratch – Simple Programming
Explain what touch develop is to your students:
Scratch for Interactivity
Scratch Programming Intro
Module 5 Lesson 3 Extreme Scratch Cards
Explain what touch develop is to your students:
Scratch – Simple Programming
Lesson 1 Introduction to Scratch Basic blocks
(More) Basic blocks Broadcasting messages
Lesson Objectives To understand how to make sprites interact
Game Over Module 4 Lesson 2.
Explain what touch develop is to your students:
Creating a Simple Game in Scratch
Introducing Scratch and Creating Sprite
Primary School Computing
Presentation transcript:

Intro CS – Broadcasting Messages Lesson Plan 8

Goals  Using broadcasting to track events across sprites and act on them

Objectives  Students are introduced to the topic and given examples of broadcasting messages, and with other sprites acting on receipt of those messages  Students are given real problems to code and solve with message/event broadcasting  Results are demonstrated through demos of running code and displayed results

Pre Requisites  Basic Understanding of Scratch, Sprites, animation, hit detection, keyboard/mouse input

Materials  Slides with examples (or present on whiteboard)  PCs with development environments installed

Lesson Description  Students gain understanding and practice in broadcasting messages, and using blocks to act on those messages (When I receive “message”)  Give sample problems to solve in class  Students practice and extend examples to their own wishes  Students present their solutions, typically F2F with the instructor(s) at their desk  Students analyze their and others’ solutions for bugs

Lesson Procedure  Review previous lessons: Hit detection, Input  Introduce Broadcasting  On hit detection  On Mouse click  To control app state  Give exercises for in class practice (input speed and angle of shot, fire button to broadcast message to start angry bird launch, hit detection to broadcast message to explode target). No or Constant Gravity used.  Walk the room answering questions, looking over the shoulder, asking questions, etc.

Closure/Conclusion  Discussion  How do you apply this to your Galaga project?  Summary  How Broadcast can be used to make sprites react to external events  Ask questions on what is confusing or needs more time/practice

Hit Detection and Broadcasting Lesson Plan 8

What is Broadcasting?  Broadcasting is a message that is sent throughout the whole Scratch program, which activates receiving scripts.  What can it be used for?  On hit detection – do some action after hit detected  On Mouse click – do some action after mouse down detected  To control app state – do some action when your program goes from one state to another

Broadcasting Related Blocks  Broadcast ()  Makes the specified broadcast and has no further effect  Broadcast () and Wait  Makes the specified broadcast and freezes its script until all of the receiving scripts have finished  When I Receive ()  Stays inactive until it receives the specified broadcast. Once it has been received, the script goes into action and ends once it has finished but can be stored more than once.

Additional Information  Scratch cannot limit where a broadcast can go  Work around for this is to use a global variable and private variable for each sprite:

Example Demo  Today we’ll be learning how to create an Angry Bird- like mini-game that uses the concept of Broadcasting and hit detection.  AngryShark.sb  Demo how to create the program

Daily project  If you want the challenge, work through the gravity part yourself (don’t use the sample provided)  Finish the AngryShark mini-game.  Worth 10 points total. Save your project: Grade Breakdown – Must IncludePoints Score is kept correctly1 When the AngryShark touches the edge, the correct actions take place (see comments in code). 2 When the AngryShark touches the rock, the correct actions take place(see comments in code). 2 When the AngryShark touches the Fish, the correct actions take place (see comments in code). 4 Reset command is correctly implemented.1  Extras if you finish early:  Make the target move, making shot timing important  Use the mouse position to determine the shot angle and speed, and the mouse button to fire (like Angry Birds)

Summary  Discussion  How do you apply this to your Galaga project?  Summary  How Broadcast can be used to make sprites react to external events  Ask questions on what is confusing or needs more time/practice