Advertisement
treytomes

FIREWORKS.BAS

Dec 23rd, 2020
266
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 1 DIM PX(200)
  2. 2 DIM PY(200)
  3. 3 DIM VX(200)
  4. 4 DIM VY(200)
  5. 5 DIM PC(200)
  6. 6 SX=320/2:SY=192/2:CT=0
  7. 10 POKE 65497,0
  8. 11 GOSUB 301:'SETUP THE PALETTE
  9. 12 FOR N=1 TO 200:GOSUB 101:NEXT N:'GENERATE SOME DOTS
  10. 13 HSCREEN 2:'320X192 W/ 16 COLORS
  11. 14 HCLS 0:'BLACK
  12. 16 FOR N=1 TO 200
  13. 17 IF PX(N)<0 OR PX(N)>319 OR PY(N)<0 THEN GOTO 19:'DON'T DRAW OFFSCREEN
  14. 18 HSET(PX(N),PY(N),0)
  15. 19 PX(N)=PX(N)+VX(N)
  16. 20 PY(N)=PY(N)+VY(N)
  17. 21 VY(N)=VY(N)+.1:'ACCOUNT FOR GRAVITY
  18. 22 IF PC(N)>1 THEN PC(N)=PC(N)-RND(10)/10
  19. 23 IF INT(PC(N))=0 THEN PC(N)=1
  20. 24 IF PY(N)>191 THEN GOSUB 101:'GENERATE A NEW DOT
  21. 25 IF PX(N)<0 OR PX(N)>319 OR PY(N)<0 THEN GOTO 27:'DON'T DRAW OFFSCREEN
  22. 26 HSET(PX(N),PY(N),INT(PC(N)))
  23. 27 NEXT N
  24. 28 CT=CT+1:IF CT>10 THEN SX=RND(320):SY=RND(192/2):CT=0
  25. 29 GOTO 16
  26.  
  27. 100 'GENERATE A NEW DOT (N=NEW DOT INDEX)
  28. 101 PX(N)=SX:'RND(320)-1
  29. 102 PY(N)=SY:'RND(192)-1
  30. 103 VX(N)=(RND(50)-30)/10
  31. 104 VY(N)=RND(30)/-10
  32. 105 PC(N)=15:'RND(16)-1
  33. 106 IF PC(N)=0 GOTO 105
  34. 107 RETURN
  35.  
  36. 300 'SETUP THE PALETTE
  37. 301 PALETTE 0,0
  38. 302 PALETTE 1,1
  39. 302 PALETTE 2,8
  40. 303 PALETTE 3,15
  41. 304 PALETTE 4,13
  42. 305 PALETTE 5,12
  43. 306 PALETTE 6,40
  44. 307 PALETTE 7,33
  45. 308 PALETTE 8,32
  46. 309 PALETTE 9,36
  47. 310 PALETTE 10,38
  48. 311 PALETTE 11,52
  49. 312 PALETTE 12,53
  50. 313 PALETTE 13,54
  51. 314 PALETTE 14,62
  52. 315 PALETTE 15,63
  53. 316 RETURN
  54.  
Advertisement
RAW Paste Data Copied
Advertisement