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

#1 2010-11-29 19:42:46

rantg
Scratcher
Registered: 2010-10-16
Posts: 99

how to get something to bounce of of a wall in a scroller

i need help i cant figure this out if you know please help me!


http://www.mariowiki.com/images/4/47/JumpBlock_3D.png  yikes  My song request page has passed the 100 post mark!

Offline

 

#2 2010-11-29 20:27:46

-GizzardGulp-
Scratcher
Registered: 2010-03-05
Posts: 100+

Re: how to get something to bounce of of a wall in a scroller

you should start smaller; that is complex physics scritping


http://i1118.photobucket.com/albums/k607/Max_Levine/SnoutmolStudios.png

Offline

 

#3 2010-11-30 12:05:24

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: how to get something to bounce of of a wall in a scroller

try looking at some projects that use this and remix theirs or use some of their scripts. a good classic i know of is Chop Shop.
remember to give credit to the creator!  smile

Offline

 

#4 2010-11-30 14:57:33

subzerostig
Scratcher
Registered: 2010-09-08
Posts: 100+

Re: how to get something to bounce of of a wall in a scroller

If you have 2 variables, X and scrollx, where x is how fast the player is going then do this:
You colour the wall a certain colour and program it like this:


<forever>
<if><touching color[ ]
<set{ x  }to( (( x  <*> -1  ))
<end>
<end>

Last edited by subzerostig (2010-11-30 14:57:58)


There are 10 types of people people in this world, those that understand binary and those that do not: My latest Project: Present catcher V2                          06/12/2012

Offline

 

#5 2010-11-30 15:06:44

stickdude123
Scratcher
Registered: 2010-05-31
Posts: 100+

Re: how to get something to bounce of of a wall in a scroller

ummmm this is the wrong thread topic thing you should look in the requests one


http://internetometer.com/imagesmall/34259.png http://www.mediafire.com/convkey/418e/lkb7wmv2n2k73rz5g.jpg         http://blocks.scratchr.org/API.php?user=stickdude123&amp;action=onlineStatus&amp;type=square

Offline

 

#6 2010-11-30 15:15:51

12three
Scratcher
Registered: 2008-06-12
Posts: 1000+

Re: how to get something to bounce of of a wall in a scroller

stickdude123 wrote:

ummmm this is the wrong thread topic thing you should look in the requests one

Actually this should be in all about Scratch.  smile
Say this:
If Key right arrow
11If not touching color whatever
11Change ScrollX by whatever
11Else
11Change Scrollx by opposite of whatever.
1111111111111111111111111111111
111111111111111111111111111111

Offline

 

#7 2010-12-03 16:37:09

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: how to get something to bounce of of a wall in a scroller

This doesn't belong in "Advanced Topics" - let's see how it fits in with All About Scratch, hm?  smile

Offline

 

#8 2010-12-03 16:57:38

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: how to get something to bounce of of a wall in a scroller

subzerostig wrote:

If you have 2 variables, X and scrollx, where x is how fast the player is going then do this:
You colour the wall a certain colour and program it like this:


<forever>
<if><touching color[ ]
<set{ x  }to( (( x  <*> -1  ))
<end>
<end>

This answer is correct given that you have a variable that tracks horizontal momentum, which you should. Other answers to this question hint at making a sprite stop at a wall which doesn't address the problem.


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#9 2010-12-03 19:49:09

PlutoIsHades
Scratcher
Registered: 2010-10-18
Posts: 1000+

Re: how to get something to bounce of of a wall in a scroller

[blocks]<forever><repeat(
<turn cw( 180 )degrees><touching[ <if>
<move(  )steps>[/blocks]

I dunno if these will even show up as blocks...but just an idea.   smile


Minecraft, Redwall, and Cyberchase fan, and PROUD.

Offline

 

#10 2010-12-04 21:00:04

goo142
Scratcher
Registered: 2010-08-16
Posts: 23

Re: how to get something to bounce of of a wall in a scroller

Thats pretty complex scratching  lol

Offline

 

Board footer