Advertisement
Audiation

Zipper

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