DEMOSCENEDEMOS ★ STAR WARS TRENCH (AMSTRAD COMPUTER USER) ★

Star Wars Trench (Amstrad Computer User)Demoscene Demos
★ Ce texte vous est présenté dans sa version originale ★ 
 ★ This text is presented to you in its original version ★ 
 ★ Este texto se presenta en su versión original ★ 
 ★ Dieser Text wird in seiner Originalfassung präsentiert ★ 

.....puts a little action into your graphics with the ink switching facility in the CPC464 colour pallette

The month since I wrote the last column has been a mixture of disappointments and delights. Because of the time lag between the writing of an article and the magazine actually being published I am writing about October/early November, although you may not read this until late November.

Disappointment 1 was the theft of the only draft of this article from my car whilst returning from holiday. However it's an ill wind that blows nobody good, and I was delighted to be able to try out an early version of TASWORD on the CPC464 when re-writing this.

Disappointment 2 was a visit to the IBM USER show at OLYMPIA in early September, where I had hoped to be treated to a display of‘State of the art' graphics. The cheapest computer there cost around £2000 + VAT and ranged upwards to mainframes costing over £100,000. Given the cost of the kit it didn't seem unreasonable to expect to see applications which were of a significantly higher standard than can be achieved on home micros.

Alas, for the business micros which I saw, the reverse case was true. The sort of colour graphics which are available on your CPC464 are at least as good as on general purpose machines costing up to £5000. Only the very expensive mini/mainframe machines linked to colour plotters (costing many times the price of an AMSTRAD) offered facilities which could not be matched on the CPC464 with a few hours careful work.

This month I want to take a look at the subject of animation. Whilst this is normally associated with machine code routines written by genius programmers in the small hours of the night the CPC464 has a feature which will allow us to create some spectacular effects using BASIC. The MASKED INKS feature which is implemented in the hardware is similar to the colour switching used on full arcade games machines.

The way this works is best illustrated by an example. Imagine one of those painting by numbers outfits where the canvas is marked out with the number of each colour to be used. The box contains a number of pots of paint each given a different number. If we assume that there are 27 numbers, ranging from 0 BLACK to 26 BRIGHT WHITE, these will correspond to the CPC464 colours shown in APPENDIX IV page 6 of your user manual.

If you can also visualise a set of rules under which we cannot paint directly from the pots of paint but must use a pallette. This pallette has only four pads onto which we can transfer paint from the pots. Let's say that pad number 1 contains BRIGHT GREEN from pot number 18 and we start to paint the picture. The bit of magic in our system

comes when we wipe pad number 1 clean and pour on some paint from pot number 24 then all the BRIGHT GREEN on our picture would change to BRIGHT YELLOW.

The CPC464 can perform this type of colour switching very quickly indeed and we can take advantage of this feature to produce animated effects. Our program for this month imitates the ‘flying through the trench' scene from the Star Wars film, and uses a rotation sequence of the pallette colours to give the illusion of movement along the trench.

The major tasks in achieving the animated effect are:-

1) Set up the colours on the pallette.
2) Draw the picture.
3) Rotate the colours on the pallette.

Program commentary.
LINES 170 to 200Select forward or backward motion.
LINES 210 to 220Produce a sound to match the speed of the motion. The variable rep is kept above 10 so that the sound remains in an audible frequency.
LINES 290 to 390 Draw the trench by repeatedly drawing the 3 sides of a square and increasing the side length. Colours are changed at decreasing intervals so that the bands simulate perspective.
LINES 500 to 530 Set up the pallette colours. Note that pads 1 & 2 have the same PHYSICAL colour (ie BRIGHT YELLOW) but the computer treats them as different LOGICAL colours. This allows us to ROTATE the pads more effectively.
LINES 550 & 560 Make the joystick and cursor keys produce the same codes to simplify programming for dual control.
LINES 610 to 780 & LINES 820 to 990Successively ROTATE the LOGICAL colours around the to pallette to produce the illusion of movement. Note that pad 0 (i.e. INK 0) is kept BLACK because this is the background colour.

Run the program in MODE 1 using the UP ARROW or joystick forwards U) move along the trench and the DOWN ARROW or joystick back to reverse. Using this program as a base you could write an interesting ‘blast the alien' game.

ACU #8502

★ PUBLISHER: Amstrad Computer User
★ YEAR: 1985
★ CONFIG: 64K + AMSDOS
★ LANGUAGE:
★ LiCENCE: LISTING
★ COLLECTION: AMSTRAD COMPUTER USER 1985
★ AUTHOR: David ROBINSON
 



★ AMSTRAD CPC ★ DOWNLOAD ★

Dump disquette:
» Star  Wars  Trench    (Amstrad  Computer  User)    ENGLISH    LISTINGDATE: 2025-04-18
DL: 48
TYPE: PDF
SiZE: 113Ko
NOTE: 1 page/PDFlib v1.6

★ AMSTRAD CPC ★ A voir aussi sur CPCrulez , les sujets suivants pourront vous intéresser...

Lien(s):
» Demoscene » StarScroll Demo (Amstrad Computer User)
» Papermag » Star Games 3
» Slideshow » Starwars Screen
» Demoscene » Star-Dot (Amstrad Action)
» Demoscene » Tri-Star-Demo
» Demoscene » Poly Stars (Amstrad Action)
Je participe au site:
» Pour ce titre nous ne disposons de fichier executable sur CPC (Dump, Saisie du listing) , alors si vous avez ça dans vos cartons ou vous désirez usé vos petit doigts boudinés sur votre clavier faites le nous savoir.
» Vous avez des infos personnel ?
» Vous avez remarqué une erreur dans ce texte ?
» Aidez-nous à améliorer cette page : en nous contactant via le forum ou par email.

CPCrulez[Content Management System] v8.732-desktop/c
Page créée en 315 millisecondes et consultée 188 fois

L'Amstrad CPC est une machine 8 bits à base d'un Z80 à 4MHz. Le premier de la gamme fut le CPC 464 en 1984, équipé d'un lecteur de cassettes intégré il se plaçait en concurrent  du Commodore C64 beaucoup plus compliqué à utiliser et plus cher. Ce fut un réel succès et sorti cette même années le CPC 664 équipé d'un lecteur de disquettes trois pouces intégré. Sa vie fut de courte durée puisqu'en 1985 il fut remplacé par le CPC 6128 qui était plus compact, plus soigné et surtout qui avait 128Ko de RAM au lieu de 64Ko.