Hey,
I'm completely new to scratch, and even though i do have experience with sprites, triggers and very little scripting, i need help with a few issues.
1) Boundaries: is there any way to limit a sprites movement to just a specific area?
Like make it so that a sprite cannot enter this area, or make collision between sprites?
Because its seriously weird how ur guy can go walk into the air and over water...
(depending on the background of course)
2)Gravity: Is there any way you could simulate gravity? Like say you said that
"when you press the up arrow key, the sprite will move up at 10..speed er whatever"
could you make it so the sprite would slowly fall for the exact same distance it went up?
3) Isometric: Isometric is a fancy word for diamonds. heres the easiest way to explain it
When your sitting at a desk, and theres a square perfectly parallel, what does it look like.
A: if you said a square...then you're correct.
But what happens if you move to the corner of the desk, and the square is no longer
facing you, and because your looking at it sideways, it looks like a diamond. what does it look like?
A: a diamond.
So instead of having your normally box screen, you turn the angle of the camera, or what or how the viewer is looking at the screen. But isometricy also gives a better
sense of 3 dimensionness...A box looks more like a box when its tilited, but because
your no longer looking at it like square, the movement isn't in perpendicular
directions, It's diagonal. Which means when you press the left key, you don't go left, you go diagonal left, and when you go right, you go diagonal right. Its like the rook on chessboard,s...or...slanted lines...i don't know
Thats all confusing but, is there anyway you can move a character...diaganal left?
Last edited by MrCrowley (2007-11-14 20:21:08)
Offline
Ok, for limiting sprites to certain areas. You have to create scripts that will move the sprites away. Say we don't want a sprite to move through a wall, well what we do is we make it so that the sprites moves away from the wall when it touches it usually by the use of the <move( -1 )steps> block. Your concept of things should not go through each other does not exist automatically in scratch, you have to make it so things do go through other things.
Also here a little tutorial on how to implement gravity.
// First create a local variable on your sprite called yVelocity
Then put this script into your sprite.
<when green flag clicked>
<set{ yVelocity}to(0
<forever>
<change{ yVelocity }by(-1
<change y by( yVelocity
//Now that wasn't so hard was it?
Now to jump we invert gravity.
<when[ up ]key pressed>
<set{ yVelocity}to( 10
And for your "isometericness" do you mean you want to view objects in the third dimension?
Last edited by archmage (2007-11-14 20:45:09)
Offline
I believe that the word MrCrowley wants is not "isometric" but "perspective". Scratch is a 2D world and does not include a built-in perspective projection. Although some people have managed to do some 3D work in scratch (particularly Canthiar's raytracer), scratch is not a good environment for 3D animation or games. I would recommend Alice (http://alice.org) for someone looking for a beginner's programming environment that is 3D rather than 2D. It isn't as easy to work with as Scratch, but it is 3D.
Offline
Well with the isometeric thing you said you could make two sprite of the same y a bit far apart from each other and two sprites that are same x but different y and their x is between the x of the two other sprites. Then make another sprite that draws a line all around them all the time and make the two dots with different y values come close to each other and farther from each other. it is kind of 3D but scratch is not that good with 3D.
Offline