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

#1 2011-02-10 10:33:26

RedAlertFan
New Scratcher
Registered: 2011-01-21
Posts: 6

Loads of Questions from a Newbie

I'm having a problem with everything bouncing. I can't figure a way to make it stop when hitting a wall except by making it bounce. Also, they shoot you even if a wall is in the way.

Offline

 

#2 2011-02-10 13:11:50

The_Dancing_Donut
Scratcher
Registered: 2010-08-03
Posts: 1000+

Re: Loads of Questions from a Newbie

<when green flag clicked>
<forever>
<if><touching[ edge
<broadcast[ wallhit

<when I receive[ wallHit
<stop all>


Offending strangers since 2010.

Offline

 

#3 2011-02-10 18:21:45

henley
Scratcher
Registered: 2008-06-21
Posts: 1000+

Re: Loads of Questions from a Newbie

Or you could use the less complicated:

<when green flag clicked>
<forever>
<if><touching[ edge
<stop script>
<end>
<end>


"I've worked so hard for you and you give me nothing in return. Do you need help... Or do I?"

Offline

 

#4 2011-02-10 18:22:59

bbbeb
Scratcher
Registered: 2009-06-11
Posts: 1000+

Re: Loads of Questions from a Newbie

henley wrote:

Or you could use the less complicated:

<when green flag clicked>
<forever>
<if><touching[ edge
<end>
<end>

keeps the forever running.  big_smile


Back in my day.... there were no laws that censored the internet... now, there are.... nah.

Offline

 

#5 2011-02-10 18:29:14

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: Loads of Questions from a Newbie

To bounce when hitting a wall just make an x-velocity and/or y-velocity and multiply them by 1: Here is an example.


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#6 2011-02-10 18:39:33

henley
Scratcher
Registered: 2008-06-21
Posts: 1000+

Re: Loads of Questions from a Newbie

bbbeb wrote:

henley wrote:

Or you could use the less complicated:

<when green flag clicked>
<forever>
<if><touching[ edge
<end>
<end>

keeps the forever running.  big_smile

You never added the
<stop script>
block.


"I've worked so hard for you and you give me nothing in return. Do you need help... Or do I?"

Offline

 

#7 2011-02-11 10:35:09

RedAlertFan
New Scratcher
Registered: 2011-01-21
Posts: 6

Re: Loads of Questions from a Newbie

I need it to stop the script if touching the color red, not stop everything. Also, I need the script to reactivate after it stops touching.

Offline

 

#8 2011-02-11 12:30:44

The_Dancing_Donut
Scratcher
Registered: 2010-08-03
Posts: 1000+

Re: Loads of Questions from a Newbie

<when green flag clicked>
<forever>
<if><touching color[ Red
<stop script>


Offending strangers since 2010.

Offline

 

#9 2011-02-11 14:16:45

floppy_gunk
Scratcher
Registered: 2008-11-14
Posts: 500+

Re: Loads of Questions from a Newbie

[blocks]<when green flag clicked>
<forever if><not> <touching color[ red >>
do script
<end>
[/blocks]

or...

[blocks]<forever>
do stuff
<if> <touching color[ red
<wait until><not> <touching color[ red >>
<end>
<end>
[/blocks]

Last edited by floppy_gunk (2011-02-11 14:19:53)


http://img163.imageshack.us/img163/1917/2856lg.jpg Get it now!  smile

Offline

 

#10 2011-02-14 10:30:43

RedAlertFan
New Scratcher
Registered: 2011-01-21
Posts: 6

Re: Loads of Questions from a Newbie

How do I get my forever blocks to allow more blocks on the bottom.

Offline

 

#11 2011-02-14 10:34:59

Kileymeister
Scratcher
Registered: 2008-04-17
Posts: 1000+

Re: Loads of Questions from a Newbie

RedAlertFan wrote:

How do I get my forever blocks to allow more blocks on the bottom.

You can't, because a forever block will repeat without stopping unless the red stop sign is pressed or a stop script block is put in it.  There can't be anything underneath because it would never run.


I'm back, and showcasing two new* projects!  Click left or right on the image below to see!
http://img109.imageshack.us/img109/7905/part1l.pnghttp://img859.imageshack.us/img859/6417/part2bf.png

Offline

 

Board footer