I am trying to recreate the first level of manic minor in scratch as an introduction to programming for my son. I was wondering if anyone could provide any good pointers on how to create a platform game as most i have seen in scratch seem a bit poor, i.e. if the character jumps from one level to the other it can stop mid way through the platform etc.
I have done some initial tests and keep finding that the sprite colission is a bit hit and miss, i.e. i have a sprite with coloured feet and my floors have a particular colour along the top edge so i check to see if the characters feet are touching this colour in part of my jump script however often find that once the character lands from a jump or jumps between levels it appears to go past the floor before stopping.
Any advice appreciated.
Thanks
Offline
What I tend to use is put sensor sprites around the sprite, then make them invisible. Invisible things can still be sensed. So you'd have a sprite on the left, top, bottom, and right of the sprite, and you could make sure it would stop going left when the left sprite touched anything. This way, you can use sprite sensing instead of colour sensing.
If you want an example, see my project "The Little Pointless Project".
Offline
Thanks for that you have restored my faith in being able to complete this project using scratch, however i see from the example you linked to that the blob still appears to go slightly through the floor at times, is there no way to stop this? my platforms are sprites that I stamp down and are all one colour apart from a few black dots in them and I need to ensure that when the character falls he lands on top of the level every time and not part way through it - does that make sense? i am trying to replicate this game -
http://www.bigredswitch.co.uk/games/mm/mm-pre-dis.html
Thanks
Offline
bryano wrote:
Thanks for that you have restored my faith in being able to complete this project using scratch, however i see from the example you linked to that the blob still appears to go slightly through the floor at times, is there no way to stop this? my platforms are sprites that I stamp down and are all one colour apart from a few black dots in them and I need to ensure that when the character falls he lands on top of the level every time and not part way through it - does that make sense? i am trying to replicate this game -
http://www.bigredswitch.co.uk/games/mm/mm-pre-dis.html
Thanks
I see your point, though I believe that what you are asking to do is impossible. Scratch isn't the greatest programming language in the world. You can still use colour sensing with my method, though.
Offline
I have found that to use colour sensing efectively i had to make my sprite quite large and the two colours I wanted to test had to cover quite a large (visible) area rather than just a thin line of colour, so close yet so far!
Offline
Why not just have a loop that is triggered whenever you are on top of a platform to move the character up one step until it is no longer touching the color? It might be embedded for a brief moment but would correct itself quickly.
Offline
what you could do is make your sencing sprites 2 toned, and then use a similer method to paddle2see's method. For example, if the bottom of the block is blue, and the top part is green, and the platforms are red, you could do this:
if colour [blue] is over colour [red]
gravity = 0
if colour [green] is over colour [red]
change y by 1
the reason why we dont just use one part of the sencor to do both is because when he gets himself out of the platform, he seems to 'bounce'
(I'm not sure if your using gravity, or just changing the y position making it fall at a constant speed. Also, if my code seems too look different to what scratch uses, apology, ive gotten use to flash)
Offline
thanks for the great ideas so far its appreciated. I have come up with a basic moving / jumping script which I have knocked together by looking at other peoples code, it works quite well in that unlike other examples i have come across the character can jump up through platforms and it continues up until it hits the max velocity and on its way down if it senses a platform it stops, here a link to it in case it helps other, one minor niggle is it still sometimes drops well in to the level before the code moves the sprite up to sit on top of the level(try it and you will understand what i am on about), if anyone has any ideas on how to improve on it please let me know. Once I have a good sprite movement/jumping/collisions sorted I will make a start on using that code for my manic minor remake.
http://scratch.mit.edu/projects/bryano/522429
Thanks
Offline
ok i'm beat im sure this just cant be done in scratch effectively, may be i'm expecting too much out of it but the collision detection is just unreliable when trying to create a platformer like manic minor - anyone care to prove me wrong?
Offline
i could probably get as close as possible in scratch, but without the ability of instant loops, its not gonna look as good as it should
Offline
you could get it quite close, but its always gonna take a second or so to get out of the ground unfortunately
Offline
I'm trying to make a road in witch the sprite can walk on that only... but I'm not sure it's that simple... any tips?
Offline
puppylover53 wrote:
I'm trying to make a road in witch the sprite can walk on that only... but I'm not sure it's that simple... any tips?
It's pretty easy to make something close....make the road a certain color and then put in a script that sets the speed of the character (use a variable for the speed) based on the color it is touching. If the character is not touching the road color, set the speed WAY down. Like this project:
http://scratch.mit.edu/projects/Paddle2SeeFixIt/492957
Offline
I dont know if this would be useful but if you could download mine you could copy a few things out of it.
download
Offline