Mastering Amiga AMOS to Phil South ISBN: 1-873308-19-1 Revised Edition: May 1993 (Previously Published October 1992 Under ISBN: 1-873308-12-4)
Total Page:16
File Type:pdf, Size:1020Kb
Applicable to all Amigas Easy and Powerful Programming Hands-on Tuturial and Guide 1 . I Bruce Smith Books astering Amiga A OS Revised Edition Phil South Bruce Smith Books Mastering Amiga AMOS to Phil South ISBN: 1-873308-19-1 Revised Edition: May 1993 (Previously published October 1992 under ISBN: 1-873308-12-4) Editor: Mark Webb Typesetting: Bruce Smith Books Limited All Trademarks and Registered Trademarks used are hereby acknowledged. E&OE All rights reserved. No part of this publication may be reproduced or translated in any form, by any means, mechanical, electronic or otherwise, without the prior written permission of the copyright holder. Disclaimer: While every effort has been made to ensure that the information in this publication (and any programs and software associated with it) is correct and accurate, the Publisher cannot accept liability for any consequential loss or damage, however caused, arising as a result of using the information printed herein. Bruce Smith Books is an imprint of Bruce Smith Books Limited. Published by: Bruce Smith Books Limited, PO Box 382, St. Albans, Herts, AL2 3JD. Telephone: (0923) 894355 — Fax: (0923) 894366. Registered in England No. 2695164. Registered Office: 51 Quarry Street, Guildford, Surrey, GU1 3UA. Printed and bound in the UK by Ashford Colour Press, Gosport. The Author Phil South is a writer and journalist, who started writing for a living in 1984, when he realised he couldn’t actually stand working for anyone but himself. He says his popular columns in magazines such as Computer Shopper, Amiga Format and Amiga Computing are much harder to write than they are to read. Apart form being a writer, he’s a heavy duty film buff and owns an ever growing archive of ex-rental and sell-through videos. He’s just at the moment agonising over the benefits of Laserdisc, although he admits that’s just because it's a gadget. His hobbies are watching movies on video, flying model rockets, and he has recently revived an interest in conjuring, although he says interest and proficiency are two different things. Phil Lives in Somerset with his wife Stacey, daughter Harriet Rose and more videos than a small branch of Our Price Records. Mastering Amiga AMOS Contents I Contents Preface .............................. .. ....l3 Without Whom ...................... .. .....16 1: Introduction to AMOS .. I I n I I I I I I I I I I I I I I I I I I I I I I I I I Q I I a p | Q p p J Q - - '1 ....l7 AMOS Genesis ...................... .. l D I I I I I I I I I I I I I I I 0 D I I I O I I I I I I I l l I I I Q I i I I I II .....18 After STOS ............................. .. u Q u M u u n n n I I - I I Q U I I I I I I I I Q I Q Q I Q Q n n - n n a n ; Q Q I. .....l9 The Future ............................ .. I I - I I I I I I I I I I . Q . I I I I I . _ . — I Q I I I I I I I ‘ . I I I I. .....2O 2: Basic Principles ............ .. ....2l How AMOS Works .................. .. .....22 The Editor ............................. .. I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I O O I I I I II .....23 AMOS Editor Commands ....... .. I I I I I I O I I I I U I l I I I I I I I I I I I I I I I Q Q Q Q | | Q Q Q Q Q ¢ I I .....24 System Menu ................................. .. - . - I I - Q F I I I I I I I I I I I I I I I I I I I I I I I I I I I .....25 I Blocks Menu .......................... .. I I I I I I I I I I I I I I I I I I I I I I I Q I Q Q - Q I I I I I I . I I - I - I I .....26 . Search Menu .......................... .. I I I I I I I I I I I I I . I I I I I I I I I I I I I I I I I Q . Q I I I I I I I I I .....27 Using the Mouse ................... .. I Q I I I U I I I I I I I I U I I I I I I I . I I ' I I — Q I I I I I I I I I I I II .....3O Direct Mode ..................................................................... .. .....31 Compressing Graphics ..................................................... .. .....32 The Config Program ......................................................... .. .....34 AMOS Compiler and AMOS 3-D .....34 TOME..................................... .. .....35 So That’s AMOS ................................................. .. .....35 3: Program Structures ........ .. ......................................... ..37 Dem Bones, Dem Bones ........ .. I I I I I I O I I I I I I I I I I I I I I I I I I I I I O I I I I I I I I I I I I II .....37 Proc and Roll ......................... .. I I I I I I I I I I I I I I I I I I I I I l I I I I I O I I U Q 0 n Q I n I I I I I I .....38 What’s Up, Procs? .................. .. I I I i I I I I I I I I I I I I I I I I O I Q I I I I I I I I I I I I I I I I ‘ ] II .....41 Going Loopy.......................... .. I I I I I I I I I I I I O I I I I I I I U I I h I I I I I q p Q Q p q Q I Q Q J | 1| .....41 Various Variables .................. .. I I I I I l I I I I I I I l I I I I I I I I I I O I I O i I I I I I I I I I I I I II .....43 Are You Def? ......................... .. U I I I I . I I I I I I D I I I I I I U I I I I Q I Q I I I I I I I I I I I I I I II .....44 Daddy Pop ............................ .. I I I I I I I I I I I I I I I I U I I I I I I I I ' Q Q ' Q Q | Q | | | Q Q | | I II .....-45 Cooking with AMAL............... .. I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I .....45 Mastering Amiga AMOS | Music and Graphics .................... .. More Variable than Not ............... .. 4: Graphics ................................... Painting with Maths .................... .. Drawing on the Screen ................ .. Pretty Polys ................................. .. Warp-Factor 2 ............................. .. Req the Place............................... .. I Over the Rainbow ....................... .. Ello Ello Ello ................................ .. Rainbow Ping .............................. .. Moving Rainbows ........................ .. Footnote ...................................... .. 5: Screens .................................... .. Screen Open ................................ .. Interlaced Screens....................... .. Hide and Seek ............................. .. Dual Playfield ............................. .. Display that Screen! .................... .. Screen Clone ............................... .. Special FX .................................... .. More Special FX ........................... .. Let’s Splerge! ............................... .. 6: Windows, Text and Menus Clean Windows ........................... .. Slide, Charlie Brown.................... .. No Text Please ............................ .. Two Types Text .......................... .. A Word about CText .................... .. Curse of the Cursors ................... .. Simple Menus .............................. .. Contents M More Advanced Menus ....... .. 94 - Graphic Menus ................... .. ................................................. ..96 Cursor the Crimson Altar II. ................................................. ..97 Hyper Hypertext ................ .. ............................................... ..lOO 7: CText ............................................................................... ..101 I, CText .............................. .. ............................................... ..1o1 Installing ............................ .. ............................................... ..102 Using CText ....................... .. ............................................... ..103 CText Commands .............. .. ............................................... ..105 Making a CText Font .......... .. ............................................... ..107 CText, How Easy It ls ......... .. ............................................... ..108 8: Maths Functions........................................................ .. 109 Let’s Talk about Maths ....... .. ............................................... ..109 Basic Functions .................. .. ............................................... ..11O AMOS Maths ....................... .. ............................................... ..110 A Few Degrees .................... .. ............................................... ..111 A Slice of Pl ........................ .. ............................................... ..111 Trigonometry Fountain ...... .. ............................................... ..l13 Fractal Maths ...................................................................... ..114 More AMOS Maths Functions .............................................. ..116 ' Gimme a Vector, Victor ...... .. ............................................... ..116 = Bone Up Your Maths .......... .. ............................................... ..119 9: Sprites and Bobs ....................................................... ..121 Don‘t Get Confused ............ .. ............................................... ..122 Creation of Sprites and Bobs ................................................123 Animation .......................... .. .................................................123 Moving ............................... .. .................................................125 Collision Detection ............ .. .................................................125 ' Sprite Viewing .................... .. .................................................129 Bullets ................................ .. ............................................... ..130 For Your Information ......... .. .................................................132 Mastering Amiga AMOS 10: SpriteX .............................................................