home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / Amos / AmosCRAFT2Turbo.DMS / in.adf / demos / general / StarfieldDemo1.AMOS / StarfieldDemo1.amosSourceCode
Encoding:
AMOS Source Code  |  1994-01-29  |  2.1 KB  |  84 lines

  1. 'Little starfield demo...
  2. '
  3. 'These routines have their limitations...
  4. '
  5. 'The "STARS" are only drawn in the first bitplane, but it has the advantage
  6. 'that you can display BOB's on top of the "STARS" whithout having to save  
  7. 'the background of them !
  8. '
  9. 'Read the Set Bob command in the AMOS manual for better understanding of 
  10. 'this process !
  11. '
  12. 'No more than 4000 "STARS" can be defined... 
  13. '
  14. 'The amount of stars you can display on the screen in 1 VBL depends of the 
  15. 'X SPEED and Y SPEED parameters... 
  16. '
  17. 'If you only use X SPEED (so X SPEED <> 0 but Y SPEED = 0), then 670 STARS 
  18. 'are the limit.
  19. '
  20. 'If you only use Y SPEED (X SPEED = 0 but Y SPEED <> 0), then 660 STARS  
  21. 'are the limit.
  22. '
  23. 'If you use both speeds (X SPEED <> 0 AND Y SPEED <> 0), then 520 STARS
  24. 'are the limit.
  25. '
  26. 'You may define more stars but the display will flimmer... 
  27. '
  28. 'Owners of accelerator cards can display more 'STARS', this is because 
  29. 'I use the 68000 processor to display the 'STARS' !!!
  30. '
  31. 'Maybe in the future I'll make some SPRITE "STAR" routines...
  32. '
  33. Close Editor 
  34. Hide On 
  35. Screen Open 1,320,250,4,Lowres
  36. Double Buffer 
  37. Autoback 0
  38. Curs Off 
  39. Wait Vbl 
  40. Screen Open 2,320,250,4,Lowres
  41. Curs Off 
  42. Cls 0
  43. For I=1 To 31
  44.    Colour I,0
  45. Next 
  46. Colour 2,$AC
  47. Colour 3,$F00
  48. Colour 9,$FFF
  49. Wait 50
  50. Dual Playfield 2,1
  51. Dual Priority 1,2
  52. For I=1 To 16 : Print " AMOS !! STARS !! AMOS !! STARS !! AMOS " : Next 
  53. Ink 3
  54. Text 12,78,"ROUTINES FOR AMOS CODED BY ! MADMAX !"
  55. Text 30,110,"OOPS IT'S SNOWING STARS TODAY !!!"
  56. Text 30,142,"PRESS LEFT MOUSE BUTTON TO STOP !"
  57. Screen 1
  58.  Extension_12_03A2 520
  59. For I=1 To 520
  60.     Extension_12_03B6 I,Rnd(319),Rnd(239),Rnd(3)+1,Rnd(2)
  61. Next 
  62.  Extension_12_0434 0,0,319,239
  63.  Extension_12_0016 
  64. Repeat 
  65.    Add COUNT,1,1 To 451
  66.    Screen Swap 
  67.     Extension_12_00A6 0
  68.    '  Only 1 plane is cleared 
  69.     Extension_12_0380 1
  70.     Extension_12_03D0 
  71.    If COUNT=150
  72.        Extension_12_041C 1 To 200,Rnd(4)+1,Rnd(3)
  73.    Else 
  74.       If COUNT=300
  75.           Extension_12_041C 100 To 300,-Rnd(3),Rnd(2)+1
  76.       Else 
  77.          If COUNT=450
  78.              Extension_12_041C 50 To 150,-(Rnd(3)+1),-Rnd(3)
  79.          End If 
  80.       End If 
  81.    End If 
  82. Until Extension_12_0392 
  83.  Extension_12_03E4 
  84.  Extension_12_0006