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

#1 2008-06-07 22:03:04

keroro645
Scratcher
Registered: 2008-06-07
Posts: 1000+

how do make sprite repel each other?

Im working on a sidescroller and i want it so that a sprite wont go thruogh a wall.

Offline

 

#2 2008-06-07 22:06:29

Bluestribute
Scratcher
Registered: 2008-01-24
Posts: 1000+

Re: how do make sprite repel each other?

[blocks]<when green flag clicked>[/blocks]
[blocks]<forever if><touching color[ magenta (example[/blocks]
[blocks]<change x by( -3[/blocks]

That's if your walking right --->


http://img247.imageshack.us/img247/1204/bluestributett4.jpg
That's my PSN ID. I know tons of COD4 glitches. Add me as your friend. Oh, and get a headset

Offline

 

#3 2008-06-07 22:15:53

keroro645
Scratcher
Registered: 2008-06-07
Posts: 1000+

Re: how do make sprite repel each other?

im still working that side scroller i need  it so the stickman sprite wont go through a wall sprite.The script didnt work.

Offline

 

#4 2008-06-07 22:18:30

Bluestribute
Scratcher
Registered: 2008-01-24
Posts: 1000+

Re: how do make sprite repel each other?

keroro645 wrote:

im still working that side scroller i need  it so the stickman sprite wont go through a wall sprite.The script didnt work.

If he's moving ten steps to the right, then you need to change this to -10. It needs to offset how far he's moving


http://img247.imageshack.us/img247/1204/bluestributett4.jpg
That's my PSN ID. I know tons of COD4 glitches. Add me as your friend. Oh, and get a headset

Offline

 

#5 2008-06-07 22:24:48

keroro645
Scratcher
Registered: 2008-06-07
Posts: 1000+

Re: how do make sprite repel each other?

the script in the sticman sprite doesnt move at all it just looks like hes moving look at my game stickman test.i posted that as a test game.

Offline

 

#6 2008-06-07 22:30:48

Bluestribute
Scratcher
Registered: 2008-01-24
Posts: 1000+

Re: how do make sprite repel each other?

I put the link here (I know why it wasn't working  smile


http://img247.imageshack.us/img247/1204/bluestributett4.jpg
That's my PSN ID. I know tons of COD4 glitches. Add me as your friend. Oh, and get a headset

Offline

 

#7 2008-06-07 22:33:18

keroro645
Scratcher
Registered: 2008-06-07
Posts: 1000+

Re: how do make sprite repel each other?

Bluestribute wrote:

I put the link here (I know why it wasn't working  smile

what link?

Offline

 

#8 2008-06-07 22:36:47

tms5
Scratcher
Registered: 2008-03-24
Posts: 100+

Re: how do make sprite repel each other?

he he ha ha lol lol  lol


http://img299.imageshack.us/img299/7820/mybannerglitter5646597dap9.gif   Youtube   Google   Yahoo   Myspace   Scratch

Offline

 

#9 2008-06-07 22:46:14

Bluestribute
Scratcher
Registered: 2008-01-24
Posts: 1000+

Re: how do make sprite repel each other?

I added a wal to show you and some Yspeed! scratch.mit.edu/projects/CFCRubiks/183253


http://img247.imageshack.us/img247/1204/bluestributett4.jpg
That's my PSN ID. I know tons of COD4 glitches. Add me as your friend. Oh, and get a headset

Offline

 

#10 2008-06-07 22:49:13

geckofreak
Scratcher
Registered: 2007-12-20
Posts: 100+

Re: how do make sprite repel each other?

Try making a box that surrounds the stickman made up of four sprites. If these sprites touch the wall the a vaiable should change and the stickman won't be able to move in that direction, It is a hard but effective way to sense collisions


http://img361.imageshack.us/img361/645/supersmashbroscharacterzg7.gif
cool  My Wii Friend Code 5069-3634-2461  cool

Offline

 

#11 2008-06-07 23:06:57

keroro645
Scratcher
Registered: 2008-06-07
Posts: 1000+

Re: how do make sprite repel each other?

Thanks it worked but i was actually thinking of making a platform,like a wall you can stand on

Last edited by keroro645 (2008-06-07 23:07:28)

Offline

 

#12 2008-06-07 23:09:52

Bluestribute
Scratcher
Registered: 2008-01-24
Posts: 1000+

Re: how do make sprite repel each other?

keroro645 wrote:

Thanks it worked but i was actually thinking of making a platform,like a wall you can stand on

Well, make it. The Yspeed variable will stop when touching colro black. Want another example?


http://img247.imageshack.us/img247/1204/bluestributett4.jpg
That's my PSN ID. I know tons of COD4 glitches. Add me as your friend. Oh, and get a headset

Offline

 

#13 2008-06-07 23:30:32

keroro645
Scratcher
Registered: 2008-06-07
Posts: 1000+

Re: how do make sprite repel each other?

yes  smile

Offline

 

#14 2008-06-07 23:50:33

Bluestribute
Scratcher
Registered: 2008-01-24
Posts: 1000+

Re: how do make sprite repel each other?

It should be under the same link


http://img247.imageshack.us/img247/1204/bluestributett4.jpg
That's my PSN ID. I know tons of COD4 glitches. Add me as your friend. Oh, and get a headset

Offline

 

#15 2008-06-07 23:53:29

Bluestribute
Scratcher
Registered: 2008-01-24
Posts: 1000+

Re: how do make sprite repel each other?

Actually, it's the Stickman test! You can still use the same link though, jsut cosse test not demo


http://img247.imageshack.us/img247/1204/bluestributett4.jpg
That's my PSN ID. I know tons of COD4 glitches. Add me as your friend. Oh, and get a headset

Offline

 

#16 2008-06-07 23:57:30

keroro645
Scratcher
Registered: 2008-06-07
Posts: 1000+

Re: how do make sprite repel each other?

ok cool i never thought of that.i was wanted to make a big block but it didnt turn out well i will post my progress in tommorow

Offline

 

#17 2008-06-08 00:05:02

Bluestribute
Scratcher
Registered: 2008-01-24
Posts: 1000+

Re: how do make sprite repel each other?

keroro645 wrote:

ok cool i never thought of that.i was wanted to make a big block but it didnt turn out well i will post my progress in tommorow

Awesome!


http://img247.imageshack.us/img247/1204/bluestributett4.jpg
That's my PSN ID. I know tons of COD4 glitches. Add me as your friend. Oh, and get a headset

Offline

 

Board footer