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.
Offline
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?
Offline
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)
Offline
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
Thanks, that worked. And the enemies thing?
Offline
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
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.
Offline