StarLogoTNG 101 Treasure Hunt Game Unit Lesson 4: Forever and Procedures.

Slides:



Advertisements
Similar presentations
Using Microsoft PowerPoint in the Classroom
Advertisements

Create a Simple Game in Scratch
Create a Simple Game in Scratch
New Mexico User Test Starlogo TNG September 16, 2006 Starlogo TNG September 16, 2006.
Getting Started With Alice By Ruthie Tucker under the direction of Prof. Susan Rodger Duke University, July
StarLogoTNG 101 Treasure Hunt Game Unit Lesson 9: Variables.
Lets Play Catch! Keeping Score in Alice By Francine Wolfe Duke University Professor Susan Rodger May 2010.
StarLogoTNG 101 Treasure Hunt Game Unit Lesson 6: Terrain.
Google SketchUp Castle
Alice Learning to program: Part 1 Scene Setup and Starting Animation by Ruthie Tucker and Jenna Hayes Under the direction of Professor Susan Rodger Duke.
Calvin and Hobbes Teach Properties and Functions Created by Daniel MacDonald under the direction of Professor Susan Rodger Duke University June 2013.
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.
Mr. Wortzman. Tabs (Block Categories) Available Blocks Script Area Sprite Stage All sprites in this project.
StarLogoTNG Treasure Hunt Game Unit Lesson 1: Basic Movement.
Fell View Computer Club StarLogo TNG – Session Two.
GAME:IT Junior Bouncing Ball Objectives: Create Sprites Create Sounds Create Objects Create Room Program simple game.
InDesign CS3 Lessons 1 and 2. Work Area When First Opened.
Mastering Your Word Processing Skills
Game Design Creating a game called PING Phase 3: Steps for building basic game.
Working with Numbers in Alice - Converting to integers and to strings - Rounding numbers. - Truncating Numbers Samantha Huerta under the direction of Professor.
Getting Started With Alice By Ruthie Tucker under the direction of Prof. Susan Rodger Duke University, July
StarLogoTNG 101 Treasure Hunt Game Unit Lesson 3: Treasures and Hazards.
Making a Boat Racing Game in Alice By Jenna Hayes Under the direction of Professor Susan Rodger Duke University, July 2010.
EEC-693/793 Applied Computer Vision with Depth Cameras Lecture 13 Wenbing Zhao
Using MIT Scratch for Programming and Control Exercise 3 Ball Game Year 9 ICT Autumn Term 2007.
Teacher’s Assessment Assistant Worksheet Builder Starting the Program
Art 321 Lecture 7 Dr. J. Parker. Programming In order to ‘make things happen’ on a computer, you really have to program it. Programming is not hard and.
StarLogoTNG 101 Treasure Hunt Game Unit Lesson 2: Keyboard Controls.
2015 CSE/EGR Summer Camps 1 Computer Science Concepts 1. What is an algorithm? 2. Binary information coding 3. Programming concepts via Scratch Designed.
Quiz Me Extensions. Increasing Flexibility of Answer Evaluation Currently in Quiz Me, if the users doesn’t type enter the exact answer from your “AnswerList”,
StarLogoTNG Treasure Hunt Game Unit Lesson 1: Basic Movement.
Animating GIF. What is it? Think of how a flip book works. Each page is a different picture and when flipped through quickly, it looks as though objects.
An Introduction to Alice (Short Version) – Extras! Yossra Hamid Under the Supervision of Professor Susan Rodger Duke University, June 2014 This is a continuation.
Piñata Game: Keeping Score in Alice By Maggie Bashford Professor Susan Rodger Duke University July
Algorithms Writing instructions in the order they should execute.
An Inspiration Software Tutorial INDEX Changing a Symbol in Inspiration Adding a Symbol in Inspiration Moving a Symbol in inspiration Adding text under.
Creating a Simple Game in Scratch Barb Ericson Georgia Tech June 2008.
StarLogoTNG 101 Treasure Hunt Game Unit Lesson 7: Coordinate System.
Create a Halloween Computer Game in Scratch Stephanie Smullen and Dawn Ellis Barb Ericson October 2008.
Variables and Random Numbers Computer App Session 4.
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.
StarLogoTNG 101 Treasure Hunt Game Unit Lesson 8: Hatch.
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.
StarLogoTNG 101 Treasure Hunt Game Unit Wrap Up. Today’s Agenda Review Mini-lesson and programming practice on set camera and ID Finish making the treasure.
ICT/COMPUTING RULES Only use software allowed by the teacher
Vex Robotics program three: using motors and sensors together.
Introduction to Programming with Scratch Exploring Computer Science – Lesson 4-1.
Creating a Simple Game in Scratch Barb Ericson Georgia Tech May 2009.
Introducing Scratch Learning resources for the implementation of the scenario
Module 1: Investigation 1 Moving, Turning and Stamping
Create a Halloween Computer Game in Scratch
Using the Lego Mindstorms Edu NXT Software
Scratch for Interactivity
Co-ordinates And Geometry Module 6: Investigation 2
WORKSHOP 2 VALVETRAIN MECHANISM
WORKSHOP 2 VALVETRAIN MECHANISM
After completing this lesson, you will be able to:
Unit 2 Getting Started With
ReadySet Achieve Maximize Training Agenda
Scratch for Interactivity
Learning to program with Logo
Adding and Manipulating Objects
Introduction to TouchDevelop
creating a ecosystems model in net logo
Creating a Simple Game in Scratch
So you want to be a Game Designer
Presentation transcript:

StarLogoTNG 101 Treasure Hunt Game Unit Lesson 4: Forever and Procedures

Today’s Agenda Review Mini-lesson on new programming blocks Create v1 of treasure hunt game Wrap-up

Review What is the purpose of the Setup block? What blocks typically go in the Setup block? If you don’t put a “scatter” block, where are the agents placed when you create them? Program a collision block between turtle and treasure agents so that the treasure moves up into the air 1 step and change its color to purple.

Programming Tip Use the canvas sections to keep your program organized

Programming Tip Use the mini-map on the upper right corner of the canvas to quickly navigate to different sections of your program.

Treasure Game v.1 File menu > Open Project > “treasure game” Save as “treasure game your initials.sltng” About the treasure game –Setup: creates 1 player agent; creates treasure agents and non-moving hazards agents –Run (forever): player agent(s) calls a procedure that executes movement when the player presses various keyboard keys to control the player agent from 1 st person point of view –Collisions: between player and treasure and hazard agents

Guided Programming 1: Setup Breed Editor: –Rename turtle breed to “player” (or your choice) and select a new character –Make new breed called “treasure” (or your choice) –Make new breed called “hazard” (or your choice) Drag setup block to setup section of canvas –Attach “clear everyone” block –Create 1 player agent –Create treasure and hazard agents and randomly scatter them Click on setup in runtime window to check that the setup does what you want.

New Block: Forever Found in the “Setup and Run” drawer Repeats instructions placed in this block over and over again, in order from top to bottom, and then starts at the top again. Each breed has its own section. Turn on/off by clicking on the green arrow Can also run from runtime window

Guided Programming 2: Forever Drag a Forever block to the runtime section of canvas. Rename the Forever block “Run.” Attach the If/then keyboard controls stack to the Player section of the Run block. Turn on the Run block and test the keyboard controls. What would happen if you move the Keyboard Controls stack to the treasure section?

About Procedures Recall the cake making analogy: procedures are like those sub-tasks (make the batter, bake the cake, decorate the cake) Procedures make programs easier to build and to understand. Make a cake Make the batter Bake the cake Decorate the cake

New Block: Procedure Guided Programming 3: Make a procedure of the keyboard movement controls that are currently in the player section of the run block. Replace those instructions with a call to the procedure. To make (or “define”) a procedure: Position your canvas in the Player section. Drag a green “procedure” block from the “Procedure” drawer. Rename the procedure “keyboard controls.” Drag the if/then blocks and connect them to the procedure block.

New Block: Procedure To “call” a procedure is to use a block with the procedure’s name; the procedure’s instructions are executed in the place where it’s called. Each breed and programming section has its own procedures (found in “my blocks” palette). To call the “keyboard controls” procedure: Go to the “my blocks” palette and open the “Player” drawer. Find the procedure that’s labeled “keyboard controls” and drag it to the empty player section of the run block. Start the run block to make sure that the keyboard controls are working properly.

New Blocks: Score Score is a variable. This means that it represents a number that can change. You can change the value of score using set score, found in the “Setup and Run” palette. Set score takes either a single number or a mathematical expression that is evaluated to a single number. For example, if you want to increase the score, you can drag out the addition block from the “Math” palette. The pink score block represents the current value of score. Drop that in the left side of the expression. Drag a pink number block on the right side of the expression and change the number to the amount you want the score to increase. You can also change the sign of the math expression block by clicking on the down arrow next to the operator symbol. Think: What are some ways to use score in your treasure game? When should the score be changed?

New Blocks: Score A simpler way of increasing or decreasing the score is to use “inc score” and “dec score” So instead of “set score (score + 5)”, you can just use “inc score 5” Similarly, instead of “set score (score – 5)”, you can just use “dec score 5”

Programming Activities Implement collision results between the treasure and hazard agents and the player. Implement score-keeping. (Hint: don’t forget to attach the “show score” and “set score 0” blocks in the setup block!) Explore different starting conditions. (Hint: you can have more than 1 setup block)

Wrap Up What collision results did you try? What worked? What didn’t work? What challenges did you have? What was fun? What questions do you have? What new game ideas do you have?