Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ' Bouncing Marbles by TheBaykun.
- ' Yet another physics demonstration.
- ' Tilt to move the marbles.
- ' Tap to move Marble A.
- BallGrinder = 1 '0: Off, 1: On.
- ax=25
- ay=50
- aa=0
- ab=0
- bx=75
- by=35
- ba=0
- bb=0
- cx=125
- cy=75
- ca=0
- cb=0
- ACCELCALIBRATE
- LOCKORIENTATION
- IF ballgrinder=1 THEN
- PRINT "Ball Grinder: Not as painful as it sounds. ------>"
- ENDIF
- g=1
- WHILE g=1
- BEGINDRAW
- COLOR 0,0,0
- CIRCLE ax,ay,26
- CIRCLE bx,by,26
- CIRCLE cx,cy,26
- IF Touch>=1 THEN
- ax=TouchX
- ay=TouchY
- ab=0
- aa=0
- ENDIF
- IF ab>0 THEN
- ab=ab-0.2
- ENDIF
- IF ab<0 THEN
- ab=ab+0.2
- ENDIF
- IF bb>0 THEN
- bb=bb-0.2
- ENDIF
- IF bb<0 THEN
- bb=bb+0.2
- ENDIF
- IF cb>0 THEN
- cb=cb-0.2
- ENDIF
- IF cb<0 THEN
- cb=cb+0.2
- ENDIF
- ab=ab+(AccelX)
- IF ab>20 THEN
- ab=20
- ENDIF
- IF ab<-20 THEN
- ab=-20
- ENDIF
- ax=ax+ab
- IF ax<=25 THEN
- ab=2-ab
- ENDIF
- IF ax>=ScreenWidth-25 THEN
- ab=-2+(ballgrinder*4)-ab
- ENDIF
- IF ax>=ScreenWidth+25 THEN
- ax=25
- ENDIF
- IF ax<=-25 THEN
- ax=ScreenWidth-25
- ENDIF
- bb=bb+(AccelX)
- IF bb>20 THEN
- bb=20
- ENDIF
- IF bb<-20 THEN
- bb=-20
- ENDIF
- bx=bx+bb
- IF bx<=25 THEN
- bb=2-bb
- ENDIF
- IF bx>=ScreenWidth-25 THEN
- bb=-2+(ballgrinder*4)-bb
- ENDIF
- IF bx>=ScreenWidth+25 THEN
- bx=25
- ENDIF
- IF bx<=-25 THEN
- bx=ScreenWidth-25
- ENDIF
- cb=cb+(AccelX)
- IF cb>20 THEN
- cb=20
- ENDIF
- IF cb<-20 THEN
- cb=-20
- ENDIF
- cx=cx+cb
- IF cx<=25 THEN
- cb=2-cb
- ENDIF
- IF cx>=ScreenWidth-25 THEN
- cb=-2+(ballgrinder*4)-cb
- ENDIF
- IF cx>=ScreenWidth+25 THEN
- cx=25
- ENDIF
- IF cx<=-25 THEN
- cx=ScreenWidth-25
- ENDIF
- IF ay<ScreenHeight-25 THEN
- aa=aa+1
- ENDIF
- IF ay>=ScreenHeight-25 AND aa>0 THEN
- aa=2-aa
- ENDIF
- IF aa<>0 THEN
- ay=ay+aa
- ENDIF
- IF ay>ScreenHeight-25 THEN
- ay=ScreenHeight-25
- ENDIF
- IF ScreenHeight=ay+25 THEN
- IF aa=0 OR aa=1 THEN
- aa=-15
- ENDIF
- ENDIF
- IF by<ScreenHeight-25 THEN
- ba=ba+1
- ENDIF
- IF by>=ScreenHeight-25 AND ba>0 THEN
- ba=2-ba
- ENDIF
- IF ba<>0 THEN
- by=by+ba
- ENDIF
- IF by>ScreenHeight-25 THEN
- by=ScreenHeight-25
- ENDIF
- IF ScreenHeight=by+25 THEN
- IF ba=0 OR ba=1 THEN
- ba=-20
- ENDIF
- ENDIF
- IF cy<ScreenHeight-25 THEN
- ca=ca+1
- ENDIF
- IF cy>=ScreenHeight-25 AND ca>0 THEN
- ca=2-ca
- ENDIF
- IF ca<>0 THEN
- cy=cy+ca
- ENDIF
- IF cy>ScreenHeight-25 THEN
- cy=ScreenHeight-25
- ENDIF
- IF ScreenHeight=cy+25 THEN
- IF ca=0 OR ca=1 THEN
- ca=-15
- ENDIF
- ENDIF
- 'CLS gfx
- IF ballgrinder=1 THEN
- COLOR 200,200,200
- LINE ScreenWidth,0,ScreenWidth,ScreenHeight,5
- COLOR 100,100,100
- LINE ScreenWidth-5,0,ScreenWidth-5,ScreenHeight,5
- ENDIF
- COLOR 255,0,0
- CIRCLE ax,ay,25
- COLOR 0,255,0
- CIRCLE bx,by,25
- COLOR 0,0,255
- CIRCLE cx,cy,25
- COLOR 0,0,0
- DRAWTEXT "A",ax,ay
- DRAWTEXT "B",bx,by
- DRAWTEXT "C",cx,cy
- ENDDRAW
- SLEEP 0.01
- WEND
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement