home *** CD-ROM | disk | FTP | other *** search
AMOS Source Code | 1993-02-25 | 2.7 KB | 106 lines |
- '
-
-
-
- '==============================================================
- 'This Source code is from The Absolute Beginners Guide To Amos
- 'Which is Licenceware and available from F1 for 2.99 P+P free
- 'The disk contains 20 chapters covering the first 110 commands
- 'every new user will need to get to grips with.
- 'Also included are 18 example programs such as this one that
- 'relate to the tutorials and many extras besides
- 'If you a new to Amos you need this product!
- 'To cut the files down I have saved the pic+bobs inside the source
- 'and disabled the original load commands
- '===============================================================
- Rem example10_2.amos
- 'See Chapter 10 for more a close up on all the commands covered here
- '
- '
- Rem A very simple but effective mini animation
- '
- '
- Rem the usual stuff.
- Flash Off : Curs Off : Paper 0 : Hide : Cls 0
- '
- '
- Rem To ensure flicker free bobs,don't really need in this short routine though
- Double Buffer
- '
- '
- Rem load in the sprite bank into bank 1
- 'Load "df0:bobs/spacecraft.abk"
- '
- '
- Rem load the background pic into current screen
- 'Load Iff "df0:pics/space.iff",0
- Unpack 10 To 0
- '
- '
- Rem assign 2 Amal channels to bob 1, one for each animation
- Channel 1 To Bob 1
- Channel 2 To Bob 1
- '
- '
- Rem Display BOB 1 at -48 pixels across - off the edge of the screen
- Rem and 20 pixels down the screen
- Rem the 1 on the end is the current image from the bob bank.
- Bob 1,-48,20,1
- '
- '
- Rem set up the animation sequence, images 1 to 4 animate the engine flame
- Rem the 5 is the delay in 50ths of a second between each frame, change the
- Rem 5s to see the animation in slow or faster motion.
- Rem the L at the end tells Amos we want the animation to Loop continuously
- Rem and not just play once, remove the L to see the effect.
- Rem the second Anim string is for the explosion
- Anim 1,"(1,5)(2,5)(3,5)(4,5)l"
- Anim 2,"(17,5)(18,5)(19,5)(20,5)(21,5)(22,5)(23,5)(24,5)(25,5)"
- '
- '
- Rem Tell Amos to start the engine flame Animation
- Anim On 1
- '
- '
- Rem set up the move instruction to Move the ship 370 pixels across the screen
- Rem at speed 1
- Move X 1,"(1,1,370)"
- '
- '
- Rem actually set ship in motion
- Move On
- '
- '
- Rem as the anims are on interrupt we have to hang on here until the ship
- Rem reaches 370 pixels across, approx. the timing will be slower om A500
- Rem (I'm using an A1200)
- Rem so you may want to change the length of this wait.
- Wait 300
- '
- '
- Rem The wait is over so stop the movement.
- Move Off
- '
- '
- Rem stop the engine flame anim
- Anim Off 1
- '
- '
- Rem start the explosion anim
- Anim On 2
- '
- '
- Rem do an explosion sound
- Boom
- '
- '
- Rem the timing here is critical for a good effect
- Wait 25
- '
- '
- Rem turn off the animations and clear the bob
- Anim Off : Bob Off
- '
- '
- Rem
- Wait 75 : Edit