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

#1 2009-12-28 10:48:52

Chatter
Scratcher
Registered: 2009-11-29
Posts: 500+

How do you make a sprite bounce off an object?

Hello, once again, i need help. I need to make a sprite bounce off another one. I will let you give me any special request if you help me. Please help me!!! Thank you.  big_smile

The script i'm using is:

<when green flag clicked>
<go to[  Sprite 2
<if on edge, bounce>

Please help me fix it.  smile


http://img19.imageshack.us/img19/2339/mcdonaldsjoke.gifAll your problems are like batter when you add a little Chatter, because when you have Chat, you're safe from bats.  big_smile
"And so?" - The little people in my brain|Status: Snow in April?

Offline

 

#2 2009-12-28 11:21:12

Buggy132k9
Scratcher
Registered: 2009-12-19
Posts: 19

Re: How do you make a sprite bounce off an object?

Try If touching sprite 2 move -10 steps or something.
Or, if you control the character, and you have for the right arrow key change x by 5, maybe put as well if touching sprite 2 change x by -5. And do that for all the other controls.

Offline

 

#3 2009-12-28 12:17:49

Chatter
Scratcher
Registered: 2009-11-29
Posts: 500+

Re: How do you make a sprite bounce off an object?

Buggy132k9 wrote:

Try If touching sprite 2 move -10 steps or something.
Or, if you control the character, and you have for the right arrow key change x by 5, maybe put as well if touching sprite 2 change x by -5. And do that for all the other controls.

Thanks so much! It worked!  tongue  Got any special requests?  smile


http://img19.imageshack.us/img19/2339/mcdonaldsjoke.gifAll your problems are like batter when you add a little Chatter, because when you have Chat, you're safe from bats.  big_smile
"And so?" - The little people in my brain|Status: Snow in April?

Offline

 

#4 2009-12-28 17:38:40

Buggy132k9
Scratcher
Registered: 2009-12-19
Posts: 19

Re: How do you make a sprite bounce off an object?

Not yet, but i might soon need a script for a new 'wave' of enemies after a certain amount of kills.
But that'd probably be on wednesday, as i don't have much time tomorrow and i might already know one, but if you wanna help feel free  big_smile

Offline

 

#5 2009-12-28 18:19:23

Chatter
Scratcher
Registered: 2009-11-29
Posts: 500+

Re: How do you make a sprite bounce off an object?

Buggy132k9 wrote:

Not yet, but i might soon need a script for a new 'wave' of enemies after a certain amount of kills.
But that'd probably be on wednesday, as i don't have much time tomorrow and i might already know one, but if you wanna help feel free  big_smile

I'll help!!!  big_smile


http://img19.imageshack.us/img19/2339/mcdonaldsjoke.gifAll your problems are like batter when you add a little Chatter, because when you have Chat, you're safe from bats.  big_smile
"And so?" - The little people in my brain|Status: Snow in April?

Offline

 

#6 2010-01-20 17:29:32

VONNA_01
Scratcher
Registered: 2010-01-03
Posts: 1

Re: How do you make a sprite bounce off an object?

<move(  )steps>

Offline

 

#7 2010-04-29 12:33:23

4hyselkla
Scratcher
Registered: 2010-04-29
Posts: 1

Re: How do you make a sprite bounce off an object?

Hi
I am making a Scratch game for school homework and am really stuck - I have two sprites and they have to dodge each other. My sprite 2 is currently bouncing horizontally across my stage but I want it to bounce vertically instead - does anyone know how to do that?
Thanks

Offline

 

#8 2010-05-09 00:48:29

wei2912
Scratcher
Registered: 2010-05-09
Posts: 100+

Re: How do you make a sprite bounce off an object?

Try THIS:
[blocks]
<when green flag clicked>
<go to[sprite 2]><touching color[ colour ]<direction180>


Waiting for Scratch 2.0...

Offline

 

#9 2010-05-09 17:22:52

bananaman114
Scratcher
Registered: 2010-03-15
Posts: 1000+

Re: How do you make a sprite bounce off an object?

Buggy132k9 wrote:

Not yet, but i might soon need a script for a new 'wave' of enemies after a certain amount of kills.
But that'd probably be on wednesday, as i don't have much time tomorrow and i might already know one, but if you wanna help feel free  big_smile

use the [/blocks]<broadcast[  block tocreate a new level after variable "points" or whatever = how many. big_smile

Last edited by bananaman114 (2010-05-09 17:25:15)


the sun still shines

Offline

 

#10 2010-05-21 08:39:34

helltank
Scratcher
Registered: 2010-05-21
Posts: 1000+

Re: How do you make a sprite bounce off an object?

http://scratch.mit.edu/forums/viewtopic.php?id=27922#req_messagehttp://scratch.mit.edu/forums/viewtopic.php?id=27922#req_message<broadcast[  ]and wait c>


Error:Signature could not load. Please wait for an indefinite amount of time, until you realize you're gullible and go off to look for another potentially interesting signature to stare at.

Offline

 

#11 2010-05-21 08:42:46

DarkForce1998
Scratcher
Registered: 2009-12-05
Posts: 500+

Re: How do you make a sprite bounce off an object?

[blocks]<if on edge, bounce>[/blocks] Means the border of the screen edge...


http://i55.tinypic.com/2qw381g.png

Offline

 

#12 2010-05-21 22:04:18

shamrocker
Scratcher
Registered: 2009-03-19
Posts: 1000+

Re: How do you make a sprite bounce off an object?

VONNA_01 wrote:

<move(  )steps>

Please do not spam. Chatter, I see your question is answered and the answer works. Would you like this closed? I will notify the mods if you do.


http://i46.tinypic.com/2s1b32e.png
respect the oxford comma

Offline

 

#13 2010-07-17 09:17:07

Pokemonfan226
Scratcher
Registered: 2010-07-10
Posts: 13

Re: How do you make a sprite bounce off an object?

<move(  )steps><turn cw(  )degrees><point towards( <glide(  )secs to x sad   )y sad


http://sdb.drshnaps.com/objects/7/971/Sprite/DoraemonGBA.png

Offline

 

#14 2010-07-17 11:16:51

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: How do you make a sprite bounce off an object?

Pokemonfan226 wrote:

<move(  )steps><turn cw(  )degrees><point towards( <glide(  )secs to x sad   )y sad

As shamrocker said, please don't spam. It doesn't add to the discussion and gives you a bad reputation.


http://www.blocks.scratchr.org/API.php?action=random&amp;return=image&amp;link1=http://i.imgur.com/OZn2RD3.png&amp;link2=http://i.imgur.com/duzaGTB.png&amp;link3=http://i.imgur.com/CrDGvvZ.png&amp;link4=http://i.imgur.com/POEpQyZ.png&amp;link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#15 2010-07-18 00:12:52

helltank
Scratcher
Registered: 2010-05-21
Posts: 1000+

Re: How do you make a sprite bounce off an object?

You should post this in all about scratch...but anyway, try:

[blocks]<when green flag clicked>
<forever>
<if>
<touching[ Sprite1>
<move(-10  )steps>
[/blocks]


Error:Signature could not load. Please wait for an indefinite amount of time, until you realize you're gullible and go off to look for another potentially interesting signature to stare at.

Offline

 

#16 2010-07-24 09:44:20

Jwosty
Scratcher
Registered: 2009-12-19
Posts: 500+

Re: How do you make a sprite bounce off an object?

Or, you could turn it 180 degrees if it is touching the second Sprite. (That's what 'if on edge, bounce' does, except it bounces of the edge of the stage)  wink


http://i39.tinypic.com/18ert5.png Google it.  smile

Offline

 

#17 2010-07-24 09:47:39

Wolfie1996
Retired Community Moderator
Registered: 2009-07-08
Posts: 1000+

Re: How do you make a sprite bounce off an object?

Hmmm... this is quite an old topic... and it seemed to be resolved quite a while ago (look at post #3). I'll close it  smile


"...Jargon - the practice of never calling a spade a spade, when you might instead call it a manual earth-restructing implement..." - Bill Bryson, Mother Tongue

Offline

 

Board footer