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

#1 2007-10-19 20:50:47

ElMikkino
Scratcher
Registered: 2007-09-19
Posts: 76

2 Noob Questions

1. How do you make it so you can't go past something? Like a wall.

2. How do you make something bounce off something else (like when something bounces with the <if on edge, bounce> block)?

Thanks in advance to anyone who answers!

Last edited by ElMikkino (2007-10-20 11:19:54)


Certified Bunnay Agent
--------ElMikkino-----------

Offline

 

#2 2007-10-20 09:51:50

beny
Scratcher
Registered: 2007-07-24
Posts: 100+

Re: 2 Noob Questions

#1: <when[  ]key pressed>
<move(  )steps>
<forever>
<if><touching color[
<stop script>
<end>


more people like the letter B than the letter A!
i'm going for 250 posts!

Offline

 

#3 2007-10-21 14:53:56

kevin_karplus
Scratcher
Registered: 2007-04-27
Posts: 1000+

Re: 2 Noob Questions

beny's script moves the sprite until it touches a color.
To bounce, you need to change directions when touching the color, and you have to move away from the color before doing the test again.

Offline

 

#4 2007-10-21 16:55:00

relyt12101
Scratcher
Registered: 2007-05-19
Posts: 500+

Re: 2 Noob Questions

Make it so when it hits the wall/sprite it moves 180 or -180 degrees.

Just my thought. Someone else can probably do better.


http://img392.imageshack.us/img392/2860/pspbanneregg089deiy0.png

Offline

 

Board footer