Lets Play Catch! Keeping Score in Alice. Overview. Set Up. Position the ball 20 feet away: Orienting the ball 7/19/2010

Similar documents
Skater World: Part Two. By Deborah Nelson Duke University Under the direction of Professor Susan Rodger June 2009

Repetition. Add in objects. The world should look like this: Bunny Eat Broccoli Repetition Simple loops and Conditional loops

CS Problem Solving and Object-Oriented Programming Lab 2 - Methods, Variables and Functions in Alice Due: September 23/24

TECHNICAL NOTE HOW TO USE LOOPERS. Kalipso_TechDocs_Loopers. Revision: 1.0. Kalipso version: Date: 16/02/2017.

Table Football. Introduction. Scratch. Let s make a world cup football game in Scratch! Activity Checklist. Test your Project.

Start a new Scratch project. Delete the cat by right-clicking it and selecting Delete.

3. Select a colour and then use the Rectangle drawing tool to draw a rectangle like the one below.

1. First start a new scratch project and remove the default sprite.

Slide 1 - Welcome to an Overview of the Student Center and New Titan Online

Felix and Herbert. Level. Introduction:

In this project you ll learn how to create a football game in which you have to score as many goals as you can in 30 seconds.

Alice in Wonderland Tea Party Coding Animation

Get it here. Page 1 of 7 Date:Jan 8, 2014

Start - All Programs - Class Software - Scratch - Scratch move move move Sound play drum move move move play drum Control forever forever forever

GETTING STARTED. Main MENu SCREEN: When starting E6, the Main Menu screen displays the following buttons:

Step 1. CoderDojo Milltown Exercise 1 Pong Page 1 of 13

To Logon On to your tee sheet, start by opening your browser. (NOTE: Internet Explorer V. 6.0 or greater is required.)

Microsoft Windows Software Manual for FITstep Stream Version 4

Robot Activity: Programming the NXT 2.0

Mapping a course for Pocket Caddy

Managing Timecard Exceptions

About Chris O Leary July 22, 2017 Alpha 1

Wire Buddy Manual IOpath Software

Wiimote in Physical Etoys

Robot Soccer Challenge

Tutorial 6a Manual Digitisation

CS Problem Solving and Object-Oriented Programming

LEGO Engineering Conferences ROBOLAB and MINDSTORMS Education Version 4.5 March 2008

Complete Wristband System Tutorial PITCHING

SCRATCH CHALLENGE #3

Table of Contents. 1 Command Summary...1

Lesson: Pitch Trim. Materials / Equipment Publications o Flight Training Manual for Gliders (Holtz) Lesson 4.4 Using the Trim Control.

Warm-up exercises with ball

To register your AED at the National AED Registry please go to and click on Get Started

Chromat Calibration Updated October 27th, 2017

Trainer User Guide Submitting a Newmarket Special Gallops Return

Thermo K-Alpha XPS Standard Operating Procedure

: User Manual. 1 Getting Started

GEN II Robot Soccer EV3 Compass Training Curriculum Brian Thomas

Standard League WRO Football Simple Simon EV3 Training Curriculum

USER GUIDE USER GUIDE

Quarterback Progression Process

Trainer User Guide Submitting a Monthly Gallops Return

BALL PLACEMENT 1 Driver, Woods, Hybrids & Irons Chip Shots Putting

Walking for Health: Scheme page guide Contents

ELIMINATOR COMPETITION DRAG RACE Program Manual Firm Ver 4.11

COYBL Winter 2019 Coaches Meeting. How to Use the COYBL Website

Name of Activity Description Key Teaching Points. Sideline base running - Deep in LF or RF. Rotate groups after 5 minutes

ISCORE INTEGRATION IOS SCORING GUIDE

Moorhead Baseball Routines/Hitting Drills

Working with Marker Maps Tutorial

PROGRAMMING LINX LEARNING GAME

SwimNumber App. Build Custom Smart Workouts Control the Wave Propulsion TM System Achieve Health and Fitness Goals INSTRUCTION MANUAL

Tutorial: Setting up and importing Splat Maps from World Machine

DUTCH5 USER GUIDE February 2013

GUIDE FOR USTA TEAM CAPTAINS

Pregame and Halftime

Welcome to Force-Land

Shooting Target Game. The user will be able to input a player s name and destroy a predefined number of dartboards before the game ends.

Super Action Baseball

Golf Trip Captain s Guide

Horse Farm Management s Report Writer. User Guide Version 1.1.xx

Opleiding Informatica

Sport NGIN has two applications, which can be used to score games.

Fencing Time Version 4.3

Dear PLL Managers and Coaches:

League Manager Tutorial

Note! In this lab when you measure, round all measurements to the nearest meter!

Group walks & events manager: Getting Started for Contributors

User Guide. Version Mindjet

OrbBasic 2: Student Guide

Boyle s Law: Pressure-Volume Relationship in Gases

Click on the menu icon in the left corner to open the menu. From the menu you can:

Competition Management

GAMECHANGER SCORING NOTES

Courtside User Guide for Referees and Scorers Version 1.2.3

The Race Director. Race Director Go [RACE DIRECTOR GO] This document describes the implementation of Race Director Go with a beginning to end example.

Baseball Scorekeeping for First Timers

GAME 1: 2 v 2 Why play this Game: Scenario What will this Game do? What do I need to set up this Game? What will pitch layout look like?

Technology. In the My Files [My Files] submenu you can store all the programs that you have made on the NXT or downloaded from your computer.

RUNNING MEET MANAGER IN SUPPORT OF MEETS (2016) Greg Wright(6/3/16) First, YOU DO NOT NEED TO DO THIS UNLESS YOU ARE THE HOME TEAM

GPS Curriculum 2016 Vacation Programs Technical Training Program u11 - u12

1 An object moves at a constant speed of 6 m/s. This means that the object:

ADVANCED. CATIA V5 Workbook. Knowledgeware and Workbenches. Release 16. Knowledgeware. Workbenches. Richard Cozzens. Southern Utah University

Finding peer-reviewed articles. Slide 1 - Slide 1. Page 1 of 33

STAT-O-MATIC FOOTBALL

Simple Simon GEN II Robot Soccer EV3 -Tris 10 Training Curriculum

[1] Introduction..pg3. [2] The Windows you Need pg3-4

May the Forces Be With You

Deer Population Student Guide

ClubHub. User s Guide

Software Manual for FITstep Pro Version 2

Online League Management lta.tournamentsoftware.com. User Manual. Further support is available online at

The ICC Duckworth-Lewis-Stern calculator. DLS Edition 2016

1. A Tutorial on LSA SwimMeet

Softball (Team & Skills) Special Olympics Iowa

When Should Bonds be Walked Intentionally?

MP-70/50 Series Scoreboard Controller User Guide

Contents. 5. Virtual Reality. 1. Introduction. 6. Customizing Uniforms. 7. Managing User Accounts. 2. Getting Started. 8. Team Settings. 9.

Coaching Course READ FIRST

Transcription:

Lets Play Catch! Keeping Score in Alice Overview This tutorial will show how to create a game of catch with a score. A ball will be thrown several times and the player moves the glove to catch it. By Francine Wolfe Duke University Professor Susan Rodger May 2010 Open a new Alice world with any template Click Click on sports in the local gallery Add a baseball and a baseballglove2 Set Up Re-size both objects to make them a little bigger. Move the baseballglove2 so it is right in front of the camera. Right click on it in the object tree and select methods, orient to, camera Position the ball 20 feet away: Orienting the ball Right click on the baseball in the object tree and select methods, move to, baseballglove2. It should look like the picture to the right. Right click baseball again and select methods, move, 20m, forward. The ball will probably move in the wrong direction. That is because is oriented in a different direction than the camera. Click undo. Right click the baseball again and select orient to, camera. This will cause the ball to always move according to our perspective. 1

Position the ball 20 feet away: Part two Try moving the ball again. Right click baseball again and select methods, move, 20m, forward. Now it should look like the bottom picture Now we know when the game plays, if the ball moves backward 20 meters, it will end up in the glove. Click. Let the User Control the Glove When you click create new event, there is an option to Let the arrow keys move <subject> but that will cause the right and left arrow keys to turn the glove instead of moving it. Instead, click when a key is typed. Change any key to right. Right click on the instruction and click change to, while a key is pressed Click on the baseballglove2 in the object tree, then methods tab Let the User Control the Glove (Cont d) Click and drag move into the during part of the while loop Select right, other, and type.1 Set the style to abruptly and duration to.1 seconds. It should look the while loop in the picture below. Now drag the entire while over to the clipboard to make a copy. (see picture below) Let the User Control the Glove (Cont d) Now drag the entire while loop over to the clipboard and put the copy below the first one. Change both of the right s to left 2

Save the starting position of the ball Click on the baseball in the object tree. Click and more controls. You will notice two button appear. The first one, drop dummy at camera, you have probably already used in another tutorial. It saves the current location of the camera. The second one, drop dummy at selected object, you may not have used yet. It works the same way except it saves the location of whatever object is selected in the object tree instead. Click drop dummy at selected object. Rename the dummy startposition. Click done.. Setting up the Pitch Under the baseball methods tab click and drag move to into world.my first method. Select startposition and set the duration to 0. Now drag in the move method. Select backward, 20 meters. This will move the ball back to the glove. Play your world. The ball should be pitched right to the glove. Making the Pitch Random: create a variable We want the ball to be thrown from a different spot each time to make it more difficult to play We will have the ball start at a random distance from the original position each time. Click create a new variable. Call it randomdistance and select number Click and drag this new variable to in between the two lines of code. Select set value, 1. Making the Pitch Random: Make a Random Number Click on the world in the object tree and click functions. Scroll down to random. Drag in the random number to where the 1 is. Click more, minimum, other, -.5. Click more again, maximum, other,.5. 3

Making the Pitch Random (cont d) Click on the baseball again in the object tree. Click and drag in move right below the line we just made. Select right, expressions, randomdistance. Set the duration to 0 and asseenby to camera. It should look like the picture below. Test your world. It should throw to a different spot each time. You may need to change the minimum and maximum for the random number so the ball moves enough to make it difficult, but doesn t go to far to the left or right of the screen Display the Score We want the score to be displayed. Click and scroll over the right side of the local gallery and click create 3D text. Type Score: 0 Rename the new 3D text Object score Resize it and move it to the top right corner of the screen like in the picture Click Incrementing the Score: Part 1 Now, under the methods tab of score, click create new method, call it incrementscore Under the properties tab, click create new variable. Name it value, select number, and set the value to 0. Then click and drag value into the new incrementscore method. Select increment score.value by 1 Incrementing the Score: Part 2 Now we want to display the new score. Click and drag in text from the properties and select default text. Click on world, then functions and drag in a joined with b and select default text again. Change the first default text to Score: If you try to drag in score.value, Alice won t let you. That is because when we set the text of a 3D text object we need to set it to a string (a line of text). So, we need to convert value, which is a number, to a string so Alice can display it. Drag in what as a string from the world functions into the other default text. Select score and value. 4

Create checkforcatch method: Using an If statement After the ball is thrown, we want to see if the glove caught it. We will do this by checking how close the ball is to the glove. Click world, methods, then create new method. Name it checkforcatch. Drag in an If and select true. Under the world functions tab, drag a<b into the true spot. Select 1 for both a and b. Under the baseball functions tab, drag in distance to into the first 1. Select baseballglove2. Change the 2 nd 1 to 0.3 Create checkforcatch: Setting the Conditions Now go the score methods tab and drag in incrementscore into the first do nothing If the baseball is not caught we want it to keep moving so it is out of sight. Under the ball methods, drag in move below the else. Select backward, 5 meters. Click on the world.myfirstmethod tab CheckForCatch: Testing Click the world, methods tab. Drag in CheckForCatch to the bottom. Play your world and move the glove. If the ball is caught, the score should increase to one. If it is not, the ball will keep going. Click restart to play multiple times Making Adjustments If it doesn t catch the ball when it looks like it should, you may need to change the checkforcatch method. Increase the.3 to make it easier or decrease it to make it harder (This will make it only catch if it hits the very middle of the glove) If you don t need to change it or you have extra time, try making the throw have a more realistic arc, movement by having the ball moving up then down while it moves backward 20m 5

Repeating until you win We want to keep throwing the ball until it has been caught 3 times. Drag a while into my first method, select true Drag the instructions that we already have into the do nothing. Go to the world functions and drag in a<b. Select expressions, score.value, and 3. This is what my first method should look like so far. Winning the Game When the ball has been caught 3 times, we want to congratulate the player. Click the score in the object tree and under the properties tab drag text to below the while loop. Click other and type You Win! Finished! Now your game is ready. Click play to test it out. Extra Exercises If you didn t do the extra step of making the throw more realistic on slide 17, do that now. Make the catch more realistic by having the ball stop a little bit earlier so it doesn t overlap with the glove. You can do this by either changing where the ball starts, or how far it travels. You might also need to change your check for catch method by increasing the distance allowed. Add a message that says Miss! every time the ball is not caught. 6

Challenge Exercise Add a timer that counts down so the player has to catch the ball three times within 5 seconds. If they don t, the game should stop and a losing message should be displayed. This will be similar to how you kept track of the score. You will need to create a 3D text and a variable. Since each throw takes about 1 second, you can decrement the timer inside the while loop of my first method. Just make sure you set the duration of any methods you add to zero so you don t slow it down The while loop will now have two conditions to keep running because we want the game to stop when you win or run out of time. 7