★ APPLICATIONS ★ CREATION GRAPHIQUE ★ GENERADOR DE SPRITES / AMSTRAD SPRITES / SPRITE DESIGNER ★ |
AMSTRAD SPRITES![]() | Generador de Sprites![]() |
Jason Charlesworth improves the Amstrad's graphics quality. The Amstrad is a very well designed computer which is extremely strong in all areas except that of graphics. It has the usual Plot and Draw commands but docs not contain any sprite routines, Fill commands or Scroll command unlike most recent computers. This article should rectify this by adding five new Basic commands to Amstrad Basic. These are actually new commands, not just a sequence of Pokes and Calls. Listing I, when entered and run will provide these commands but before the commands can be used they must be activated by Call 37000. The commands provided are: SPRITEOFF,X,Y — This is the same as for Spriteon except that as it removes a Sprite instead of printing it, no sprite number is needed. FILL,X,Y,Z — X - X co-ord and Y « Y co-ord using normal co-ordinates. z = pen in which the filling is to be done. This works on any mode. SCROLLU — This scrolls the screen up one line. SCROLLD — This scrolls the screen down one line. All the commands need to be prefixed by the extended colon — character above the @ on the keyboard. This is the method of telling the Amstrad that the new commands exist. If you have typed in the run listing 1, save the resultant code with save "commands" , b, 37000,500 and any time you need these commands, load them in with memory 36999: Load"":Call 37000. The second listing, listing 2 is a sprite editor and this creates the code for the sprite design — without it the first two commands are almost useless. Type in and run listing 2 and type how many sprites you want to define. You will then be presented with a grid, a list of the colours to one side and a list of the commands at the top. You can move your cursor round the grid — using joystick 1 or cursor keys and setting or resetting the colour to Pen colour or background colour respectively using the fire or Copy key.. This means pressing the fire or copy key will set a cell to the present pen colour and pressing it again will return the cell to background colour. The commands at the top are: P — Change the present pen — the colour of the pens are printed to the right of the screen I — Change the colour of one of the pen's ink. N — Start working — or continue working — on another sprite. C — Clears a sprite and returns to a dear grid. S — Saves the sprites to tape. Using all these commands, complex sprites can be designed and saved to tape. In future they may be loaded into memory using Load "" and used by the sprite commands as previously described. The final listing — listing 3 gives a demo of the commands. To run this, type in the program then load in the new commands with Memory 36999:Load “”: Call 37000 and then run it. This demo illustrates how to use all the commands but the most interesting is the sprite demonstration. By using the Amstrad interrupt facility, the Amstrad keeps removing the sprite, moving it a bit then replacing it, animating it. If, however, several sprites are used and/or the amount they move is large the movement is jerky — the first sprite demonstration. However if a limited number of sprites are used and these move perhaps I pixel at a time, the movement is very smooth — sprite demonstration 2. Finally, it should be noted that the Fill and the Spriteon commands assume that the background colour is pen 0 and unpredictable events may occur if this is not so but this should be no major problem as on switching on, the computer immediately makes pen 0 the paper colour. YR |
| ![]() |
|