Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ' Zipper by TheBaykun.
- ' Every line is commented on.
- ' Because why not?
- ' This can be used for a settings slider (volume, difficulty, speed, or something like that.)
- TEXTFONT "Arial Rounded",28 'Set font
- RETINA off 'Turn off retina mode
- BCOLOR 200,255,200 'Set background.
- TCOLOR 255,0,0 'Set PRINT color.
- sw=ScreenWidth 'Simplifying screenwidth
- sh=ScreenHeight 'Same with screenheight
- zy=150 'Zipper's Fly Y-Position.
- loopA: 'Start loop.
- BEGINDRAW 'Begin frame.
- IF Touch>=1 AND TouchX>=(sw/2)-30 AND TouchX<=(sw/2)+30 THEN 'Touching
- zy=TouchY 'Move fly to finger.
- IF zy>sh-50 THEN 'If below zipper.
- zy=sh-50 'Set to bottom of zipper.
- ENDIF 'End below-zipper IF.
- IF zy<50 THEN 'If above zipper.
- zy=50 'Set to top of zipper.
- ENDIF 'End above-zipper IF.
- ENDIF 'End touch-screen IF.
- zp=INT(((317-zy)/(317-50))*100) '% full.
- GOSUB drawZipper 'Update zipper.
- 'PRINT STR$(zp)+"%" 'Print % full.
- SLEEP 0.01 'Sleep for 1/100th of a second
- ENDDRAW 'End frame, update screen.
- GOTO loopA 'Continue loop.
- drawZipper: 'Start drawing the zipper.
- CLS 'Remove last frame
- 'PRINT zy 'Print zipper Y-Position.
- COLOR 50,50,50 'Set color: dark grey
- LINE sw/2,zy,sw/2,sh-50,8 'bottom zipper
- zta=(sh-zy)/2 'Closes the zipper!!!
- LINE sw/2,zy,zta,50,8 'Top zipper.
- LINE sw/2,zy,sw-zta,50,8 'Top zipper.
- COLOR 175,175,175 'Set color: light grey
- LINE sw/2,zy,sw/2,sh-50,2 'bottom zipper
- LINE sw/2,zy,zta,50,2 'Top zipper.
- LINE sw/2,zy,sw-zta,50,2 'Top zipper.
- COLOR 100,100,100 'Grey
- RRECT (sw/2)-15,zy-25,(sw/2)+15,zy+15,10 'Fly
- RRECT (sw/2)-10,zy+10,(sw/2)+10,zy+25,5 'Fly
- COLOR 125,125,125 'lighter grey
- RRECT (sw/2)-12,zy-22,(sw/2)+12,zy+9,8 'fly center
- COLOR 0,0,255 'blue
- DRAWTEXT STR$(zp)+"%",(sw/2)+17,zy-24 'Write percent.
- RETURN 'Finish zipper drawing.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement