Home
Project Folders
Teacher Resources
Student Resources
How Do I?
Literacy
MWForum
Site Map
Search
Our Team

MWForum Message [Date Index] [Threads] [Authors] [Attachments] [Subscribe]

[Thread Prev] [Thread Next]

To: mwforum@xxxxxxxxxxxxxxxxxxxxxxxxxxxx
Subject: MIA, Ask an Expert: pacman
From: "Daniel Ajoy" <dajoy@xxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 30 Aug 2005 17:20:25 -0500

On 28 Aug 2005 at 23:03, Ask an Expert - Question wrote:

> This is an automatic message sent from the web form at:
> http://mia.openworldlearning.org/howdoi.htm
> 
> from: Andrea Duran <aduran@xxxxxxxxxxxxxxxxxxxxx>
> date: Fri Aug 26 16:51:43 2005
> 
> I'm attempting to make my own pacman game.  I figured the 
> only way I could program the turtle to eat the black lines 
> I drew was to use colorunder.  It works just fine but is 
> there a way I can program the game to know when there is no 
> more black on the screen and move on to the next level 
> (next page).
> 

Hi Andrea,

This is a totally different approach. (project attached)

Each cookie is a turtle. Each cookie runs "eaten" many times.
When a cookie is touched by pacman it makes a sound, it
hides itself and it decreases the value of cookies, when
the variable "cookies" becomes 0, we know that every cookie
has been eaten.

The code is below:

to startup
make "cookies 7
everyone [clickon]
end

to eaten
if touching? who "pacman [
 wable
 ht
 make "cookies :cookies - 1

 if :cookies = 0 [
  everyone [clickoff]
  announce [next level!]
 ]
]
end

Daniel






*****************************
OpenWorld Learning
http://www.openworldlearning.org

Attachment: pacman2.mw2
Description: Binary data


  • Previous by thread: Re: MIA, Ask an Expert: pacman
  • Next by thread: Re: MIA, Ask an Expert: pacman

  • To save an attachment to your computer, PC users should right-click (Mac users, click and hold the mouse button) on the link and then choose 'save target as' from the pop-up menu. A window will then pop up in which you can choose a location for the file.


    © copyright 2001 - 2008