I am going to teach you how to make a x scroller without velocities!
Step 1:Make some sprites, a player and some platforms.
Step 2:Make a variable Grounded for the player, and scrollx for everything.
Step 3:Go to the background, do "When Green Flag Clicked Forever"
"If key right arrow pressed change Scrollx by (Any number between -1 and -100)"
"If key left arrow pressed change Scrollx by (Any number between 1 and 100)"
(NOTE!!!: Do NOT do pick random between 1 and 100 or pick random between -100 and -1, unless you want a weird paced game!)
Step 4:Go one of your platforms, and drag it to the bottom of the screen, or if you have part that goes to the top, set it's y to 0.
Step 5:Go into it's scripts, do "When Green Flag Clicked Forever Set X to:Scrollx+480x(What platform it is, 0 is first etc)
Step 6:Repeat steps 4-5 for every platform.
Step 7:Go to the player, be sure that all your platforms have a ground color where you want the player walking, if not, go back and edit the platforms, then go to your player.
Step 8: Do "When green flag clicked Forever"
"If (And else) Touching (Color of the ground)Set grounded to 1 Else Set grounded to 0"
Step 9:stay on your player, now do "When green flag clicked Forever if "grounded=0""
"Change Y by (Any number between -20 to -1)
Step 10:Go to your player again, and add this script "When green flag clicked forever if touching color (Ground color" and key up arrow pressed Repeat(10-20 times)Change Y by (Double the fall speed)
Step 11:Try out your game!
I hope this helped some people, Note that the platforms will not repeat, so if you want more platforms in your game, duplicate one of your other platforms, modify the Scrollx+480* script and then it should work
Feel free to leave some feedback.
-Spine
Last edited by Spine (2009-03-06 21:45:39)
Offline