Computer Programming Modeling a Passive Solar Home.

Slides:



Advertisements
Similar presentations
Create a Simple Game in Scratch
Advertisements

Create a Simple Game in Scratch
Scratch is a Visual Programming Language
Mission Technology Introduction to Scratch! June 2007.
Scratch for Storytelling Dr. Ben Schafer Department of Computer Science University of Northern Iowa.
Harry Potter Scratch Game
Adventures in Animation Harry Potter Game Pranali Choubal Kunal Shaw Barb Ericson Dec 2007.
1 An intro to programming concepts with Scratch Session 3 of 10 sessions Repetition and variations.
Code Club Session 3 Shark Eats Fish. Picture of finished product here.
Mrs. Chapman. Tabs (Block Categories) Commands Available to use Script Area where you type your code Sprite Stage All sprites in this project.
Learn… Create… Program. Manipulation of Multiple Media Connects with youth culture Scratch is a new graphical programming language designed to support.
1 An introduction to programming concepts with Scratch.
ITEC Winter An intro to programming concepts with Scratch Quick intro for college citizens. George Stockman MSU CSE.
Digital Art in Scratch part 1 Barb Ericson Georgia Tech Oct 2010.
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.
INTRODUCTION TO THE SCRATCH PROGRAMMING ENVIRONMENT.
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.
Introduction to Scratch!
Using MIT Scratch for Programming and Control Exercise 3 Ball Game Year 9 ICT Autumn Term 2007.
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.
Introducing Scratch the Cat
Objects and Methods in Scratch 1. 2 Scratch environment Stage is at upper right (where actors act and information is displayed) Sprite is another name.
2015 CSE/EGR Summer Camps 1 Computer Science Concepts 1. What is an algorithm? 2. Binary information coding 3. Programming concepts via Scratch Designed.
Digital Art in Scratch part 1 Barb Ericson Georgia Tech May 2011.
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.
Image #1 Getting Started
Scratch Another computer programming language Developed by MIT in 2003
Making a Sprite Dance Barb Ericson Georgia Tech June 2011.
Create a Halloween Computer Game in Scratch Stephanie Smullen and Dawn Ellis Barb Ericson October 2008.
Using MIT Scratch for Programming and Control Exercise 1 Creating movement Year 11 DTG 2012.
First Project: Dance Dance Sprite  Write a dance with your sprite (You pick or create the sprite)  Incorporate as many of the Motion Commands as you.
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 and choose a new.
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.
Using MIT Scratch for Programming and Control Exercise 4 – Cat and Dog game Year 9 ICT Autumn Term 2007.
 SCRATCH is a new programming language that lets you create your own interactive stories, animations, games, music, and art.
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.
Today's Ninja Challenge: Write Your First Computer Game!
1 CSC 221: Computer Programming I Fall 2009 Introduction to programming in Scratch  animation sprites  motion, control & sensing  costume changes 
ICT/COMPUTING RULES Only use software allowed by the teacher
Computer Programming Modeling a Passive Solar Home.
Computer Programming with Scratch JAOIT 8. Scratch Scratch is a programming language that makes it easy to create your own interactive stories, animations,
Sprites & Backdrops. Sprites Sprites are the actors that perform the commands in your script. The cat is the default Sprite. Scratch has many other Sprites.
Creating a Simple Game in Scratch Barb Ericson Georgia Tech May 2009.
Introducing Scratch Learning resources for the implementation of the scenario
School of Computer Science Space School 2015 Programming a Lunar Lander Game.
Using MIT Scratch for Programming and Control Programming 9.
Review for Final June 13, 2016.
Create a Halloween Computer Game in Scratch
Scratch for Interactivity
Scratch for Interactivity
Introduction to.
Learn… Create… Program
Learn… Create… Program
Image #1 Getting Started
Introduction to Snap Programming
Getting Started with Scratch
Learn… Create… Program
Learn… Create… Program
Game development using Scratch
Creating a Simple Game in Scratch
CSC 221: Introduction to Programming Fall 2018
Presentation transcript:

Computer Programming Modeling a Passive Solar Home

 Scratch is a visual computer language  Uses graphical blocks to create a program as opposed to typewritten commands.  Output is primarily visual  Made to be simple to use, but it contains all the elements of a programming language

 The output is displayed on a stage, which can have several different backgrounds  Sprites are characters or objects that are moved about the stage and which also can change appearance  The inputs and results of calculations are also displayed on the stage  Scripts, or programs, are used to change the background and to move or change the appearance of sprites

 Characters or pictures in the animation that you can manipulate ◦ Move, Glide, Shrink, Grow, Alter, appearance  The first Sprite that shows up is the Cat  In the lower right hand part of the screen are where the Sprites are loaded, created, or altered  Sprites do not have to be characters. They can also be objects that you want to change or move, such as a lamp that can be on or off or a ball moving across the screen

 Paint a new Sprite ◦ This brings up a Paint Editor screen where a sprite can be created using a standard paint interface with a variety of tools and a color pallet  Choose a new Sprite from file ◦ Select and of the pre-drawn Sprites that come with the program in the costumes folder ◦ Bring in other pictures on your computer  Get surprise Sprite ◦ Selects a random Sprite from the costumes folder

 Click on a sprite. In the center of the Scratch window are three tabs for Scripts, Costumes, and Sounds  Scripts are where programs are written. Each sprite and the stage can have their own programs  Costumes are different appearances for the Sprite. Under the tab you can create and edit the costumes for each sprite  Under Sounds you can record and manage sounds the sprite might make

 The white area in the upper right that has a background and on which the sprites move.  The stage can have multiple backgrounds which can be changed by the script  Selecting Stage, just to the left of the Sprites, brings up three tabs for the stage in the center of the window: Scripts, Backgrounds and Sounds ◦ Under the Background tab, you can load in pictures that will serve as the background behind your Sprites. ◦ You can paint a background, import a background that Scratch provides (in the Backgrounds folder), or import in your own background picture

 Scratch uses a Cartesian Coordinate System to locate Sprites  Each coordinate is a pair of numbers (or ordinates)  The first ordinate in the pair gives the horizontal location  The second ordinate give the vertical location Y X (-5, -2) (-3, 4)

 The middle of the stage is 0,0  The horizontal ordinate ranges from -240 to +240  The vertical ordinate ranges from -180 to +180  Click on the Cat Sprite and move it around the stage; its coordinates are shown.

 Scripts are the computer programs that govern the movement and appearance of each Sprite or Background  They are created by dragging commands from the left column into the center column  Commands are arranged in categories shown in the upper right of the window Motion Looks Sound Pen Control Sensing Operators Variables

 Move – will move the sprite in its current direction  Turn – will turn the direction of the sprite  Point – will change the direction of the sprite towards a point or another Sprite  Go to – will put the Sprite at a certain location  Glide – will move the Sprite at a certain rate to a location  Change by – will change the location by a certain amount in the x or y direction  Set to – will set a specific x or y location  Bounce – will make the Sprite bounce if it hits the edge of the screen  x, y, direction boxes – Will place the x, y, or direction values for the Sprite on the screen

 Costume – will change the costume of the Sprite  Say – will put a box on the screen for a Sprite to say the Text entered  Think – will put a bubble on the screen for a Sprite to think the Text entered  Effects – will change the color or other effects for the Sprite  Glide – will move the Sprite at a certain rate to a location  Size – will change the size of the Sprite  Show/Hide – will either show or hide the Sprite from view  Go to – will set the Sprite to be in front of the other Sprites, or to move behind them

 Variables hold numeric values ◦ Create them under the “variables” commands ◦ Can set or change a variable using “set” and “change” commands  Operators perform calculations ◦ Addition, subtraction, multiplication ◦ Operands include existing variables and numbers ◦ Operators give results that are used in “set”, “change”, “move to”, and other commands

 Start – starts the script via flag, message, or clicking  Stop – stops the script or all of the scripts  Loops let you repeat parts of a script  Other control blocks allow a script to change its behavior if certain conditions are met

 Follow the steps below to create a program to add two numbers together.  Steps ◦ Open scratch and click on the “stage” in the lower right. ◦ Select backgrounds in the middle panel, then “edit” ◦ Use the line tool to draw a “+” and a line, as one might do for addition with a pencil and paper. ◦ Move the Cat sprite out of the way (we won’t use the sprite in this example)

 Select “Variables” in the upper left  Select “Make a Variable” and create three variables. Suggested names are “number 1”, “number 2”, and “sum”. These appear on the stage.  Move them so they make sense, with the sum below the line and the numbers above

 Click on the “Script” tab in the center panel  Click on “Control” button on the upper left and drag the “When stage clicked” into the center panel  Click on the “variables” button and drag the “set” block to the center panel, just under the existing piece. A white line will appear that will tell you when the piece is fitting correctly.  Use the small arrow in the “set” block to change the variable from “number 1” to “sum”

 Click on “Operators” in the upper left  Drag the top operator (with the plus) so that it falls into place on the “set” block where the 1 used to be  Go back to the “variable” area and drag the “number 1” and “number 2” variables into the “+” operator. The placeholders will be highlighted when the fit is correct.  Go back to the “control” area and drag the “stop script” block to the end of the script

 On the stage, double-click on the “number 1” and “number 2” variables. Both will have a small slider beneath them.  Double-click twice on the “sum” variable. It will turn into a larger number.  Use the sliders to change values of“number 1” and “number 2”  Single-click anywhere on the stage and the value of “sum” will change to be the sum of the other two variables.

 Use scratch to calculate the change in temperature in a house due to heat loss