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

#501 2013-03-26 11:36:56

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: Scripts Workshop: Give and get help with scripts

shifted wrote:

Thanks, that's definitely better than what I have going on.  Just to clarify, will that really keep the arrow from pointing at the mouse cursor while in flight?  (My current model will turn sideways if I move the mouse.)

Also, I was imagining a system that fired one arrow per click, not that you have to hold down LMB, but hey.  Like I said it's way better than what I have.

Thanks

Yes, the arrow would stay pointing at it's target while in flight and not at your mouse. And since you want one shot per click, here's a somewhat-altered script that you could always use:

when gf clicked
forever
 go to [Main Sprite v]
 point towards [Mouse Pointer v]
 if (mouse down?)
  repeat until <(touching [bad guy v]?) or (touching [edge v]?)>
   move (20) steps
  end
  wait until <not (mouse down?)>//This is what causes the 1 shot per click.
 end

I hope that this helps!

With regards,

ErnieParke


http://i46.tinypic.com/35ismmc.png

Offline

 

#502 2013-03-27 11:31:45

shifted
New Scratcher
Registered: 2013-03-26
Posts: 3

Re: Scripts Workshop: Give and get help with scripts

I just got a chance to test everything out and it definitely helped!  Thanks, this is a great resource!

Offline

 

#503 2013-03-28 03:34:52

JH1010
Scratcher
Registered: 2012-05-31
Posts: 1000+

Re: Scripts Workshop: Give and get help with scripts

bump

Offline

 

#504 2013-03-28 10:46:48

7734f
Scratcher
Registered: 2010-12-23
Posts: 500+

Re: Scripts Workshop: Give and get help with scripts

JH1010, you didn't add me to the members list  hmm  Can you add me? I applied.
     With regards,

                             ~7734f


http://internetometer.com/image/38992.png   http://i37.tinypic.com/2qixx6c.png

Offline

 

#505 2013-03-28 18:19:25

LeopardDude
New Scratcher
Registered: 2013-03-28
Posts: 3

Re: Scripts Workshop: Give and get help with scripts

Hey Guys

I had the same problem as john17312 which is on the first page and I tried to add the scripts which are supose to solve the problem but I can seem to find the:
orange change/set y velocity by block
blue change y block by
the orange y velocity block

Help needed. Thanks.

Offline

 

#506 2013-03-28 18:22:50

LeopardDude
New Scratcher
Registered: 2013-03-28
Posts: 3

Re: Scripts Workshop: Give and get help with scripts

Its suppose to say "but I can't seem to find the:"

Offline

 

#507 2013-03-28 18:28:53

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: Scripts Workshop: Give and get help with scripts

LeopardDude wrote:

Hey Guys

I had the same problem as john17312 which is on the first page and I tried to add the scripts which are supose to solve the problem but I can't seem to find the:
orange change/set y velocity by block
blue change y block by
the orange y velocity block

Help needed. Thanks.

Well, the blue [change y by] block is under Motion, and the others you should find by going to Variables, then to "Make a Variable", then typing in "Y Velocity", and finally hitting "Okay"

I hope that this helps!

With regards,

ErnieParke

Last edited by ErnieParke (2013-03-28 18:29:05)


http://i46.tinypic.com/35ismmc.png

Offline

 

#508 2013-03-28 23:22:16

LeopardDude
New Scratcher
Registered: 2013-03-28
Posts: 3

Re: Scripts Workshop: Give and get help with scripts

Thanks so much ErnieParke. I am new to Scratch. I tweaked the numbers and got it to half work but now face another problem. I don't know how to stop my sprites from going through walls. Could you help me? Thanks

Offline

 

#509 2013-03-31 01:43:14

shivadas
Scratcher
Registered: 2010-02-06
Posts: 100+

Re: Scripts Workshop: Give and get help with scripts

Hi, I've been on Scratch for over 3 years now and I was wondering if I could become a member. I'm not a master programmer, but I could definitely be of help, especially to the New Scratchers. Thanks  smile


Please check out my latest project, Hunger Avenger!

Offline

 

#510 2013-04-01 12:38:56

JH1010
Scratcher
Registered: 2012-05-31
Posts: 1000+

Re: Scripts Workshop: Give and get help with scripts

OMG! Pico hit Scripts Workshop! Nooooooooooooooooo!

Offline

 

#511 2013-04-01 13:51:04

xlk
Scratcher
Registered: 2013-03-18
Posts: 57

Re: Scripts Workshop: Give and get help with scripts

I'd like to sign up to help with scripts.

Offline

 

#512 2013-04-01 21:52:29

Epicness123
Scratcher
Registered: 2011-11-12
Posts: 100+

Re: Scripts Workshop: Give and get help with scripts

Sorry.Looks like Pico is taking over the workshop.


I am Epicness123,and I rock!

Offline

 

#513 2013-04-02 01:55:52

JH1010
Scratcher
Registered: 2012-05-31
Posts: 1000+

Re: Scripts Workshop: Give and get help with scripts

7734f, shivadas and xlk added.

Offline

 

#514 2013-04-04 04:39:58

Jeese
New Scratcher
Registered: 2013-04-02
Posts: 6

Re: Scripts Workshop: Give and get help with scripts

Hey guys, I will try to ask help in this topic:

7734f wrote:

Jeese wrote:

Sorry for your effort.
There you go:
http://oi47.tinypic.com/s30t3k.jpg
hope you can see it now.

Cool scripts, but I don't know how you got those. Maybe go to Advanced Topics, and they can help. It's in the bottom section of the forums.

Offline

 

#515 2013-04-04 08:57:35

pixie97
New Scratcher
Registered: 2013-04-04
Posts: 2

Re: Scripts Workshop: Give and get help with scripts

Hi,
Hoping someone may be able to point me in the right direction.
I have a .txt file with a string of numbers in, I want to create a script that will read through the string and then move onto the next line.

I have been able to read and extract the data from the string ok, but I can not seem to be able to move to the next line in the .txt file

Any help appreciated

Offline

 

#516 2013-04-05 17:30:26

CAA14
Scratcher
Registered: 2013-01-14
Posts: 1000+

Re: Scripts Workshop: Give and get help with scripts

B.u.m.p.

Pixie97, I am sorry, but I do not know exactly what you're asking.  sad

Regards,

CAA14

Offline

 

#517 2013-04-05 21:08:48

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: Scripts Workshop: Give and get help with scripts

pixie97 wrote:

Hi,
Hoping someone may be able to point me in the right direction.
I have a .txt file with a string of numbers in, I want to create a script that will read through the string and then move onto the next line.

I have been able to read and extract the data from the string ok, but I can not seem to be able to move to the next line in the .txt file

Any help appreciated

Ohhh... This problem sounds interesting. How exatcly are you reading the .txt file? Are you saving it in a variable and then reading it?

With regards,

ErnieParke


http://i46.tinypic.com/35ismmc.png

Offline

 

#518 2013-04-05 21:35:19

CAA14
Scratcher
Registered: 2013-01-14
Posts: 1000+

Re: Scripts Workshop: Give and get help with scripts

ErnieParke wrote:

pixie97 wrote:

Hi,
Hoping someone may be able to point me in the right direction.
I have a .txt file with a string of numbers in, I want to create a script that will read through the string and then move onto the next line.

I have been able to read and extract the data from the string ok, but I can not seem to be able to move to the next line in the .txt file

Any help appreciated

Ohhh... This problem sounds interesting. How exatcly are you reading the .txt file? Are you saving it in a variable and then reading it?

With regards,

ErnieParke

One idea is that you could copy each line into a list and then say the list...

Regards,

CAA14

Offline

 

#519 2013-04-06 03:23:07

JH1010
Scratcher
Registered: 2012-05-31
Posts: 1000+

Re: Scripts Workshop: Give and get help with scripts

pixie97 wrote:

Hi,
Hoping someone may be able to point me in the right direction.
I have a .txt file with a string of numbers in, I want to create a script that will read through the string and then move onto the next line.

I have been able to read and extract the data from the string ok, but I can not seem to be able to move to the next line in the .txt file

Any help appreciated

The only way I could think of would be to get each digit of the .txt file to be a variable and have a list of these variables for each line.

Offline

 

#520 2013-04-06 04:26:12

wartroin1
New Scratcher
Registered: 2013-02-27
Posts: 2

Re: Scripts Workshop: Give and get help with scripts

I am making a game with lives so I made a varibal called lives and made it so that when the green flag is clicked they set to 3 and if you touch the enemy you lose a life. But I can't figure out how to make it game over when you have lost all 3 lives. Does anyone know how to?   cool

Offline

 

#521 2013-04-06 04:44:16

JH1010
Scratcher
Registered: 2012-05-31
Posts: 1000+

Re: Scripts Workshop: Give and get help with scripts

wartr
oin1 wrote:

I am making a game with lives so I made a varibal called lives and made it so that when the green flag is clicked they set to 3 and if you touch the enemy you lose a life. But I can't figure out how to make it game over when you have lost all 3 lives. Does anyone know how to?   cool

when gf clicked
forever if <(lives)=(0)> //or lives is smaller than 1
broadcast [game over v]
end
end
Use the game over broadcast to make the game over stuff happen.

Last edited by JH1010 (2013-04-06 04:47:01)

Offline

 

#522 2013-04-06 11:07:20

7734f
Scratcher
Registered: 2010-12-23
Posts: 500+

Re: Scripts Workshop: Give and get help with scripts

JH1010 wrote:

wartr
oin1 wrote:

I am making a game with lives so I made a varibal called lives and made it so that when the green flag is clicked they set to 3 and if you touch the enemy you lose a life. But I can't figure out how to make it game over when you have lost all 3 lives. Does anyone know how to?   cool

when gf clicked
forever if <(lives)=(0)> //or lives is smaller than 1
broadcast [game over v]
end
end
Use the game over broadcast to make the game over stuff happen.

Or you could use:

when gf clicked
forever 
 if <(lives) < (1)> 
  broadcast [game over v]
 end

With regards,

7734f


http://internetometer.com/image/38992.png   http://i37.tinypic.com/2qixx6c.png

Offline

 

#523 2013-04-06 13:24:22

minimaster9
Scratcher
Registered: 2012-12-09
Posts: 9

Re: Scripts Workshop: Give and get help with scripts

Wanna know how to make a wall jumping game? Well it's right here!

when gf clicked
set [R-vel v] to [0]
set [L-vel v] to [0]
forever
if <key [right arrow v] pressed?>
change [R-vel v] by (1)
end
if <key [left arrow v] pressed?>
change [L-vel v] by (1)
end
if <key [up arrow v] pressed?>
if <color [#0000FF] is touching [#000000]?>
set [Y-vel v] to [20]
broadcast [Jump v]
end
end
if <not <color [#0000FF] is touching [#000000]?>>
change y by (-5)
end
if <color [#FF0000] is touching [#000000]?>
set [Y-vel v] to [0]
set [R-vel v] to [0]
if <not < <color [#0000FF] is touching [#000000]?> or <key [up arrow v] pressed?> > >
wait (0.5) secs
if <key [up arrow v] pressed?>
set [Y-vel v] to [20]
broadcast [Jump v]
end
set [L-vel v] to [10]
end
end
if <color [#00FF00] is touching [#000000]?>
set [Y-vel v] to [0]
set [R-vel v] to [0]
if <not < <color [#0000FF] is touching [#000000]?> or <key [up arrow v] pressed?> > >
wait (0.5) secs
if <key [up arrow v] pressed?>
set [Y-vel v] to [20]
broadcast [Jump v]
end
set [R-vel v] to [10]
end
end
change x by (R-vel)
change x by ((0) - (L-vel))
change [R-vel v] by ((R-vel) * (-0.2))
change [L-vel v] by ((L-vel) * (-0.2))
when I receive [Jump v]
repeat (10)
if <color [#FF0000] is touching [#000000]?>
set [Y-vel v] to [0]
stop script
end
change y by (Y-vel)
change [Y-vel v] by (-1)
end
set [Y-vel v] to [0]

Offline

 

#524 2013-04-09 04:16:38

JH1010
Scratcher
Registered: 2012-05-31
Posts: 1000+

Re: Scripts Workshop: Give and get help with scripts

Bump

Offline

 

#525 2013-04-10 02:58:50

JH1010
Scratcher
Registered: 2012-05-31
Posts: 1000+

Re: Scripts Workshop: Give and get help with scripts

bump

Offline

 

Board footer