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

#1 2009-11-15 23:49:22

marioman119
Scratcher
Registered: 2008-01-03
Posts: 38

Problem with a script... any help appreciated...

I have a script that goes something like this:

[blocks] <if><touching[Player 2
<turn cw( 180 )degrees>
<move( 50 )steps>
<end> [/blocks]

And I have it applied to both players, but for some reason, only the one charging the other gets send back. How do I fix this?


<forever>
<move(1)steps>

Offline

 

#2 2009-11-16 01:21:55

fg123
Scratcher
Registered: 2008-11-13
Posts: 1000+

Re: Problem with a script... any help appreciated...

Turning a specific way doesn't always work. Why don't you try:
[blocks]
<point in direction( (( 180 <+> <direction> ))
[/blocks]

It should work.


Hai.

Offline

 

#3 2009-11-16 01:51:37

Chrischb
Scratcher
Registered: 2008-07-24
Posts: 1000+

Re: Problem with a script... any help appreciated...

Are the <touching [Player _]> blocks different in both of the players?


I fall: It's a tragedy. You fall: It's comedy.
Hmph enjoy your fall - I get a lovely spring... without pans of new leaves.

Offline

 

#4 2009-11-16 18:50:54

marioman119
Scratcher
Registered: 2008-01-03
Posts: 38

Re: Problem with a script... any help appreciated...

fg123 wrote:

Turning a specific way doesn't always work. Why don't you try:
[blocks]
<point in direction( (( 180 <+> <direction> ))
[/blocks]

It should work.

No, I mean, I want them to actually MOVE backwards. Which works except that only the player charging gets sent backwards.


<forever>
<move(1)steps>

Offline

 

#5 2009-11-16 18:52:05

marioman119
Scratcher
Registered: 2008-01-03
Posts: 38

Re: Problem with a script... any help appreciated...

Chrischb wrote:

Are the <touching [Player _]> blocks different in both of the players?

What do you mean by that?


<forever>
<move(1)steps>

Offline

 

#6 2009-11-16 18:56:24

fg123
Scratcher
Registered: 2008-11-13
Posts: 1000+

Re: Problem with a script... any help appreciated...

marioman119 wrote:

fg123 wrote:

Turning a specific way doesn't always work. Why don't you try:
[blocks]
<point in direction( (( 180 <+> <direction> ))
[/blocks]

It should work.

No, I mean, I want them to actually MOVE backwards. Which works except that only the player charging gets sent backwards.

I mean replace your turn 180 with my script.


Hai.

Offline

 

#7 2009-11-16 18:59:39

marioman119
Scratcher
Registered: 2008-01-03
Posts: 38

Re: Problem with a script... any help appreciated...

fg123 wrote:

marioman119 wrote:

fg123 wrote:

Turning a specific way doesn't always work. Why don't you try:
[blocks]
<point in direction( (( 180 <+> <direction> ))
[/blocks]

It should work.

No, I mean, I want them to actually MOVE backwards. Which works except that only the player charging gets sent backwards.

I mean replace your turn 180 with my script.

Alright, I'll give it a try.


<forever>
<move(1)steps>

Offline

 

#8 2009-11-16 19:03:08

marioman119
Scratcher
Registered: 2008-01-03
Posts: 38

Re: Problem with a script... any help appreciated...

It didn't work. You see, there's nothing wrong with the turning, there's a problem with having BOTH players be sent back 50 steps.


<forever>
<move(1)steps>

Offline

 

#9 2009-11-16 19:52:16

marioman119
Scratcher
Registered: 2008-01-03
Posts: 38

Re: Problem with a script... any help appreciated...

Bump


<forever>
<move(1)steps>

Offline

 

#10 2009-11-16 20:00:43

Flait7
Scratcher
Registered: 2008-04-14
Posts: 100+

Re: Problem with a script... any help appreciated...

If you want the sprites to move in the EXACT opposite direction, i suggest <move( -x )steps>


http://scratch.mit.edu/static/projects/Flait7/2248016_sm.pnghttp://scratch.mit.edu/static/projects/Flait7/1827934_sm.png

Offline

 

#11 2009-11-17 18:45:46

marioman119
Scratcher
Registered: 2008-01-03
Posts: 38

Re: Problem with a script... any help appreciated...

Flait7 wrote:

If you want the sprites to move in the EXACT opposite direction, i suggest <move( -x )steps>

You people still don't understand. The turning is FINE. The trouble is, only ONE player moves back instead of BOTH.


<forever>
<move(1)steps>

Offline

 

Board footer