Using Lists Games Programming in Scratch. Games Programming in Scratch Extension – Using Lists Learning Objectives Create a temporary data store (list)

Slides:



Advertisements
Similar presentations
CATHERINE AND ANNIE Python: Part 3. Intro to Loops Do you remember in Alice when you could use a loop to make a character perform an action multiple times?
Advertisements

Goal: Write Programs in Assembly
Written by: Dr. JJ Shepherd
Multiplication Practice Do you know how to multiply with double digits?
The Little man computer
Chapter 10 Introduction to Arrays
CS0007: Introduction to Computer Programming Array Algorithms.
Python Magic Select a Lesson: Why Learn to Code? Basic Python Syntax
© The McGraw-Hill Companies, 2006 Chapter 5 Arrays.
Stacks. 2 What is a stack? A stack is a Last In, First Out (LIFO) data structure Anything added to the stack goes on the “top” of the stack Anything removed.
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.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and.
Python. What is Python? A programming language we can use to communicate with the computer and solve problems We give the computer instructions that it.
An Introduction to Textual Programming
CATCH SCRATCH! Programming from Scratch. Remember Scratch?
11 Finding Winners Using Arrays Session 8.2. Session Overview  Find out how the C# language makes it easy to create an array that contains multiple values.
Introduction to Programming G50PRO University of Nottingham Unit 3 : Introduction To Scratch 2 Paul Tennent
Python November 28, Unit 9+. Local and Global Variables There are two main types of variables in Python: local and global –The explanation of local and.
Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and Elizabeth Drake Chapter 6: Sequential Data Files.
CSC Intro. to Computing Lecture 13: PALGO. Announcements Midterm is in one week  Time to start reviewing  We will do more review in class Tuesday.
By the end of this session you should be able to...
Coding Design Tools Rachel Gauci. What are Coding Design Tools? IPO charts (Input Process Output) Input- Make a list of what data is required (this generally.
Coding Design Tools Rachel Gauci. Task: Counting On Create a program that will print out a sequence of numbers from "1" to a "number entered”. Decision’s.
PROGRAMMING In. Objectives  We’re learning to develop basic code with the use of the correct syntax and variables. Outcomes  Explain what syntax is.
Intro to Programming Web Design ½ Shade Adetoro. Programming Slangs IDE - Integrated Development Environment – the software in which you develop an application.
1 University of Utah – School of Computing Computer Science Writing Tic Tac Toe H. James de St. Germain University of Utah.
1 Printing in Python Every program needs to do some output This is usually to the screen (shell window) Later we’ll see graphics windows and external files.
M1G Introduction to Programming 2 3. Creating Classes: Room and Item.
Mr. Hudson’s Review Test on Thursday. Topics Arrays Traversing Loops Selections Identifying code throughout a program Type Casting Conversion of numbers.
Introduction to Computer Programming - Project 2 Intro to Digital Technology.
Language Find the latest version of this document at
Programming a Shooter Game Design.
Data Handling in Algorithms. Activity 1 Starter Task: Quickly complete the sheet 5mins!
Algorithms and Pseudocode
I have used Scratch, to program a guide to internet safety. This is done by using QR codes to make it more interactive and interesting for people playing.
Introduction to TouchDevelop Lesson 3 – Comments & Lists Created by S. Johnson
Today's Ninja Challenge: Write Your First Computer Game!
Loops. Review Control Structure – making decisions if-statement Program Design Understand what you want to do Design your solution Write and test your.
Flow Control in Imperative Languages. Activity 1 What does the word: ‘Imperative’ mean? 5mins …having CONTROL and ORDER!
Lives and Scoring Games Programming in Scratch. Games Programming in Scratch L2 Lives and Scoring Learning Objectives Define a variable Understand the.
Microsoft® Small Basic Conditions and Loops Estimated time to complete this lesson: 2 hours.
Multiplication Using Arrays. How many paper clips are here? I could count them, but there is an easier way!
CSC 1010 Programming for All Lecture 5 Functions Some material based on material from Marty Stepp, Instructor, University of Washington.
Lesson 2 – Denary to Binary
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.
Scratch Programming Cards
The Little man computer
Chapter 6: Sequential Data Files
Broadcasting (Adding a new level)
Games Programming in Scratch
Accumulators in Programming
Diamond Hunt Mock Programming Project.
Scratch – Simple Programming
Starter Write a program that asks the user if it is raining today.
Introduction to TouchDevelop
Introduction to pseudocode
Databases Lesson 2.
Scratch – Simple Programming
Computer Terms Good to Know.
Motion and Looks.
Coding Concepts (Basics)
Algorithm and Ambiguity
ICT Gaming Lesson 3.
Game Over Module 4 Lesson 2.
Introduction to coding through Kodu
Intro to Programming (in JavaScript)
Introduction to Computer Science
Presentation transcript:

Using Lists Games Programming in Scratch

Games Programming in Scratch Extension – Using Lists Learning Objectives Create a temporary data store (list) to hold multiple items Add items to the list Keep count of the number of items in the list Use the items in the list

Games Programming in Scratch Extension – Using Lists Starter How do you remember things you need to buy at a supermarket? How will you know when you have got all the items? How would you get a computer to check you have them all? Write some simple instructions for this

Games Programming in Scratch Extension – Using Lists Shopping Lists Repeat Think of item Add item to list Until you can’t think of any more items Repeat Look at first item in list Check item is in basket If item not in basket then Get item Else tick item Until end of list

Games Programming in Scratch Extension – Using Lists Variables or Lists Variables are great for individual pieces of information like scores, lives and health. However, sometimes we want to store a list of information. For example, in an RPG game you might want to keep a list of the items you have collected in your bag. For this, you need to use a LIST

Games Programming in Scratch Extension – Using Lists What is a List in Scratch? In Scratch, a List is a special variable type that can contain multiple other variables. In other programming languages this is usually known as an Array

Games Programming in Scratch Extension – Using Lists Using Lists Build an inventory/bag into your game Write out the instructions (on some paper or a whiteboard) for what happens:- – If your main character comes into contact with a collectable item – When you want to use an item in your inventory/bag Compare your instructions with those of your peers. Will they work as intended?

Games Programming in Scratch Extension – Using Lists Challenge! Try to implement your instructions Modify your game so that you can collect items and add them to your inventory/bag

Games Programming in Scratch Extension – Using Lists Recalling the items in a list Simple method: Loop method:

Games Programming in Scratch Extension – Using Lists Comment your Code Add comments to your code to help explain what each part does