Advertisement
Guest User

Untitled

a guest
Jan 7th, 2017
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
GAMBAS 1.37 KB | None | 0 0
  1. '
  2. ' Your code goes here
  3. ' Have fun!
  4. '
  5. rlist=(RAPTOR_LIST *)strptr(RAPTOR_sprite_table)
  6. basic_r_indx=1
  7. basic_r_size=1
  8. RLOCATE 0,202
  9. RPRINT "          RAPTOR BASIC+ - REBOOT        "
  10. basic_r_size=0
  11. basic_r_indx=0
  12. RLOCATE 0,218
  13. RPRINT "        Derived from BCX BASIC v6       "
  14.  
  15. cls
  16. 'set variables and arrays
  17. dim screen[320,200] as short
  18. dim x%,y%,counter%,d%,xo%,yo%,dnew%,sticky%,i%,j%
  19. dim dice!
  20. for i%=0 to 319
  21.     for j%=0 to 199
  22.         screen[i%,j%]=0
  23.     next j%
  24. next i%
  25. 'logic
  26. screen[160,100]=1
  27. colour 2
  28. plot (160,100)
  29. xo%=0
  30. yo%=0
  31. x%=0
  32. y%=0
  33. do
  34. 'let particle
  35.     d%=d%+5
  36.     xo% = 160+d%*cos(rnd*360)
  37.     yo% = 100+d%*sin(rnd*360)
  38.        
  39.     randomize(counter%)
  40.     sticky%=0
  41.     for i%=1 to 200
  42.         vsync
  43.     next i%
  44.  
  45.     while sticky% = 0
  46.         dice! = rnd
  47.        
  48.         if dice!<= 0.25 then
  49.             x%=xo%+1
  50.             plot(x%,y%)
  51.         elseif dice! <= 0.5 then
  52.             x%=xo%-1
  53.             plot(x%,y%)
  54.         elseif dice! <= 0.75 then
  55.             y%=yo% +1
  56.             plot(x%,y%)
  57.         elseif dice! <=1 then
  58.             y%=yo% -1
  59.             plot(x%,y%)
  60.         end if
  61.     print x%, "          ", y%
  62.     for i%=1 to 100
  63.         vsync
  64.     next i%
  65.  
  66.     'check for sticky
  67.         if screen[x%+1,y%] or screen[x%,y%+1] or screen[x%,y%-1] or screen[x%-1,y%] =1 then
  68.             sticky%=1
  69.             screen[x%,y%]=1
  70.             plot (x%,y%)
  71.             counter%=counter%+1
  72.             rprint(counter%)
  73.             if sqrt(x%*x%+y%*y%)>d% then
  74.                 d%=sqrt(x%*x%+y%*y%)
  75.             end if
  76.         else
  77.             xo%=x%
  78.             yo%=y%
  79.         end if
  80.     wend
  81. loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement