I really wanna make a platform game. I've made a character that can jump and move with the arrow keys. The character can sort of stand on platforms..... but it doesn't really work Somebody HELP ME!
Offline
Post your project and we can take a look.
Offline
Il tell you how to make him stand.
First get what ever it is on the top (i.e Green Flag, "If key pressed")
1. Now put the ORANGE block called "Forver if"
2. Put one of the blues in the "Sensing" and then select "touching color [] ?"
[Just select the color you want him to stand on]
[Or for sprites just select "touching ____ "
3. Now put how far it will move if touching the sprite or the color!
Most people just select.. "change X by 1 and Change Y by 1
-Nick
Offline
I don't under stand can you please post the whole thing together.
Offline
Assuming you just want your character to move along flat one-color surfaces with no walls, slopes, or mid-air platforms (walls, slopes and mid-air platforms are where the programming can get complicated), a basic engine allowing for left movement, right movement, and jumping/gravity would work like this:
when green flag clicked
forever
if key left arrow pressed
change x by -2
if key right arrow pressed
change x by 2
if key space pressed
if touching color []
if jumping = 0
set jumping to 1
repeat 20
change y by 2
set jumping to 0
when green flag clicked
forever
if not touching color []
if jumping = 0
repeat until touching color []
change y by -2
(replace color [] with color of platform)
The jumping variable is just a flag to indicate that you're jumping so the gravity script which pulls you down doesn't take place. When space is pressed, it sets the jumping flag to 1, and changes your y position by 2 20 times so that you go up. Then it sets jumping to 0, so the gravity effect takes place, which pulls you down until you're touching the []-color platform.
I'm sorry if I explained this badly, I suck at explaining things.
Offline
Thanks
Offline
THANKYOU PEOPLE!!!! i wuv u all
Offline
Nearly everthing is working, sort of..... but I want the character to chance costumes when he's walking. I've tryed this code:
When right arrow pressed
Forever if <Right arrow pressed>
change x by 3
point in direction 90
Repeat until <NOT right arrow key pressed>
switch to costume 1walk
wait 0.25 secs
switch to costume 2walk
But for some reason it just goes all juddery and doesn't move when I press the arow keys??? Aaaaarrrggg!!! Please help me someone!!!
Offline
Get rid of the forever if
move the "change x by 3" into the repeat-until loop
Offline
WAHAY! IT WORKS!!! thankyou sooo much! now all i have todo is think of a story and then i will be finished
Offline
I need help! I wanna make a platform game with mid air platforms. Can you help? I would greatly appreciate it. Thanks!
Offline
See my game Tanks that I made for you. It's not finished, though. Click the blue highlited text of my website name on the left then click the project Tanks. Then download it and look at it's scripts. Hope that helps.
Offline
Whats the best way to make the backgrounds change?
Offline
Check this http://scratch.mit.edu/projects/Llamalover/27039 out for loads of cool changing effects, feel free to take the scripts!
Offline
Hello, Boopaloo! When I finish the platforms, I can help you with the scrolling part. I've already tried it with Max, and it worked.
Offline
I could help you with the Gravity and stuff just do forever if NOT touching colour (whatever the platform colour is) then in the forever if block put in a change y by -1(higher the number to make the Sprite go down faster. And there we go!
Offline