Memory Matching Challenge

Slides:



Advertisements
Similar presentations
SimpleGameInAlice1 Barb Ericson Georgia Institute of Technology June 2008 Creating a Simple Game in Alice.
Advertisements

Visual Lists By Chris Brown under Prof. Susan Rodger Duke University July 2012.
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?
Objects in Alice: Positioning and Moving Them By Jenna Hayes under the direction of Professor Susan Rodger Duke University July
Alice Learning to program: Part Four Creating Sounds, Making Billboards, Fun with 3-D Text, New Events, and Rotating Objects by Ruthie Tucker and Jenna.
Coloring Randomly: Random Selection in Alice By Jenna Hayes under the direction of Professor Susan Rodger Duke University July 2008.
How Tall Are You? Introducing Functions By Jenna Hayes under the direction of Professor Susan Rodger Duke University July 2008 Updates made June 2014 by.
Princess & Dragon Part 2: Teaching a Dragon to Fly—Methods & Properties By Elizabeth Liang under the direction of Professor Susan Rodger Duke University.
Lets Play Catch! Keeping Score in Alice By Francine Wolfe Duke University Professor Susan Rodger May 2010.
Asteroids! Michael Marion under Prof. Susan Rodger Duke University July2012.
Alice Variables Pepper. Set to Java look Edit / preferences restart.
Wizard Game: Class-Level Variables in Alice By Jenna Hayes Under the direction of Professor Susan Rodger Duke University, July
Creating a 3D Interactive Story Prof. Susan Rodger Duke University Feb. 24, 2007.
Calvin and Hobbes Teach Properties and Functions Created by Daniel MacDonald under the direction of Professor Susan Rodger Duke University June 2013.
Methods Tutorial: Part One By Deborah Nelson Duke University Under the direction of Professor Susan Rodger June 9, 2008.
Shorter of two objects and changing color Functions, events and setting the color Susan Rodger, Duke University June 2008.
Line up By Melissa Dalis Professor Susan Rodger Duke University June 2011.
by Chris Brown under Prof. Susan Rodger Duke University June 2012
Making a Boat Racing Game in Alice By Jenna Hayes Under the direction of Professor Susan Rodger Duke University, July 2010.
Shorter of two objects and changing color V2 Functions, events and setting the color in sequence and randomly This is a modification of the Changing Color.
Introduction to Arrays. definitions and things to consider… This presentation is designed to give a simple demonstration of array and object visualizations.
Nonvisual Arrays and Recursion by Chris Brown under Prof. Susan Rodger Duke University June 2012.
Alice Pong Recreating Pong in Alice By Elizabeth Liang under the direction of Professor Susan Rodger Duke University June 2010.
Changing Color, Using Text Objects, and Random Selection in Alice By Jenna Hayes Under the direction of Professor Susan Rodger Duke University, July 2008.
VB Games: Preparing for Memory Brainstorm controls & events Parallel structures (again), Visibility, LoadPicture, User-defined procedures, Do While/Loop,busy.
By Melissa Dalis Professor Susan Rodger Duke University June 2011 Multiplication Table.
Making a Timer in Alice By Jenna Hayes under the direction of Professor Susan Rodger Duke University July
Piñata Game: Keeping Score in Alice By Maggie Bashford Professor Susan Rodger Duke University July
Skater World: Part Two By Deborah Nelson Duke University Under the direction of Professor Susan Rodger June 1,
Visual Basic Games: Week 4 Recap Parallel structures Initialization Prepare for Memory Scoring Shuffling Homework: when ready, move on to next game/chapter.
Can I get your number? By Melissa Dalis Professor Susan Rodger Duke University June 2011.
Balancing the scales: Inequalities By Melissa Dalis Professor Susan Rodger Duke University June 2011.
Nonvisual Arrays by Chris Brown under Prof. Susan Rodger Duke University June 2012.
Ready, SET, go! By Melissa Dalis Professor Susan Rodger Duke University July 2011.
Creating a 3D Interactive Story Prof. Susan Rodger Duke University July 19, 2007.
Changing Camera Views! Part 1: Set Point of View to By Bella Onwumbiko under the direction of Professor Susan Rodger Duke University July 2013 Updates.
Creating a Fancier Chicken to use in several worlds - Inheritance Susan Rodger Duke University June 2009.
How Tall Are You? Introducing Functions for Alice 3 By Jenna Hayes under the direction of Professor Susan Rodger Duke University July 2008 Updates made.
Tutorial on Bunny visiting his animal friends - parameters, events for Alice 3 Susan Rodger Duke University June 2009 Updated by Yossra Hamid on October.
Under the direction of Susan Rodger
Jonathon Kuo Under the Direction of Dr. Susan Rodger
Creating a UFO Rescue Game in Alice
By Melissa Dalis Professor Susan Rodger Duke University June 2011
A Simple Quiz for Alice 3.2:
An Introduction to Alice (Short Version)
Teaching Characters to Walk: Learning Methods, Part 1
Event Listener Assessment
Comparing objects and changing color
Making a Timer This is an modification of the July 2008 timer tutorial by Jenna Hayes By Natalie Huffman Under the direction of Susan Rodger Duke University.
Under the direction of Susan Rodger
Changing Color, Using Text Objects, and Random Selection in Alice
Making Objects Move in Unison: Using Lists
Let's Race! Typing on the Home Row
Introduction to Events
Creating a UFO Rescue Game in Alice
Making Objects Move in Unison: Using Lists
Building a Scorekeeper Alice 3 Tricks in Mini Trivia (1/4)
A Simple Quiz for Alice 3.2:
Alice Variables Pepper.
Under the direction of Susan Rodger
Objects in Alice: Positioning and Moving Them
Arrays
Princess & Dragon Part 2: Teaching a Dragon to Fly—Methods & Properties By Elizabeth Liang under the direction of Professor Susan Rodger Duke University.
Visual Basic: Week 5 Review User defined functions
Restricting an Event with a Conditional
How Tall Are You? Introducing Functions
Alice 3 Programming Assessment: Lists
under the direction of Professor Susan Rodger
Restricting Events Creating Conditional Events in Alice By Henry Qin
Presentation transcript:

Memory Matching Challenge By Natalie Huffman Under the direction of Susan Rodger Duke University June 2017

Game This game is a memory matching game The user can click on two cards at a time, making them turn over If they match, they will vanish If not, they both turn back over Try to match up all the cards in as few moves as possible!

To Add We have three methods we want to edit: myFirstMethod Restart Move an element from the list cards up 2.4 meters Set an element from the list nums to -1 Restart Move all the cards to this.billboard Reset the property gone to 0 initializeEventListeners Turn a card .5 revolutions right when it is clicked on Update number of tries, change the text to reflect it Run the restart procedure when restart button is clicked

The comments in the code will tell you where your additional code should go Make sure that anything you add goes directly under the corresponding comment The code has to be in the right order to work

Go to myFirstMethod We have generated a random number, which is called random We want to move the random-th billboard in the list cards UP 2.4 meters It should look like the UP and LEFT move statements in the following do in order block

Then we want to set the random-th number in the list nums to -1 so we never move the same card twice (use the assign block) This should look like the assignment statement in the following do in order block

Go to restart Look for the do together block with the comment We want to use the local variable card2 to move all of the items in the list cards to this.billboard The each in __ together block uses card2 to represent one item in the list cards If you perform an action on card2, Alice will perform that action on all the items in cards

We need to reset all of our variables so we can restart the game The variable gone holds the number of successful matched cards, so we can know when the game is over We want to reset gone to 0, so the score is reset to 0 Gone is a property of the scene

Go to initializeEventListeners First, some definitions: cardsTurned is the number of cards that have been turned over Board1 is a property that stores the value of the first card clicked, so that when the second card is clicked we know what the first one was win is a boolean property that holds the value of whether or not the user has won (since we don’t want them to turn over cards if they’ve already won) getModelAtMouseLocation stores the value of whatever was just clicked on

Go to initializeEventListeners First, we will edit the first addMouseClickOnObjectListener block, which is for the cards We want to put a statement where the comment is to turn the card the user clicks RIGHT .5 revolutions Remember– what variable holds the value of whatever was just clicked on?

At the end of the “else” block, we want to add 2 statements One will update tries by one Tries is a property of score, the TextModel seen above the white rabbit The other will set the value of score to tries

Second addMouseClickOnObjectListener Now we will edit the second addMouseClickOnObjectListener, which is for the restart button When the user clicks on the restart button, we want the restart procedure to run Restart is a scene procedure

Run the game! As you click cards, they should turn over If they match, they will vanish Try to win in as few moves as possible!