home *** CD-ROM | disk | FTP | other *** search
AMOS Source Code | 1991-08-02 | 3.2 KB | 55 lines |
- '3D moving cube
- 'Written by Paul Townsend of Technical Fred Software for TOTALLY AMOS
- 'If you use any of this code in your own demos then please mention
- 'where you got it from in your credits
- Screen Open 0,320,256,2,Lowres : Rem ************************************
- Flash Off : Rem * *
- Curs Off : Rem * Set up a lowres screen *
- Cls 0 : Rem * with two colours *
- Palette 0,$FFF : Rem * *
- Ink 1 : Rem ************************************
- Screen Open 1,320,256,2,Lowres : Rem ************************************
- Flash Off : Rem * *
- Curs Off : Rem * and another one *
- Cls 0 : Rem * as a buffer *
- Palette 0,$FFF : Rem * *
- Ink 1 : Rem ************************************
- Hide On : Rem * *
- ST=100 : Rem * Set up a few variables *
- ST1=ST+50 : Rem * *
- OFFSET=ST+10 : Rem * Don't ask how it works, *
- OFFSET1=ST1+50 : Rem * I don't even know myself *
- L00PSIZE=Max(OFFSET,OFFSET1) : Rem * This program started of with *
- L00PSIZE=10+(L00PSIZE/2) : Rem * no planning, I just juggled the *
- L00PSIZE=Max(L00PSIZE,200) : Rem * numbers until it looked good *
- For Z=-L00PSIZE To L00PSIZE : Rem ************************************
- Add SCR,1,0 To 1 : Rem * *
- Screen To Front SCR : Rem * This is the main draw loop *
- Wait Vbl : Rem * The Z variable is used to *
- Screen Abs(SCR-1) : Rem * simulate the Z axis *
- Wait Vbl : Rem * Offset simulates the size of *
- Cls 0 : Rem * the cube *
- Box ST-Z,ST-Z To ST1+Z,ST1+Z : Rem************************************
- Box OFFSET-Z-Z,OFFSET-Z-Z To OFFSET1+Z+Z,OFFSET1+Z+Z : Rem
- Draw ST-Z,ST-Z To OFFSET-Z-Z,OFFSET-Z-Z : Rem
- Draw ST1+Z,ST1+Z To OFFSET1+Z+Z,OFFSET1+Z+Z : Rem
- Draw OFFSET1+Z+Z,OFFSET-Z-Z To ST1+Z,ST-Z : Rem
- Draw ST-Z,ST1+Z To OFFSET-Z-Z,OFFSET1+Z+Z : Rem
- Rem
- Wait Vbl
- Next Z
- Edit
- Procedure W
- Rem Wait Key Alias Proc
- Rem Useful procedure when testing the program
- Rem you can wait for a key press by simple using the command W
- Rem which is much quicker to type than Clear Key : Wait Key
- Rem especialy when using a lot of waits
- Rem Although in normal programs I would not bother with these Rems
- Rem These are for your benefit only, it may be a good idea to remove them
- Rem if you use the procedure yourself
- Rem I mean this procedure would only be two lines long if it wasn't for
- Rem all these silly Rem statements
- Clear Key
- Wait Key
- End Proc