Intro CS – Keyboard and mouse input Lesson Plan 7.

Slides:



Advertisements
Similar presentations
A Christmas Scratch game
Advertisements

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.
Creative Commons Attribution 3.0 creativecommons.org/licenses/by/3.0 Key Abstractions in Game Maker Foundations of Interactive Game Design Prof. Jim Whitehead.
CATCH SCRATCH! Programming from Scratch. Remember Scratch?
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.
Every week: Sign in at the door If you are new: Fill in Registration Form Ask a Mentor how to get started Make sure you are on the Athenry Parents/Kids.
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.
Game Maker Galactic Mail Advanced Group: Complete Galactic Mail, then start developing an independent project.
Intro CS – Screens and Variables Lesson Plan 9. Goals  Using sprites as full screens (Start screen, Game over)  Using layering to control ordering of.
Today we are learning to: Understand how actions and events control our game. Completing the catch the clown game – making a room – adding music Gather.
Using MIT Scratch for Programming and Control Exercise 1 Creating movement Year 11 DTG 2012.
Using MIT Scratch for Programming and Control Exercise 4 – Cat and Dog game Year 9 ICT Autumn Term 2007.
Programming a Shooter Game Design.
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.
Randomising the behaviour of Sprites Games Programming in Scratch.
Lives and Scoring Games Programming in Scratch. Games Programming in Scratch L2 Lives and Scoring Learning Objectives Define a variable Understand the.
ICT/COMPUTING RULES Only use software allowed by the teacher
Intro CS – Costumes and Variables Lesson Plan 6. Goals  Understanding Costumes, Ordering, Naming  Switching Costumes with Switch and Next  Using Variables.
Intro CS – Broadcasting Messages Lesson Plan 8. Goals  Using broadcasting to track events across sprites and act on them.
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.
Game Maker Tutorials Introduction Clickball IntroductionClickball Where is it? Shooting Where is it?Shooting.
Index Background Costumes Making object walk smoothly Controlling an object with the keyboard Control an object with the mouse Changing costume when hit.
Scratch Programming Cards
Greenfoot.
Intro CS – Costumes and Variables
Movement Game Design (Scratch).
Intro CS – Screens and Variables
Games Programming in Scratch
Scratch for Interactivity
Intro CS – Loops, making animations & films
Exploring Mathematical Relationships Module 5: Investigation 3
Intro CS – Loops & Creating Shapes
Building with Numbers Module 4: Investigation 3
Madlib-Input, Strings, and Lists in Scratch
Game Maker Intro to Programming Game Maker Pop Quiz (Both Groups)
How to work with your sprite
© A+ Computer Science -
Keyboard Input.
Graphing Linear Equations
Intro CS – Probability and Random Numbers
Year 11 DTG Intermediate Using MIT Scratch for Programming and Control Exercise 2 Controlling movement with the keyboard Year 11 DTG Intermediate.
Intro CS – Keyboard and mouse input
Randomising the behaviour of Sprites
Intro to Programming with Scratch
Scratch – Simple Programming
Programming – Touch Sensors
Loopy Motion Control.
CS 106A, Lecture 14 Events and Instance Variables
Creating Variables Output Logic flow Operators (More) Basic blocks
Module 5 Lesson 3 Extreme Scratch Cards
Scratch – Simple Programming
Looping and Random Numbers
YEAR 7 PROGRAMMING SCRATCH & E-SAFETY UNIT WRAPPER
An intro to programming concepts with Scratch
Mod 2 Lesson 2 Repeating with loops
ICT Gaming Lesson 3.
Flappy bird Demo: Lesson 5 Flappy bird Demo:
Game Maker Intro to Programming Game Maker Pop Quiz (Both Groups)
Building a Game in Scratch
Game Over Module 4 Lesson 2.
Explain what touch develop is to your students:
Creating a Simple Game in Scratch
Primary School Computing
Microsoft Office Word 2003 Lesson 1
Presentation transcript:

Intro CS – Keyboard and mouse input Lesson Plan 7

Goals  Understanding Keyboard and Mouse Input  Single key press, and held down state  Mouse position and mouse click  Controlling sprites using the keyboard or mouse

Objectives  Students are introduced to the topic and given examples of keyboard and mouse input  Students are given real problems to code and solve using the keyboard and mouse  Results are demonstrated through demos of running code and displayed results

Pre Requisites  Understanding of Scratch, Sprites, Animation, IF, hit detection, looping

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

Lesson Description  Introduce Scratch blocks for Key N pressed, MouseX, MouseY, Mouse down  Give examples/demo of handling key presses, and key held down  Give examples/demo of handling mouse movement and click  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: Animation, x position, y position of sprites  Give exercises for in class practice (move a sprite based on keyboard input)  Direct movement on key press, key held, OR, constant movement with key input to change direction  Direct movement of sprite to current mouse position  Chase movement of sprite to follow (move towards) mouse position  Walk the room answering questions, looking over the shoulder, asking questions, etc.

Closure/Conclusion  Discussion  How do you apply this to your Galaga project ship?  What other kinds of games can you make with keyboard and mouse input?  Summary  Key press and key down handling  Mouse input  Ask questions on what is confusing or needs more time/practice

Keyboard and Mouse Input Lesson 7

Example Demo  Today we’re going to learn more about keyboard and mouse inputs (how to get your sprite to move on command).  We’re also going to revisit the concept of variable and see how we can keep score.  Demo CheesePuffGirl mini-game

Variables  What is a variable?  Stores a value that can be reused in code.  Pros: if you want to change a number, you will only have to change it in one place.  Example how to create a variable and use it.

Variables Continued…  How do you create a variable?  How do you deleted a variable?  How do you show a variable on the screen?  How do you set the value of the variable?  How can you increment/decrement the value of a variable?  What do these two variable blocks do? (Same as the third bullet)

Keyboard Input  We’ve already seen:  What does this do?  What if we wanted to move a sprite to the left with our left arrow key?  Right arrow?  Up/Down arrow?

Mouse Input  We’ve already seen this control:  What does it do?  What about this one?  This is how we can have sprites follow the mouse.  What does this control block do?  What about these blocks?  Show the x-coordinate of the mouse  Show the y-coordinate of the mouse  Condition statement to check if the mouse was clicked.

Example Demo  Show how to create the CheesePuffGirl Demo

Daily project  By the end of class create a mini-game where a sprite chases other sprites (either by using keyboard or mouse inputs) and on clicking the chased sprites, the score is increased by 1 point.  Worth 10 points total. Save your project:  File format: LP7-YourLastName_YourFirstName.sb Grade Breakdown – Must IncludePoints Sprite movement on either keyboard or mouse input (must move correctly in all 4 directions) 2 (1/2 for each direction) Contains at least two other moving sprite (besides the one being controlled by keyboard/mouse input) 2 Chased sprites must bounce off screen edges1 Chased sprites have random starting position1 Chased sprites have random movement direction1 On mouse-click the chased sprite must hide and reappear later1 Score is kept correctly2

Summary  Discussion  How do you apply this to your Galaga project ship?  What other kinds of games can you make with keyboard and mouse input?  Summary  Key press and key down handling  Mouse input  Ask questions on what is confusing or needs more time/practice