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

#1 2010-02-10 16:25:54

Eafu
Scratcher
Registered: 2010-02-06
Posts: 99

I need help with scripting

I'm creating an RPG, with an over-head view, but I can't seem to be able to make a good collision code for walls. Could anyone help me out? I'm having trouble making walls collidable. Hopefully a simple code, would be nice, one working simply off of the character touching a certain color?


http://i43.tinypic.com/r0y0at.png

Offline

 

#2 2010-02-10 16:32:35

poopo
Scratcher
Registered: 2009-09-20
Posts: 1000+

Re: I need help with scripting

ill make a example project for you


http://i45.tinypic.com/28rnqki.jpg

Offline

 

#3 2010-02-10 18:11:22

Eafu
Scratcher
Registered: 2010-02-06
Posts: 99

Re: I need help with scripting

I am still in need of script help, Poopo's help didn't work out very well, but thank you, anyway.


http://i43.tinypic.com/r0y0at.png

Offline

 

#4 2010-02-10 19:12:38

scmb1
Scratch Team
Registered: 2009-03-19
Posts: 1000+

Re: I need help with scripting

I think I know what you're asking. Are you asking how to make it so I sprite can't do through walls? If so, here is a script for blue walls.

When right arrow pressed
change x by (10)
if <touching color blue>
       change x by (-10)


Make the script for every directions. You may also use the <right arrow pressed?> block and/or the [move ( ) steps] block.

Does that help?


http://i48.tinypic.com/2z5pqad.png

Offline

 

#5 2010-02-11 05:44:10

juststickman
Scratcher
Registered: 2009-05-31
Posts: 1000+

Re: I need help with scripting

scmb1 wrote:

I think I know what you're asking. Are you asking how to make it so I sprite can't do through walls? If so, here is a script for blue walls.

When right arrow pressed
change x by (10)
if <touching color blue>
       change x by (-10)


Make the script for every directions. You may also use the <right arrow pressed?> block and/or the [move ( ) steps] block.

Does that help?

DO NOT USE THAT unless the sprite is a 1x1 pixel.
If you do that and your sprite is bigger, then your sprite could get caught on a side thing and everything will go creepy.


http://is.gd/iBQi2 Add grob to your sig and help with world dominiation!http://is.gd/iBQ9Q                                                             Hey guys, we're seriously naming our team bob?

Offline

 

#6 2010-02-11 08:55:38

Eafu
Scratcher
Registered: 2010-02-06
Posts: 99

Re: I need help with scripting

Oh, nevermind, I already created my own code. It was so simple. :p


http://i43.tinypic.com/r0y0at.png

Offline

 

#7 2010-02-18 14:23:10

angryboy2k9
Scratcher
Registered: 2009-12-06
Posts: 2

Re: I need help with scripting

Eafu what was the script? The examples I saw weren't very effective, and prone to glitches...

Offline

 

Board footer