0 Members and 4 Guests are viewing this topic.
for side scrolling you could just use "Horizontal -"
If pxl-Test(X,Y+9)=0Y-1->YEnd
just use "Horizontal -" All it does is shift the screen to the left on pixel, put that inside the main loop, and it scrolls everything. This also means you'll have to constantly update the "floor"also, your problem may be that your using Y+9, it should be Y+8. PLus you should also pxl-Test(X+7,Y+8) as well as pxl-test(X,Y+8)
If pxl-Test(X,Y+8)Y-1->YEndIf pxl-Test(X+7)X-1->XEnd
.PLATFORMFix 5[3810385410282828]->Pic0[FFFFFFFFFFFFFFFF]->Pic10->X40->YClrDraw.Main game loopWhile 1 .Moving right If getKey(3) X+2->X End .Jumping If getKey(4) and (Y>0) Y-5->Y End .Create floor For(A,0,12 Pt-On(A*8,48,Pic1) End .Collision test (ground) and Gravity !If pxl-Test(X,Y-8) !If pxl-Test(X+7,Y-8) Y+1->Y End End .Display sprite Pt-On(X,Y,Pic0) .Display the screen DispGraph ClrDraw .Close Game If getKey(15) Fix 4 Return EndEnd
# # XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX # #
# # XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX # #@@@@@@@@@@@@@@@
No, not really, what if you were inching forward very slowly on a platform...Code: [Select] # # XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX # #@@@@@@@@@@@@@@@Then you would fall off, and through the platform.
.Collision test (ground) and Gravity !If pxl-Test(X,Y+8) !If pxl-Test(X+7,Y+8) Y+1->Y End End If pxl-Test(X+7,Y) X-1->X End