By Maggie Bashford Professor Susan Rodger Duke University July

Similar documents
Let's Race! Typing on the Home Row

Ready, SET, go! By Melissa Dalis Professor Susan Rodger Duke University July 2011

Demo. Getting Started with Alice Demo

Princess & Dragon Version 2

Objects in Alice: Positioning and. Moving Them July 2008

How Tall Are You? Introducing Functions

Once you have chosen the water world this is how your screen should look.

Begin at the beginning," the King said, very gravely, "and go on till you come to the end

How Tall Are You? Introducing Func6ons

Alice. our characters it would be nice to be able to. This can simplify the story and sometimes add. Zoom in on our first character when she talks

Tutorial on Bunny visi/ng his animal friends - parameters, events for Alice 3

Alice and Daisies: Posi/oning and Moving Objects in Alice. By Jenna Hayes under the direc/on of Professor Susan Rodger Duke University July 2008

COMPUTING CURRICULUM TOOLKIT

Princess & Dragon Part 3: A Knight Comes Riding In Cameras & Events

SAVING, LOADING AND REUSING LAYER STYLES

Alice Learning to program: Part Two by Ruthie Tucker and Jenna Hayes Under the direction of Professor Susan Rodger Duke University, July 2008

University Libraries ScanPro 3000 Microfilm Scanner

Create a Simple Game in Scratch

Overview. Scene Changes. Camera Markers in Alice 3. Open a new Alice world

This Photoshop Tutorial 2012 Steve Patterson, Photoshop Essentials.com. Not To Be Reproduced Or Redistributed Without Permission.

Adobe Photoshop Chapter 3 Study Questions /50 Total Points

Learning to Program: Part 2 Wri0ng Methods and Events

C# Tutorial Fighter Jet Shooting Game

ARCHICAD Introduction Tutorial

Before displaying an image, the game should wait for a random amount of time.

Overview. The Game Idea

AIM OF THE GAME GLACIER RACE. Glacier Race. Ben Gems: 20. Laura Gems: 13

Princess & Dragon Part 2: Teaching a Dragon to Fly Methods & Proper:es

The original image. Let s get started! The final rainbow effect. The photo sits on the Background layer in the Layers panel.

Meteor Game for Multimedia Fusion 1.5

UNDERSTANDING LAYER MASKS IN PHOTOSHOP

Pong! The oldest commercially available game in history

ADDING RAIN TO A PHOTO

The Basics. By Jenna Hayes under the direction of Professor Susan Rodger Duke University July

Girls Programming Network. Scissors Paper Rock!

In this project you ll learn how to create a game, in which you have to match up coloured dots with the correct part of the controller.

Scratch for Beginners Workbook

Create Your Own World

Introduction to Turtle Art

Challenge 1: Tami s World

In this project we ll make our own version of the highly popular mobile game Flappy Bird. This project requires Scratch 2.0.

Photoshop Weather Effects Rain

Scrivener Manual Windows Version Part I

MEMORY GAMES ROUND TO THE NEAREST TEN OR HUNDRED

Create a game in which you have to guide a parrot through scrolling pipes to score points.

Creo Revolve Tutorial

CAD Tutorial. CAD Detail Windows. In this tutorial you ll learn about: CAD Detail Windows Exploding and Modifying a CAD Block

Clipping Masks And Type Placing An Image In Text With Photoshop

ALICE TUTORIAL. Introduction to Alice 3

CONCEPTS EXPLAINED CONCEPTS (IN ORDER)

In this project, you will create a memory game where you have to memorise and repeat a sequence of random colours!

Educational Technology Lab

First Steps in Unity3D

Creating Photo Borders With Photoshop Brushes

Getting Started with Osmo Words

Blend Photos With Apply Image In Photoshop

The editor was built upon.net, which means you need the.net Framework for it to work. You can download that here:

Once this function is called, it repeatedly does several things over and over, several times per second:

GameSalad Basics. by J. Matthew Griffis

RETRO 3D MOVIE EFFECT

In this project you ll learn how to create a platform game, in which you have to dodge the moving balls and reach the end of the level.

04. Two Player Pong. 04.Two Player Pong

Final Project Specification

GAME PROGRAMMING & DESIGN LAB 1 Egg Catcher - a simple SCRATCH game

GAME:IT Junior Bouncing Ball

Here s the image I ll be working with:

Timekeeper/Statistical tool for Basketball Sponsor: Prof. Wayne Dyksen & MSU Basketball Team Spring User Guide

How to Make Games in MakeCode Arcade Created by Isaac Wellish. Last updated on :10:15 PM UTC

knitcompanion NextGen for ios Reference Guide

QUICK-START FOR UNIVERSAL VLS 4.6 LASER!

Mr. Giansante. Alice. 3D Programming

The Joy of SVGs CUT ABOVE. pre training series 3. svg design Course. Jennifer Maker. CUT ABOVE SVG Design Course by Jennifer Maker

Making Your World with the Aurora Toolset

Minecraft Hour of Code Adventurer: Answer Sheet & Teacher Tips

Adobe Photoshop CS5 Tutorial

LESSON ACTIVITY TOOLKIT 2.0

Blend Textures With Photos

GameMaker. Adrienne Decker School of Interactive Games and Media. RIT Center for Media, Arts, Games, Interaction & Creativity (MAGIC)

2. Now you need to create permissions for all of your reviewers. You need to be in the Administration Tab to do so. Your screen should look like this:

Would You Like To Earn $1000 s With The Click Of A Button?

Register and validate Step 1

Adding in 3D Models and Animations

Game Maker Tutorial Creating Maze Games Written by Mark Overmars

ADD TRANSPARENT TYPE TO AN IMAGE

Okay, that s enough talking. Let s get things started. Here s the photo I m going to be using in this tutorial: The original photo.

Game Design Curriculum Multimedia Fusion 2. Created by Rahul Khurana. Copyright, VisionTech Camps & Classes

OPERATING INSTRUCTIONS CONTROL CONSOLES

Lesson 2 Game Basics

Objectives Learn how to import and display shapefiles in GMS. Learn how to convert the shapefiles to GMS feature objects. Required Components

Copyright 2017 MakeUseOf. All Rights Reserved.

REVIT - RENDERING & DRAWINGS

Tutorial: Creating maze games

Welcome to the Break Time Help File.

Pong! The oldest commercially available game in history

Car Ad Photoshop Tutorial Miss Van Lenten Tools: Paint brush, Eraser, Quick Selection/Magic Wand, Quick Mask, Layer Mask

understanding sensors

Add in a new ghost sprite, and a suitable stage backdrop.

Release Highlights for BluePrint-PCB Product Version 1.8

12. Creating a Product Mockup in Perspective

1. Reference Guide and Glossary

Transcription:

By Maggie Bashford Professor Susan Rodger Duke University July 2009 www.cs.duke.edu/csed/alice/aliceinschools

Download the Alice World called piñatagamestart.a2w that goes along with this tutorial. Click add objects and add a new 3D Text Object to the world. When it asks what to say, type score: 0.0.

Click add objects and add a new 3D Text Object to the world. When it asks what to say, type score: 0.0.

Once you have created the new text object, right click on it in the object tree and rename it score. ReposiRon the score where you can see it. Use resize and turn to face the camera.

Click on score in your object tree, and then go to the properres tab. Click on the create new variable buton. Name the variable scorevalue, select the type Number, and click the arrow next to value to select other and type 0.

We need to keep track of a few more things during our game. To do this, we will create two world variables. NoRce under the world properres that a list called pinataparts has already been created. This list is used later in the explode method that breaks open the piñata. Now let s create a variable to remember the number of hits needed to break the piñata. Create a world variable called numwinninghits, and set its value to 10. We will use this later to determine if the player has won the game. We also need to set the total amount of Rme. Create a world variable called Rme, and sets its value to 15.

Create a class level method for score called iniralize. Click on scorevalue in the properres tab, drag it into the iniralize method, and set its value to 0. Now go back to the properres tab and find text. Drag text into the iniralize method, and set its value to score: 0.0. Change the duraron for both to 0 seconds.

Find scorevalue in the properres tab and drag it into the method, and choose to increment it by 1. Change the duraron to 0 seconds. Now we need to write a method that will add one point to scorevalue variable when the piñata is hit. Create another class level method, called addpoints.

Next drag text into the addpoints method, set its value to score: and set its duraron to 0 seconds. Next, click on world in the object tree, and find its funcrons tab. Find a joined with b and drag it into where you typed score: and select default string for b. Then drag what as a string into default string, and select score.scorevalue from expressions.

Now let's divide the game into three parts: the set up and instrucrons, the game play, and what happens when the game is over. Click on world in the object tree and create a new world method called setup. Now click on score in the object tree and drag its method iniralize into the setup method.

Now let's add instrucrons for playing the piñata game. The text object called instrucrons has already been added to the world, and its text is Break the piñata! Click on instrucrons in the object tree and select its properres. Drag isshowing into the setup method, and choose true. Next drag text into setup, and set it to Press the up arrow... Repeat this step with the text and set it to...to swing the bat. Set each duraron to 2 seconds so there is enough for the player to read the instrucrons.

For fun, let s swing the bat during the last instrucron. Drag a Do together into the setup method, then the last instrucron to swing the bat inside it. Then drag a Do in order below that. Now let s swing the bat. Click on baseballbat in the object tree and drag the turn method into the Do in order, then select backward and ¼ revoluron. Set the duraron to.25 seconds and the style to abruptly. Make a copy of this line, and change its direcron to forward.

Now let's prepare the player to start the game. Select instrucrons from the object tree and drag text three Rmes into the setup method outside of the Do together. First set the text to Ready? then Set then Go! Now we want to hide the instrucrons. Drag in the isshowing property and set it to false, then change its duraron to 0 seconds. The final step in the setup method is to start the Rmer. Find Rmer in the object tree and drag its iniralize method into the botom of setup and select the parameter world.rme from expressions.

Check your setup method to see if you missed anything! You can test it by selecrng it When the world starts, but remember to set it back to my first method when you are done!

Now that the clock has been set, we need to swing the piñata. Create a new world method called playgame. Drag a while loop into the playgame method. Now click on the funcrons tab and drag a>=b into the condiron, then select Rmer.RmeLei from expressions for a and 0 for b. Now we want the piñata to move while the Rmer goes down, so drag a Do together into the while loop. Next drag two copies of a Do in order inside the Do together.

In the first Do in order, we will make the Rmer count down. Click on Rmer in the object tree, and click on the properres tab. Drag text into the first Do in order, and choose default string for now. Change its duraron to 0 seconds. Then go back to the world funcrons and replace default string with what as a string. Select Rmer.RmeLei from expressions as the what.

We want to count down the seconds, so drag Wait from the botom of the screen, and select 1 second. Next find RmeLei from the Rmer properres and drag it into the Do in order. Select decrement Rmer.RmeLei by 1.

Now let's use the second Do in order to make the piñata swing! Go to the piñata methods and drag in turn, then select right and other to type in.1 revolurons. Now change the style to abruptly, duraron to.5 seconds, and asseenby to camera. Right click and make a copy of this line, and change the direcron to lei.

To perform the post game animaron, create a new world method called gameover. The first step aier the game ends is to move the piñata back to the center. Click on piñata and drag the turn method into gameover. Select right and.05 revolurons, then change asseenby to camera and duraron to.5 seconds. Now we will base our acrons on whether or not the player won the game. Drag an If/Else statement into the method. Go to the world funcrons and drag a>=b into the If condiron. From expressions, select score.scorevalue then world.numwinninghits.

Click on baseballbat in the object tree and drag the roll method into the If statement. Select right then other and type 1.25 revolurons. A text object called gameovertext is included in the world, and it has already been set to say Felicidades!. Go to its properres tab, then drag isshowing into the If statement and select true. Set the duraron to 0 seconds. The explode method has already been writen to make the piñata burst. Find explode in the world methods and drag it into the If statement.

Now let s create the animaron for when the player loses. Drag a Do together into the Else. Find baseballbat in the object tree, and drag the roll method into the Do together, then select right and.25 revolurons. Now make a copy of this line and change the object to the piñata.

Now we need to change the text for when the player loses. Click on the gameovertext and find its properres. Drag text into the Else statement under the Do Together, then set it to Qué lásrma! with a duraron of 0 seconds. Qué lás*ma! is What a shame! in Spanish. See the next page for how to type accents Next, drag in color and set it to light gray with a duraron of 0 seconds. In the final step, drag isshowing into the Else, select true, and set the duraron to 0 seconds.

PC: (use the keypad and make sure you have num lock on) á = Alt + 0225 é = Alt + 0233 í = Alt + 0237 ó = Alt + 0243 ú = Alt + 0250 ñ = Alt + 0241 = Alt + 0161 = Alt + 0191 Mac: á = OpRon + e, then a é = OpRon + e, then e í = OpRon + e, then i ó = OpRon + e, then o ú = OpRon + e, then u ñ = OpRon + n, then n = OpRon + 1 = OpRon + Shii +?

Now we need to call the three methods we have made in my first method. Click on the my first method tab, then find the new methods and drag them in. Do this for the setup, playgame, and gameover methods. This is all that we will include in my first method.

If you try playing the game, you will see that the piñata swings across the screen but there is no way to hit it. Create a new world method called bathit. This method will turn the bat toward the piñata, check to see if the piñata has been hit, then turn the bat back. Drag an If/Else statement into the bathit method. Then find the world funcrons and drag a>b into the If condiron, then select Rmer.RmeLei from expressions and 0. Click on the baseballbat and drag its turn method into the If statement. Select backward and ¼ revoluron, then change the duraron to.3 and the style to abruptly.

Make a copy of the turn method, and change its direcron to forward. Now drag another If/Else statement between the two turn methods. Next find Wait at the botom and drag it below the second turn method, srll inside the If statement. Select other and type.3 seconds.

Now we want to check that the bat has hit the piñata. Go to the world funcrons, find both a and b, and drag it into the inner If condiron. Drag a<b into both parts and choose any values. Click on baseballbat and go to its funcrons tab. Drag baseballbat distance to the lei of into the first number and choose piñata. Then drag baseballbat distance to the right of into the third number and choose piñata.

Now click on piñata in the object tree and find its funcrons. Drag piñata s width into the two remaining spots. But since the measurement is from the center, we must divide piñata s width by 2. Click the arrow next to it and select math, piñata s width /, then 2. Do this for both places where you dragged piñata s width.

To finish the method, click on score in the object tree, then drag the addpoints method into the If statement. This will give the player points only when the bat has hit the piñata.

Now we need to create two events: one to recognize when the player wins and another to swing the bat when the player presses the up key. Click create new event in the top of the window, and select While something is true. Right click on the blue area of the new event and select change to then When something becomes true.

Go to the world funcrons and drag a>=b into the condiron. Select score.scorevalue from expressions then world.numwinninghits from expressions. Click on Rmer in the object tree then go to the properres tab. Drag RmeLei into the do Nothing and select set value to and choose 0. This will end the game when the player reaches the required number of hits.

Now click create new event and select When a key is typed. Change any key to Up. Then click the arrow next to Nothing and change it to bathit.

Now you are ready to play the game! Click play and try your best to break the piñata.