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

#1 2013-04-16 11:42:47

kieran1000
Scratcher
Registered: 2013-02-06
Posts: 43

not let a sprite go through walls (even if there thin)

hello this is how to not let a sprite go through walls

when gf clicked
   forever
     if < key [ up arrow v ] pressed >
       change y by (3)
          if < touching colour [ colour of walls v ] >
             change y by (-2)
          end
      end
      if < key [up arrow v ] pressed >
         change y by (-3)
         if < touching colour [ colour of walls v ] >
            change y by (2)
         end
      end
      
and so on

Offline

 

#2 2013-04-16 12:35:22

topazdragonlord
Scratcher
Registered: 2013-02-22
Posts: 500+

Re: not let a sprite go through walls (even if there thin)

cool  smile


http://i45.tinypic.com/idumbk.png

Offline

 

#3 2013-04-16 19:22:38

7734f
Scratcher
Registered: 2010-12-23
Posts: 500+

Re: not let a sprite go through walls (even if there thin)

kieran1000 wrote:

hello this is how to not let a sprite go through walls

when gf clicked
   forever
     if <key [up arrow v] pressed?>
       change y by (3)
          if <touching color [color of walls v]?>
             change y by (-2)
          end
      end
      if <key [up arrow v ] pressed?>
         change y by (-3)
         if <touching color [ color of walls v ]?>
            change y by (2)
         end
      end
      
and so on

Fixed  smile

Last edited by 7734f (2013-04-16 19:23:36)


http://internetometer.com/image/38992.png   http://i37.tinypic.com/2qixx6c.png

Offline

 

Board footer