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

#1 2008-09-14 22:39:58

wizeguywilly
Scratcher
Registered: 2008-09-14
Posts: 6

Help with programing

I'm making a little computer game and point of it is to shoot a ball at a key that is moving back and forth.  If you hit it I programmed to fall out of the sky.  That worked great, but when I hit the button with the flag on it, the key won't go back and forth any more.   It just sits there facing the wrong direction.  Any ideas on what I should do would be greatly appreciated!

Wizeguywilly

Offline

 

#2 2008-09-14 22:59:05

keroro645
Scratcher
Registered: 2008-06-07
Posts: 1000+

Re: Help with programing

Could you post some pics of scripts or post the project

Offline

 

#3 2008-09-14 23:04:16

wizeguywilly
Scratcher
Registered: 2008-09-14
Posts: 6

Re: Help with programing

I just posted it.  It's called bounce.

Offline

 

#4 2008-09-14 23:07:52

wizeguywilly
Scratcher
Registered: 2008-09-14
Posts: 6

Re: Help with programing

It doesn't even seem to be going back and forth now.  It only goes back and forth the first time I run it.

Offline

 

#5 2008-09-14 23:12:35

deatheater
Scratcher
Registered: 2008-04-11
Posts: 1000+

Re: Help with programing

wizeguywilly wrote:

I'm making a little computer game and point of it is to shoot a ball at a key that is moving back and forth.  If you hit it I programmed to fall out of the sky.  That worked great, but when I hit the button with the flag on it, the key won't go back and forth any more.   It just sits there facing the wrong direction.  Any ideas on what I should do would be greatly appreciated!

Wizeguywilly

add this script to the background

<when green flag clicked>
<set{ shooting }to( 0

and add this to the background


<when[ space ]key pressed>
<set{ shooting }to( 1


now make this the projectile's script


<when green flag clicked>
<forever>
<if><( <{ shooting }> <=> 0 )>
<go to[ gun thiing
<else>
<change y by( 2
<if><< <touching[ key <or> <touching[ edge >>
<set{ shooting }to( 0
<end>
<end>

Hope I helped  smile

Offline

 

#6 2008-09-14 23:13:05

terminator355
Scratcher
Registered: 2008-07-31
Posts: 100+

Re: Help with programing

wizeguywilly wrote:

It doesn't even seem to be going back and forth now.  It only goes back and forth the first time I run it.

just post a pic of the script that is a problem and we might be able to help.

Terminator355

I'd love to help!


No new stuff for now guys  wink  join me for some Black Ops on xbox: termhn or for some rock band on PS3: rocket232

Offline

 

#7 2008-09-14 23:24:27

terminator355
Scratcher
Registered: 2008-07-31
Posts: 100+

Re: Help with programing

try this in the key's:

When green flag clicked
Forever
change x by -10
If <touching bullet>
Hide
Goto x 480 y 180
Show
End
End

Use deatheater's script for the bullet and add "point towards mouse pointer".

Hope that helped!  smile

Terminator355


No new stuff for now guys  wink  join me for some Black Ops on xbox: termhn or for some rock band on PS3: rocket232

Offline

 

#8 2008-09-14 23:53:48

wizeguywilly
Scratcher
Registered: 2008-09-14
Posts: 6

Re: Help with programing

I'm not sure what block you mean when you say end.

Offline

 

#9 2008-09-14 23:59:13

terminator355
Scratcher
Registered: 2008-07-31
Posts: 100+

Re: Help with programing

wizeguywilly wrote:

I'm not sure what block you mean when you say end.

it just ends the if/forever, just ignore them  hmm


No new stuff for now guys  wink  join me for some Black Ops on xbox: termhn or for some rock band on PS3: rocket232

Offline

 

Board footer