0 Members and 1 Guest are viewing this topic.
.GRAVITYFullDiagnosticOff#ExprOn44*256→X26*256→Y0→A0→BRepeat getKey(15)ClrDrawrect(X/256,Y/256,8,8)If Y/256=0‾B→BEndIf Y/256=560→BElseB+4→BEndIf getKey(2)A-4→AEndIf getKey(3)A+4→AEndIf getKey(4)B-8→BEndIf A<<0A+1→AEndIf A>>0A-1→AEndY+B→YIf X/256=0‾A→AEndIf X/256=86‾A→AEndX+A→XDispGraphEnd
.PHYSICS.full speed, no marching ants and optimized for sizeFullDiagnosticOffExprOff.smiley sprite[3C42A581A599423C]→Pic1.initiate x/y coordinates44*256→X26*256→Y.set initial acceleration to zero0→A0→B.main loop until [clear] is pressedRepeat getKey(15).pauseIf getKey(54)Pause 12000End.display spritePt-On(X/256,Y/256,Pic1.display border linesHLine(0)HLine(63)VLine(0)VLine(95).ceiling collision detectionIf pxl-Test(X/256,Y/256) ‾B→BEnd.gravity and ground detectionIf pxl-Test(X/256,Y/256+8 0→BElse B+4→BEnd.move leftIf getKey(2) A-4→AEnd.move rightIf getKey(3) A+4→AEnd.move upIf getKey(4) B-8→BEnd.friction rightIf (A<<0) A+2→AElse A+1→AEnd.friction leftIf (A>>0) A-2→AElse A-1→AEnd.wall collisionIf pxl-Test(X/256,Y/256+1) or pxl-Test(X/256+7,Y/256+1) ‾A→AEnd.accelerateX+A→XY+B→Y.set vector lengthA//8→CB//8→D.display force vectorsLine(X/256+4,Y/256+4,X/256+4+C,Y/256+4)Line(X/256+4,Y/256+4,X/256+4,Y/256+4+D).update screen and end loopDispGraphClrDrawEnd