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

#1 2012-05-09 01:29:50

lennon565
Scratcher
Registered: 2012-04-06
Posts: 9

Help To Make proper rebounding for my super lazer project

My project needs to rebound like this:

On a right wall, It bounces down-left if direction is 45, up-left if direction is 135.
On a left wall, It bounces down-right if direction is -45, up-right if direction is -135.

I really need help. Please?

when gf clicked
think [scripts] for (3) secs
please help for (1) minutes
say your post here!

Last edited by lennon565 (2012-05-09 01:38:48)

Offline

 

#2 2012-05-09 10:10:51

FINGIN
Scratcher
Registered: 2010-10-19
Posts: 100+

Re: Help To Make proper rebounding for my super lazer project

somthing like this would work, make four or more sensors for each side of lazor. for the top one or whatever

when gf clicked
if <touching wall>
point in direction __
move __ steps
should work, sorry if you dont understand.  it might have to be move -_ steps, please be a bit more descriptive with your posts


Problem officer?       http://trollosphere.legtux.org/wp-content/uploads/2012/01/Troll-Face-4efef98405000.png

Offline

 

#3 2012-05-09 11:35:04

zammer990
Scratcher
Registered: 2012-01-22
Posts: 500+

Re: Help To Make proper rebounding for my super lazer project

use 2 sprites, left and right wall
have this script:

when gf clicked
forever
if <touching [laser]?>
   if ([direction v] of [laser]) = (45)
      broadcast [downleft v]
   end
   if ([direction v] of [laser]) = (135)
      broadcast [upleft v]
   end
end
when gf clicked
forever
if <touching [laser]?>
   if ([direction v] of [laser]) = (-45)
      broadcast [downright v]
   end
   if ([direction v] of [laser]) = (-135)
      broadcast [upright v]
   end
end
make the laser react accordingly


http://i45.tinypic.com/2ynq7nn.jpg Play now!

Offline

 

#4 2012-05-09 14:26:21

laser314
Scratcher
Registered: 2010-07-16
Posts: 100+

Re: Help To Make proper rebounding for my super lazer project

zammer990 wrote:

use 2 sprites, left and right wall
have this script:

when gf clicked
forever
if <touching [laser]?>
   if <([direction v] of [laser]) = (45)>
      broadcast [downleft v]
   end
   if <([direction v] of [laser]) = (135)>
      broadcast [upleft v]
   end
end
when gf clicked
forever
if <touching [laser]?>
   if <([direction v] of [laser]) = (-45)>
      broadcast [downright v]
   end
   if <([direction v] of [laser]) = (-135)>
      broadcast [upright v]
   end
end
make the laser react accordingly

Fixed.


http://alpha.scratch.mit.edu/scratchr2/static//images/logo_sm.png 2.0 Alpha Tester!http://i49.tinypic.com/1zckcqb.png

Offline

 

#5 2012-06-16 17:27:43

lennon565
Scratcher
Registered: 2012-04-06
Posts: 9

Re: Help To Make proper rebounding for my super lazer project

FINGIN wrote:

somthing like this would work, make four or more sensors for each side of lazor. for the top one or whatever

when gf clicked
if <touching wall>
point in direction __
move __ steps
should work, sorry if you dont understand.  it might have to be move -_ steps, please be a bit more descriptive with your posts

um, is that the troll face?

if <(troll)=[positive]>
detroll website
end

Offline

 

#6 2012-06-16 17:52:35

zammer990
Scratcher
Registered: 2012-01-22
Posts: 500+

Re: Help To Make proper rebounding for my super lazer project

laser314 wrote:

zammer990 wrote:

use 2 sprites, left and right wall
have this script:

when gf clicked
forever
if <touching [laser v]?>
   if <([direction v] of [laser v]) = (45)>
      broadcast [downleft v]
   end
   if <([direction v] of [laser v]) = (135)>
      broadcast [upleft v]
   end
end
when gf clicked
forever
if <touching [laser v]?>
   if <([direction v] of [laser v]) = (-45)>
      broadcast [downright v]
   end
   if <([direction v] of [laser v]) = (-135)>
      broadcast [upright v]
   end
end
make the laser react accordingly

Fixed.

Fixed


http://i45.tinypic.com/2ynq7nn.jpg Play now!

Offline

 

Board footer