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

#1 2011-08-27 12:26:02

l0ve1y
Scratcher
Registered: 2011-08-27
Posts: 100+

impassible wall

I would like to know how to make a good, high-quality no-glitch impassible wall. I have code for one, but it's so glitchy, I can't use it. Help!


http://www.tagmybffs.com/upics/v2l4v5b78olj3x.png

Offline

 

#2 2011-08-27 12:54:16

Flait7
Scratcher
Registered: 2008-04-14
Posts: 100+

Re: impassible wall

What's your script for one?


http://scratch.mit.edu/static/projects/Flait7/2248016_sm.pnghttp://scratch.mit.edu/static/projects/Flait7/1827934_sm.png

Offline

 

#3 2011-08-30 18:10:37

l0ve1y
Scratcher
Registered: 2011-08-27
Posts: 100+

Re: impassible wall

[blocks]<when green flag clicked><forever if><key[ up arrow]pressed?><< <and>  <touching color[ <change y by( 

and i just have a bunch of those.


http://www.tagmybffs.com/upics/v2l4v5b78olj3x.png

Offline

 

#4 2011-08-30 18:15:54

l0ve1y
Scratcher
Registered: 2011-08-27
Posts: 100+

Re: impassible wall

[blocks] <when green flag clicked><forever if><< <key[ up arrow ]pressed?><and>  <touching color[ >> <change y by(-1 [/blocks]

It's not high quality enough for me! HELP!


http://www.tagmybffs.com/upics/v2l4v5b78olj3x.png

Offline

 

#5 2011-08-30 19:43:30

AtomicBawm3
Scratcher
Registered: 2009-06-27
Posts: 1000+

Re: impassible wall

Depends on what type of wall you're using.  I prefer to use a grid system for my games, which makes the level look like a bunch of tiles that are (usually) 20x20.  What I then do is if the sprite is touching a wall, it can just go to an exact location where it won't be without having to sense for it.  like if I have a 10x10 sprite that touches a wall, it knows that it needs to go to it's round(x position/20)*20+5 if it touches on the right, and -5 if it touches on the left.  Then I can have it do a "bounce" effect (xvel*-1) without worrying about it getting caught because of friction.


http://i50.tinypic.com/j0yw0p.jpg

Offline

 

#6 2011-09-01 15:08:58

l0ve1y
Scratcher
Registered: 2011-08-27
Posts: 100+

Re: impassible wall

I like to use lines for my walls, since they're the easiest to draw, but they're also the most glitchy. yikes


http://www.tagmybffs.com/upics/v2l4v5b78olj3x.png

Offline

 

#7 2011-09-01 19:53:29

l0ve1y
Scratcher
Registered: 2011-08-27
Posts: 100+

Re: impassible wall

What do you recommend for that?  hmm


http://www.tagmybffs.com/upics/v2l4v5b78olj3x.png

Offline

 

#8 2011-09-01 20:36:01

AtomicBawm3
Scratcher
Registered: 2009-06-27
Posts: 1000+

Re: impassible wall

Well, although lines are easy, they are hard to sense and don't usually look like good design.  I would recommend making a tiling game engine.  Here's what you do:
-make a tile of any size so long as the dimensions are the same (i.e. 20x20)
you can design multiple tiles to cycle through as you draw your level.
make sure that the center of the costume is at the top left corner.
-next, have a script that looks like this:

When Flag Clicked
Clear
Forever:
     set x to [round(mouse x/20)*20]
     set y to [round(mouse y/20)*20]
     if <mouse down>:
          stamp
     if <key [space] pressed>:
          next costume

This will allow you to make a really neat grid of tiles for your levels.  Then all you do is right-click and save an image of the background, and then edit out the background color if you want.


http://i50.tinypic.com/j0yw0p.jpg

Offline

 

#9 2011-09-02 14:19:37

l0ve1y
Scratcher
Registered: 2011-08-27
Posts: 100+

Re: impassible wall

Ah. I see. Thanks for the help. I still prefer lines, though.  tongue


http://www.tagmybffs.com/upics/v2l4v5b78olj3x.png

Offline

 

Board footer