★ DEMOSCENE ★ DEMOS ★ STAR WARS TRENCH (AMSTRAD COMPUTER USER) ★![]() |
Star Wars Trench (Amstrad Computer User) | Demoscene Demos |
.....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.
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.
|