home *** CD-ROM | disk | FTP | other *** search
/ AMOS PD CD / amospdcd.iso / 601-625 / apd602 / simple_anim.amos / simple_anim.amosSourceCode < prev    next >
AMOS Source Code  |  1993-02-25  |  3KB  |  106 lines

  1. '
  2.  
  3.  
  4.  
  5. '==============================================================
  6. 'This Source code is from The Absolute Beginners Guide To Amos 
  7. 'Which is Licenceware and available from F1 for 2.99 P+P free
  8. 'The disk contains 20 chapters covering the first 110 commands 
  9. 'every new user will need to get to grips with.
  10. 'Also included are 18 example programs such as this one that 
  11. 'relate to the tutorials and many extras besides 
  12. 'If you a new to Amos you need this product! 
  13. 'To cut the files down I have saved the pic+bobs inside the source 
  14. 'and disabled the original load commands 
  15. '=============================================================== 
  16. Rem example10_2.amos 
  17. 'See Chapter 10 for more a close up on all the commands covered here 
  18. '
  19. '
  20. Rem A very simple but effective mini animation 
  21. '
  22. '
  23. Rem the usual stuff. 
  24. Flash Off : Curs Off : Paper 0 : Hide : Cls 0
  25. '
  26. '
  27. Rem To ensure flicker free bobs,don't really need in this short routine though 
  28. Double Buffer 
  29. '
  30. '
  31. Rem load in the sprite bank into bank 1
  32. 'Load "df0:bobs/spacecraft.abk"
  33. '  
  34. '
  35. Rem load the background pic into current screen
  36. 'Load Iff "df0:pics/space.iff",0 
  37. Unpack 10 To 0
  38. '
  39. '
  40. Rem assign 2 Amal channels to bob 1, one for each animation
  41. Channel 1 To Bob 1
  42. Channel 2 To Bob 1
  43. '
  44. '
  45. Rem Display BOB 1 at -48 pixels across - off the edge of the screen  
  46. Rem and 20 pixels down the screen  
  47. Rem the 1 on the end is the current image from the bob bank. 
  48. Bob 1,-48,20,1
  49. '
  50. '
  51. Rem set up the animation sequence, images 1 to 4 animate the engine flame
  52. Rem the 5 is the delay in 50ths of a second between each frame, change the   
  53. Rem 5s to see the animation in slow or faster motion.  
  54. Rem the L at the end tells Amos we want the animation to Loop continuously 
  55. Rem and not just play once, remove the L to see the effect.
  56. Rem the second Anim string is for the explosion  
  57. Anim 1,"(1,5)(2,5)(3,5)(4,5)l"
  58. Anim 2,"(17,5)(18,5)(19,5)(20,5)(21,5)(22,5)(23,5)(24,5)(25,5)"
  59. '
  60. '
  61. Rem Tell Amos to start the engine flame Animation  
  62. Anim On 1
  63. '
  64. '
  65. Rem set up the move instruction to Move the ship 370 pixels across the screen  
  66. Rem at speed 1 
  67. Move X 1,"(1,1,370)"
  68. '
  69. '
  70. Rem actually set ship in motion
  71. Move On 
  72. '
  73. '
  74. Rem as the anims are on interrupt we have to hang on here until the ship   
  75. Rem reaches 370 pixels across, approx. the timing will be slower om A500 
  76. Rem (I'm using an A1200) 
  77. Rem so you may want to change the length of this wait. 
  78. Wait 300
  79. '
  80. '
  81. Rem The wait is over so stop the movement. 
  82. Move Off 
  83. '
  84. '
  85. Rem stop the engine flame anim 
  86. Anim Off 1
  87. '
  88. '
  89. Rem start the explosion anim 
  90. Anim On 2
  91. '
  92. '
  93. Rem do an explosion sound
  94. Boom 
  95. '
  96. '
  97. Rem the timing here is critical for a good effect
  98. Wait 25
  99. '
  100. '
  101. Rem turn off the animations and clear the bob  
  102. Anim Off : Bob Off 
  103. '
  104. '
  105. Rem  
  106. Wait 75 : Edit