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

#1 2008-10-10 21:49:20

Madderhatter
Scratcher
Registered: 2008-10-10
Posts: 4

New guy, and his questions.

Hey there, I have always been interested in making games, and Scratch is now my second favorite template (after flash 8). However, it won't let me post on the FAQ for some reason, so I brought my FAQs here. Sorry! So, I am making an overhead view adventure game, and I put a green line on each edge. I tried to make it so when the charachter touches the line, he goes to a different background. Sounds simple right?  Wrong. So please help, and thanks.


http://i300.photobucket.com/albums/nn25/sparky420times/Mad_Hatter_by_Tsumekuro.jpg/img/small_logo.png

Offline

 

#2 2008-10-10 22:47:29

ihaveamac
Scratcher
Registered: 2007-09-22
Posts: 1000+

Re: New guy, and his questions.

The FAQ is Frequentally Asked Questions. Only the Scratch Team can post new topics there.
As for your game, try this script for the character:

<when green flag clicked>
<repeat until><touching[ line name
<if><key[ left arrow ]pressed?>
<change x by( 3
<end>
<if><key[ right arrow ]pressed?>
<change x by( -3
<end>
<end>
<broadcast[ new background

For the background:

<when green flag clicked>
<switch to costume[ background1

<when I receive[ new background
<switch to costume[ background2

Does that help?


~ihaveamac - visit ihaveamac.net

Offline

 

#3 2008-10-12 12:24:17

Madderhatter
Scratcher
Registered: 2008-10-10
Posts: 4

Re: New guy, and his questions.

That helps a lot thanks. It didn't quite work, but I think I see the problem. Three more questions however: If it doesn't work, is there some way I can post the game, and let others see the problem? And, is there a way to create random movement? Like one of those bouncing screensavers, where the ball rolls around randomly and bounces of the edges. And finally,how do I make it so when all enemys have been defeated, it goes to the next level. Does the next level have to be a new game? Thanks.

Last edited by Madderhatter (2008-10-12 13:00:51)


http://i300.photobucket.com/albums/nn25/sparky420times/Mad_Hatter_by_Tsumekuro.jpg/img/small_logo.png

Offline

 

#4 2008-10-13 16:21:07

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: New guy, and his questions.

Madderhatter wrote:

That helps a lot thanks. It didn't quite work, but I think I see the problem. Three more questions however: If it doesn't work, is there some way I can post the game, and let others see the problem? And, is there a way to create random movement? Like one of those bouncing screensavers, where the ball rolls around randomly and bounces of the edges. And finally,how do I make it so when all enemys have been defeated, it goes to the next level. Does the next level have to be a new game? Thanks.

Well, as for your game posting, just click "share" and ask others to download it and find the problem. As for the random movement, you can use this script:

when (green flag) clicked
point in direction (pick random 0 to 360)
move 5 steps
forever
if on edge, bounce

Offline

 

#5 2008-10-13 22:44:09

Madderhatter
Scratcher
Registered: 2008-10-10
Posts: 4

Re: New guy, and his questions.

Thanks, that worked. And the enemies thing?


http://i300.photobucket.com/albums/nn25/sparky420times/Mad_Hatter_by_Tsumekuro.jpg/img/small_logo.png

Offline

 

#6 2008-10-14 09:00:03

tro95
Scratcher
Registered: 2008-02-20
Posts: 78

Re: New guy, and his questions.

For the enemies you just make a variable for each ie: Enemy 1 status, Enemy 2 status.
If the enemy is living then have the variable at 0, the second he dies change it to 1. Then enter this script:

[blocks]<when green flag clicked>
<forever>
<if><< <( <{ Enemy status 1 }> <=> 1 )> <and> << <( <{ Enemy status 2 }> <=> 1 )> <and> <( <{ Enemy status 3 }> <=> 1 )> >> >>
<broadcast[ Next level
<end>
<end>

Offline

 

#7 2008-10-14 14:15:49

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: New guy, and his questions.

Or, you can keep track of the total number of enemies and when that gets to zero, send a broadcast message to start a new level.  Then, set it up so that the stage will recieve the message and show a new background.    Other sprites will probably need to take some action too to prepare for the new level.  But the key to it all is Broadcast messages.


http://i39.tinypic.com/2nav6o7.gif

Offline

 

Board footer