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

#1 2009-04-04 19:11:23

GodofGuns
Scratcher
Registered: 2008-06-01
Posts: 100+

Help with game script please!

I am trying to make a game based off of this game http://www.maxgames.com/play/music-catch-2.html I am trying to make the notes do the movement of the notes in the game. If you have NOT played the game just hit play. If you have played this game before set it to these settings.

Music-Any you choose
Shapes-Any you choose (I am making circles for the shapes)
Pattern-In & Out
Motion-Right
Randomize-Off

Here is the script

<when green flag clicked>
<forever>
<if><touching[ Note Collector
<go to x sad  165 )y sad  <pick random( 162 )to( -162
<hide>
<wait( 1 )secsc>
<else>
<show>
<glide( 0.3 )secs to x sad  100 )y sad  <y position>
<glide( 0.4 )secs to x sad  65 )y sad  <y position>
<glide( 0.5 )secs to x sad  45 )y sad  <y position>
<glide( 0.6 )secs to x sad  15 )y sad  <y position>
<glide( 0.5 )secs to x sad  -30 )y sad  <y position>
<glide( 0.6 )secs to x sad  -45 )y sad  <y position>
<glide( 0.8 )secs to x sad  -100 )y sad  <y position>
<glide( 1 )secs to x sad  -160 )y sad  <y position>
<glide( 1 )secs to x sad  -100 )y sad  <y position>
<glide( 0.8 )secs to x sad  -65 )y sad  <y position>
<glide( 0.6 )secs to x sad  -45 )y sad  <y position>
<glide( 0.5 )secs to x sad  -15 )y sad  <y position>
<glide( 0.6 )secs to x sad  30 )y sad  <y position>
<glide( 0.5 )secs to x sad  45 )y sad  <y position>
<glide( 0.4 )secs to x sad  100 )y sad  <y position>
<glide( 0.3 )secs to x sad  160 )y sad  <y position>
<end>

Now what I'm not getting is WHY WON'T IT WORK!!! The only thing I don't want is for the screen or notes to rotate. Any help out there?

Last edited by GodofGuns (2009-04-04 19:13:10)


♦Check out my Flash Remixes and other games!♦

Offline

 

#2 2009-04-05 07:42:21

djmoomoo
Scratcher
Registered: 2007-08-31
Posts: 57

Re: Help with game script please!

If you don't want a sprite to visually rotate, check the little square icon next to the sprite's name text field. The three boxes are:-

• Spin
• Flip
• Don't spin or flip


There are 0011 types of people, those that can count in binary and those that can't.

Offline

 

#3 2009-04-05 10:48:02

GodofGuns
Scratcher
Registered: 2008-06-01
Posts: 100+

Re: Help with game script please!

djmoomoo wrote:

If you don't want a sprite to visually rotate, check the little square icon next to the sprite's name text field. The three boxes are:-

• Spin
• Flip
• Don't spin or flip

That's not what I was asking for.


♦Check out my Flash Remixes and other games!♦

Offline

 

#4 2009-04-05 11:04:04

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

Re: Help with game script please!

Hi GodofGuns -

That looks like a great game to redo in Scratch!  I was wondering if you could Share what you have so far and tell us what part isn't working the way you want it.  That would save us a lot of time.

Looking at your blocks though, I think your problem is with the Glide block.  When your script starts running a Glide block, it's not going to be checking to see if it is touching the collector sprite.  Maybe you should try setting up two loops, one that controls "Normal" motion of the notes and one that checks to see if the collector has been touched and handles that case.  The challenge is going to be how to stop the "Normal" motion when the collector has been touched.  smile


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

Offline

 

#5 2009-04-05 11:22:06

GodofGuns
Scratcher
Registered: 2008-06-01
Posts: 100+

Re: Help with game script please!

Paddle2See wrote:

Hi GodofGuns -

That looks like a great game to redo in Scratch!  I was wondering if you could Share what you have so far and tell us what part isn't working the way you want it.  That would save us a lot of time.

Looking at your blocks though, I think your problem is with the Glide block.  When your script starts running a Glide block, it's not going to be checking to see if it is touching the collector sprite.  Maybe you should try setting up two loops, one that controls "Normal" motion of the notes and one that checks to see if the collector has been touched and handles that case.  The challenge is going to be how to stop the "Normal" motion when the collector has been touched.  smile

Thanks and I am not sure what you are trying to tell me. Could you give me an example or something? Also another game I am making is a game based from a console game called Left 4 Dead. Have you heard of it? Anyway I am having trouble with the zombie A.I I am trying to make the zombie go towards the player. It works at first but when you go past the zombie it stops. Then when you go back in front of it. It goes away from you pointing backwards. Here is the script. (Sorry for so many of these by the way). This isn't the entire script but I am sure the first part of it is not the problem. But I am suspicious of this script.

If X position <(  <>>  )> X position of Sprite 4 (shooter) and touching color black (ground)
<move( 4 )steps>
<else>
<point in direction( 90
<glide( 3 )secs to x sad  x position of Sprite 4 )y sad  -1

I think that the X position of Sprite 4 needs to be negative but I'm not sure how to do that. Can you help me out with that too? Sorry if this is a bit too much to ask for.


♦Check out my Flash Remixes and other games!♦

Offline

 

#6 2009-04-05 14:29:08

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

Re: Help with game script please!

I've set up a demonstration of how to set up two loops - one for handling the motion and another for looking for collisions:

http://scratch.mit.edu/projects/Paddle2SeeFixIt/478561

As for your other game, to make the x position negative, just subtract it from Zero  smile

[blocks]
((  0 <-> X Position of Sprite 4  ))
[/blocks]


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

Offline

 

#7 2009-04-05 16:39:50

GodofGuns
Scratcher
Registered: 2008-06-01
Posts: 100+

Re: Help with game script please!

Paddle2See wrote:

I've set up a demonstration of how to set up two loops - one for handling the motion and another for looking for collisions:

http://scratch.mit.edu/projects/Paddle2SeeFixIt/478561

As for your other game, to make the x position negative, just subtract it from Zero  smile

[blocks]
((  0 <-> X Position of Sprite 4  ))
[/blocks]

The first thing is helpful although even with the -0 part it still didn't work.


♦Check out my Flash Remixes and other games!♦

Offline

 

#8 2009-04-05 16:41:47

GodofGuns
Scratcher
Registered: 2008-06-01
Posts: 100+

Re: Help with game script please!

Oh wait never mind. I had it stuck on Sprite 1 :p


♦Check out my Flash Remixes and other games!♦

Offline

 

Board footer