Yes, I'm completely new. Please don't ridicule me for not being as intelligent as you are in using Scratch
I want to make a 2D platformer, BUT, I don't know how to make it scroll, and I don't know how to script sensor sprites properly. When I tried the one on Scratch Wiki, my character was flung away from it and I couldn't move. I didn't actually understand it.
I understand that you need these sensor sprites to collide with walls and ceilings without going through them, but do they help with falling through the floor whenever the down key is pressed?
Can anyone help me with these things?
Offline
Here is a tutorial in the Scratch Wiki. It holds lots of answers!
Scratch On!
Offline
Yeah, I read through this one, but I need to know how to make the sensor sprites work first. I really need to know what they mean by "four different terrains", and how to create the effect of gravity, (which I think I've already done anyway...)
Offline
the_storm_of_stone wrote:
Yeah, I read through this one, but I need to know how to make the sensor sprites work first. I really need to know what they mean by "four different terrains", and how to create the effect of gravity, (which I think I've already done anyway...)
the sensor: okay on your sprite, you color a different color on the edge of each side. e.g.
___________________
| |
| |
| |
| |
---------------------------
This is your sprite. there is a color colored on the edge of each side.
Then you make code that says 'if touching color green { }'
Last edited by ProgrammingFreak (2011-01-25 13:55:09)
Offline
Yeah, I've managed to get that, but I don't know how you can get the "hitTest" and the left/right/up/down hittest in the "of" sensor block...
Offline
the_storm_of_stone wrote:
Yeah, I've managed to get that, but I don't know how you can get the "hitTest" and the left/right/up/down hittest in the "of" sensor block...
Oh, that's only if your hit test variables were defined as local. (Usable only by your sensor sprite.) Chances are, you made then global, (that's the default) so you can just find them under the variables list.
Offline
But the tutorial says that it has to be on the actual player sprite not the sensor sprite. I made the tests only for the character sprite, but they still don't show up on the drop-down, and how am I meant to apply the hitTest variable when the sensor sprite uses it too?
Offline
I tried the tutorial in an entirely new project, and it scrolled okay but the player sprite would't jump and collisions weren't detected with the walls.
I made the first () of the () of () block a variable from the local ones I had attached to the player, but nothing would show up in the second (). Also, how would the hitTest work for the sensor sprite and the player at the same time, if I have to make the hitTest only for the player?
I'm really confused
Offline
Ah, yes, I got the sensor set to look like the example, but another problem for me now is the terrain scrolling. I'm pretty sure I coded it right...
The issue is, is that when I start up the scripts, the terrain glides up to the top of the stage... Does the terrain have to fill the whole stage?
Offline