QUIZ! You can bring notes you took during class Any concept/topic we’ve covered may be up for grabs.

Slides:



Advertisements
Similar presentations
First of all – lets look at the windows you are going to use. At the top you have a toolbar, with all your various tools you can use when customising your.
Advertisements

Create a Simple Game in Scratch
Summer Computing Workshop. Introduction to Variables Variables are used in every aspect of programming. They are used to store data the programmer needs.
Create a Simple Game in Scratch
Mission Technology Introduction to Scratch! June 2007.
Scratch for Storytelling Dr. Ben Schafer Department of Computer Science University of Northern Iowa.
Lets Play Catch! Keeping Score in Alice By Francine Wolfe Duke University Professor Susan Rodger May 2010.
Harry Potter Scratch Game
Adventures in Animation Harry Potter Game Pranali Choubal Kunal Shaw Barb Ericson Dec 2007.
A Christmas Scratch game
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.
Mrs. Chapman. Tabs (Block Categories) Commands Available to use Script Area where you type your code Sprite Stage All sprites in this project.
Session 5 of 10 Review + Multiple Sprites
1 An introduction to programming concepts with Scratch.
What is Scratch? Scratch as Logo Dr. Ben Schafer Department of Computer Science University of Northern Iowa.
INTRODUCTION TO SCRATCH. About Me Resources Scratch Website Learn Scratch Washington-Lee Computer.
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.
Creating pong in scratch Learning objectives: To learn how to program Sensing via colour and sprite proximity O:\ICT\ks3\scratch\scratch Exercises\Creating.
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.
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.
INTRODUCTION TO THE SCRATCH PROGRAMMING ENVIRONMENT.
In.  This presentation will only make sense if you view it in presentation mode (hit F5). If you don’t do that there will be multiple slides that are.
Introduction to Scratch!
How to make Space Invaders
PowerPoint 1 The Basics 1. Save this file to your Apps Folder as YourLastName_PP1 2. Read each slide. 3. Complete each set of numbered directions.
Programming with Alice Computing Institute for K-12 Teachers Summer 2011 Workshop.
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.
Getting Started With HTML HTML code needs an editor for a programmer to be able to use. We can use Notepad on a PC or TextEdit on a Mac. However, it is.
©Robomatter – Distribution or copying without permission is prohibited. 3B STEM Computer Science 1 ©Robomatter – Distribution or copying without permission.
Art 315 Lecture 6 Dr. J. Parker. Variables Variables are one of a few key concepts in programming that must be understood. Many engineering/cs students.
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.
Introduction to Scratch Scratch as Logo Dr. Ben Schafer Department of Computer Science University of Northern Iowa.
2015 CSE/EGR Summer Camps 1 Computer Science Concepts 1. What is an algorithm? 2. Binary information coding 3. Programming concepts via Scratch Designed.
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.
Intro CS – Screens and Variables Lesson Plan 9. Goals  Using sprites as full screens (Start screen, Game over)  Using layering to control ordering of.
Computer Programming Modeling a Passive Solar Home.
1 Project designed and created by M. Shajith Kumar.
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 4 – Cat and Dog game Year 9 ICT Autumn Term 2007.
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.
Adventures in Animation Introduction to Scratch! Michelle Venable-Foster Barb Ericson Dec 2007.
Today's Ninja Challenge: Write Your First Computer Game!
Computer Programming with Scratch JAOIT 8. Scratch Scratch is a programming language that makes it easy to create your own interactive stories, animations,
Creating a Simple Game in Scratch Barb Ericson Georgia Tech May 2009.
INTRODUCTION TO COMPUTER SCIENCE. SNAP! Open Chrome Whack a Mole Phone App in 3 minutes
Game Maker Tutorials Introduction Clickball IntroductionClickball Where is it? Shooting Where is it?Shooting.
DAY 4. MAKING SOMETHING ‘JUMP’ Simple! Move it a certain amount ‘up’ Glide back to your original spot.
Scratch Programming Cards
Introduction to Scratch
Create a Halloween Computer Game in Scratch
Intro CS – Screens and Variables
Scratch for Interactivity
Learn… Create… Program
Module 5 Lesson 3 Extreme Scratch Cards
Learn… Create… Program
Go to =>
Learn… Create… Program
Learn… Create… Program
Creating a Simple Game in Scratch
CSC 221: Introduction to Programming Fall 2018
Lesson Nine Variables.
Presentation transcript:

QUIZ! You can bring notes you took during class Any concept/topic we’ve covered may be up for grabs

HW #1 Read Chapter 1 of Blown to Bits

Review

LET’S REVIEW SOME THINGS What do we call the elements that make up the ‘grid’ that is the area our program is drawn in? What’s the size of the Stage? X: -240 to 240 Y: -180 to 180

LET’S REVIEW SOME THINGS What are the terms on the 3 tabs at the top of the main coding area? Scripts, Costumes, Sounds If I want to change the ‘look’ of a sprite what’s the easiest way? Change the costume What’s the easiest way to copy some code? Right-click and duplicate In what section is the ‘Wait’ command? Control What color is the ‘Sound’ section?

WHAT IS COMPUTER SCIENCE? Computing is a Creative Activity Abstraction reduces information and detail to facilitate focus on relevant topic Rocket launch - calls around to 10 different systems. Launch coordinator doesn't need to know the details about all of the subsystems. Data and information facilitate the creation of knowledge Algorithms are used to develop and express solutions to computational problems Programming enables problem solving, human expression, and creation of knowledge The Internet pervades modern computing Computing has global Impacts

Here’s what I might have said… Computer programming is about giving instructions to a computer Telling a computer what to do Computer programming is the art of creating something a computer interprets Computer programming is the what and how of what a computer does WHAT IS COMPUTER SCIENCE (CS) – PARTIAL ANSWER

Abstraction

ABSTRACTION Such a weird word…. Let’s see if we can figure it out What does abstract mean?

ABSTRACTION REVIEWED Let’s try some examples… How does a car work? Can you drive a car? How does a computer work? Can you use a computer? How is chocolate made? Can you eat it and enjoy it? How are your clothes made? Can you wear them?

ABSTRACTION So we can USE all those things, and yet we have no idea how they work In computer science, abstraction is the same thing The way in which code WORKS, doesn’t prevent you from using it…

ABSTRACTION How does move work for example? Something must be turning the pixels on and off from one area, to the next Do you know how? That’s abstraction The WAY in which move works, doesn’t mean you can’t use it!

ABSTRACTION So, abstraction means… The WAY something works, is separated from its ability to be used How a car works is abstracted from someone driving it In coding, all you see is move. Or repeat. Or change costume HOW each of those works is separate from them

ABSTRACTION The best example of us doing this, is making a block We hide the implementation. All someone sees (unless they choose to look harder) is say, ‘Draw Platforms’ If I read your code, that could tell me enough! I may be quite happy just seeing that The implementation of the code is kept separate from the usable part

Golden Code

GOLDEN CODE: WHAT IS IT? This is a term used in Computer Science… what does it mean? Golden code refers to code which is perfect or ideal This means you can take it as is and use in a project

GOLDEN CODE: WHAT IS IT? The code the teachers give you is nearly golden We could coin a new phrase? Silver code What this means is for your projects, pay attention, follow along, and save the code You will be able to use much of what we do as a group directly in your project

NEW TOPIC! SENSING We’ve done some of this already! If you made your Mario project have a goal, then the easiest way to detect the goal would be, if Mario touched the goal object

NEW TOPIC! SENSING Sensing is about determining … When one object is touching something else (or how far away it is from something else) Or A key is pressed Or The mouse is clicked Or Timing Or Noise Or The value of an attribute or object

NEW TOPIC! SENSING There’s 5 things that can be sensed 1.An object can sense if it is touching a color Really cool feature! But… Problematic! What if I make say a platform, but it’s multiple colors? What if the color I sense exists elsewhere in my program? Still useful, but caution urged Touching

NEW TOPIC! SENSING There’s 5 things that can be sensed 2. Any object can sense if one color is touching another color Very similar to ‘touching color’, but it detects when 2 colors collide caution urged Touching

NEW TOPIC! SENSING There’s 5 things that can be sensed 3. An object can sense if it is touching the edge Exceptionally limited Only one command supported: ‘bounce’ Notice, this is in the motion section, because of the ‘bounce’ But, a very cool, and useful way to say, let a ball bounce off the side of the screen (hint, hint) Touching

NEW TOPIC! SENSING There’s 5 things that can be sensed 4. An object can sense if it is touching another object This is the coolest command Allows one object to sense when it is touching another Then, it can react If I’m touching I win I die I get 50 points Most robust sensing command Touching

NEW TOPIC! SENSING There’s 5 things that can be sensed 5. An object can sense if it is near another object Useful if you want a sprite to change its behavior with proximity Handy, because otherwise you’d have to figure this out yourself Touching

NEW TOPIC! SENSING Hmmmm…. Can my app use all of these? Or 2 or 3 of them? Of course it can! Will this be useful in Pong? You bet it will! Are there any gotchas? always

NEW TOPIC! SENSING Let’s make something that bounces a ball around the screen

NEW TOPIC! SENSING Time to try it out yourself! Create a new project Change your sprites costume. Set its size Randomize your position, and direction Copy the sprite Change the costume of the second sprite When the first sprite touches the second make it ‘bounce’ Make a background with a specific color somewhere on it (like a ‘sun’) If either of your sprites hits that color, make them ‘bounce’ When either sprite hits anything else a total of times (such as 5). Use a variable per sprite! stop everything, and show a ‘game over’ screen

NEW TOPIC! SENSING Make a background with a specific color somewhere on it If either of your sprites hits that color, make them ‘bounce’ When either sprite hits anything else a total of times (such as 5) stop everything, and show a ‘game over’ screen

IF ON EDGE, BOUNCE

DIRECTION

VARIABLES

Used to store information Are by their nature temporary This differentiates them from databases or data stores such as files Have values that can change Hence their name! Differentiates them from ‘constants’, values that do NOT change (we won’t see those in Snap!)

VARIABLES So, what things might change in the real world, that we want to measure? I’ll give some examples…. Number of cars in a parking lot Number of points by the Seahawks in a game And their opponents! Number of clean socks I have left The current time (do I have to get up yet?) Amount of money in my bank account Number of Olympians in the Olympics

VARIABLES In pairs, YOU come up with some examples You have 4 minutes to come up with 5 examples in your pairs

VARIABLES SO why STORE that information? It allows us to remember what a value WAS How do I track the number of cars in a parking lot, without counting ? Well, when you count, you are effectively using a variable That way we can … Keep track of a value that’s changing Pass it around to other parts of the system And they can react to it if it changes! Show it to the user!

VARIABLES There are some existing variables for standard apps we’ve built! x position This is the position of the sprite it refers to y position direction costume # size give me some others!!! What does a variable look like in BYOB?

VARIABLES Game Ask the user 5 questions Then, ASK them what they answered to each of your questions If they type in the right answer say ‘correct’ Otherwise, say ‘wrong!’