This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2011-09-15 03:01:32

josh111111
New Scratcher
Registered: 2011-09-08
Posts: 4

Help with this maze game

so I am slowly getting accustomed to scratch and now I am planning to create this maze game and I need help making it work. I will be trying to work on my own version but it would be nice if someone can also help me make this work

http://scratch.mit.edu/projects/josh111111/2029777

I want to make sure the following happens
1. If the cat goes touches the walls of the maze, the game is over and the user failed. Indicate this by having the cat say "Game over!" and stopping the program.

2.if the cat reaches the goal of the cheesy puffs, the game is over and the user
succeeded. Indicate this by having the cat say "You win!" and stopping the program.

3. Movement of the cat should match the arrow keys. Handle the event of the left arrow being pressed by moving the cat right (i.e., the cat's X coordinate should get larger). Handle the event of the down arrow being pressed by moving the cat down (i.e., the cat's Y coordinate should get smaller).

4. I also want to end the game properly when the cat touches the goal or the walls of the maze.

Offline

 

#2 2011-09-15 07:56:04

AtomicBawm3
Scratcher
Registered: 2009-06-27
Posts: 1000+

Re: Help with this maze game

Normally the right arrow key moves the player right, but I guess if you want to make it tricky...those other scripts are pretty easy:

When Flag Clicked
go to: start location
forever
   if <touching wall> OR <touching color [wall color]>
      say "You Lost!" for 2 seconds
      Stop All
   if <touching cheese-puffs>
      say "You Win!" for 2 seconds
      Stop All
   [controls can then go here]


http://i50.tinypic.com/j0yw0p.jpg

Offline

 

#3 2011-09-15 16:34:25

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: Help with this maze game

<when green flag clicked>
<forever>
      <if><key[ up ]pressed?>
            <change y by( 3 )>
      <end>
      <if><key[ down ]pressed?>
            <change y by( -3 )>
      <end>
      <if><key[ left ]pressed?>
            <change x by( 3 )>
      <end>
      <if><key[ right ]pressed?>
            <change x by( -3 )>
      <end>
      <if><touching color[ red ]>
            <broadcast[ game over ]and wait c>
            <stop all>
      <end>
      <if><touching[ cheesesy puffs ]>
            <broadcast[ winner ]and wait c>
            <stop all>
      <end>
<end>

Last edited by MoreGamesNow (2011-09-15 16:36:14)


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

Board footer