SPRITES.......QUESTIONS AND ANSWERS
ARTICLE BY DEANO
STOS sprites can certainly be a pain sometimes, well most times....oh
all right, they are a COMPLETE PAIN!!! The aim of this article is to
make using sprites a little easier to understand so there will be less
headaches and naughty words when using them.
The default sprites in STOS are software sprites, meaning that STOS has
to do a lot of work with them which makes them slow and flickery. It
spends a fair bit of processor time updating them and with them working
on interupt...also adds to problems.
Here is a few tipical questions about them along with answers...
QUESTION:- The command 'sprite 16,100,120,4' produces an error.
ANSWER:- This is because STOS only allows up to 15 sprites on the
screen at the same time. Trying to put more than this on screen at
once will produce a SPRITE error.
QUESTION:- The sprite flickers when it moves.
ANSWER:- This is because of the telly picture tube updating causing
the sprite to flicker when it passes it. Use the 'screen swap' command
to avoid this.
QUESTION:- How can I get the sprites moving more smoothly?
ANSWER:- Yes, STOS updates the sprites every 50th of a second. This
can lead to problems with speed and movement so you're best of using
the 'update off' command and updating them yourself with the update
command like this....
10 key off : hide : update off
20 sprite 1,X,Y,4 : update
QUESTION:- The more sprites I use, the slower they get.
ANSWER:- Again this is due to STOS using a lot of time to update them
all, try using less sprites on the screen at the same time. For a
shoot em up game you could have about five sprites on screen at any
one time and replace each one as it gets killed.
QUESTION:- Large sprites are difficult to handle.
ANSWER:- Yes they are...the bigger the sprite, the more time STOS uses
to update them. If you must have large sprites then use as few as
possible...about two or three on screen at the same time.
QUESTION:- The sprite flashes on screen.
ANSWER:- This is because it has colour 2 in it, STOS always flashes
this colour. Use the 'flash off' command.
QUESTION:- If I place the sprite on a picture, the colours of the
sprites are different to what they were.
ANSWER:- Pictures and sprites have their own separate palettes. When
you load a picture to the screen or unpack one from a bank STOS
adjusts its palette to the one of the screen so the sprite gets the
same palette. Load your sprites back into the 'Sprite Definer', grab
the palette from your background picture and re-colour the sprites
with the pictures colours.
QUESTION:- If I place a sprite on screen, its colours change.
ANSWER:- Again this is due to the sprite and the screen having two
different palettes. Unlike pictures STOS does'nt adjust his palette to
the one of the sprite, you have to do it yourself like this...
10 key off : mode 0 : flash off
20 XP=hunt(start(1) to start(1)+length(1),"PALT")
30 XP=XP+4 : for I=0 to 15 : colour I,deek(I*2+XP) : next I
QUESTION:- The sprite has'nt appeared on screen.
ANSWER:- There are two ways this can happen.
1> The image number you used is a blank space in the sprite
bank, so STOS displays a blank space.
2> You've given the X and Y parameters a negative value, IE: you've
typed 'sprite 1,-50,-100,4', putting it off the screen.
QUESTION:- Can I display sprites in medium rez?
ANSWER:- Yes, define them with the 'Sprite2' accessory.
QUESTION:- How can I animate about 20 images, ANIM won't do it.
ANSWER:- The 'anim' command only stores about 10 to 15 images at a
time. You'll have to animate them yourself like this.
10 key off : flash off : mode 0
20 for X=1 to 20
30 sprite 1,100,100,X : wait 20
40 next X
The 'wait' command controls the speed of the animation.
QUESTION:- How do I control a sprite using the joystick.
ANSWER:- Don't use the move command for this, it does'nt stop when you
want it to. Instead, use this routine...
10 key off : mode 0
20 if jleft then X=X-2
30 if jright then X=X+2
40 if jup then Y=Y-2
50 if jdown then Y=Y+2
60 sprite 1,X,Y,1 : wait vbl
70 goto 20
QUESTION: Why can't I move the sprite against a scrolling background?
ANSWER:- Because STOS updates scrolling quicker than it updates
sprites causing them to jerk. The best thing to do is use the 'bob'
and 'world' commands from the Missing Link extension.
Errm......the final bit.
Well thats it for this article. I hope its been useful. Actually most
STOS coders use pre-shifted sprites these days but if you are just
learning then I'm sure you'll find this article useful.
This is Deano signing off......
SPRITES.......QUESTIONS AND ANSWERS
STOS programming section.
Jump to
- GENERAL
- ↳ NEWS & ANNOUNCEMENTS
- ↳ INTRODUCE YOURSELF
- ↳ SHOW US YOUR COLLECTIONS
- ↳ CHAT FORUM PUBLIC
- ↳ MEMBER BLOGS
- ↳ ATARI MUSIC NETWORK
- ↳ ATARI FOR SALE & WANTED
- ↳ GENERAL FOR SALE & WANTED
- ↳ EXXOS WEBSTORE INFORMATION
- ↳ NOOB QUESTIONS
- ↳ CYBER LEGENDS RETRO EVENTS
- ↳ CYBER LEGENDS 5 - 2026
- ↳ CYBER LEGENDS 4 - 2025
- ↳ CYBER LEGENDS 3 - 2024
- ↳ CYBER LEGENDS 2 - 2023
- ↳ CYBER LEGENDS 1 - The Original 2022
- ATARI LIBRARY
- ↳ MOTHERBOARD REVISIONS
- ↳ STE
- ↳ STF
- ↳ ST
- ↳ MEGA STE
- ↳ MEGA ST
- ↳ STFM
- ↳ 8 BIT
- ↳ TT
- ↳ Falcon 030
- ↳ STACY
- ↳ MAGAZINES
- ↳ BENCHMARKS
- ↳ 3D MODELS
- OTHER / GENERAL HARDWARE
- ↳ 8 BIT CORNER
- ↳ DISPLAYS & CONVERTERS
- ↳ ELECTRONICS
- ↳ MSX 8 BIT COMPUTER
- ↳ OTHER 680x0
- ↳ VINTAGE GEAR ZONE
- ATARI 16 / 32 BIT
- ↳ HARDWARE
- ↳ HARDWARE ISSUES
- ↳ HARDWARE DISCUSSIONS
- ↳ BOOSTERS
- ↳ SEC 64MHZ BOOSTER
- ↳ STE V1 SERIES 32MHz BOOSTER
- ↳ ST 16MHz V2.X SERIES BOOSTERS (Discontinued 2020)
- ↳ ST V1 16MHz BOOSTER (Discontinued 2015)
- ↳ ST 16MHz V1.5 BOOSTER (Discontinued 2015)
- ↳ STE V2 BOOSTER
- ↳ STE / MSTE 68020 booster
- ↳ EVERYTHING ELSE
- ↳ ST536 030 ST ACCELERATOR
- ↳ ST 16MHz BOOSTER 2021
- ↳ DSTB1 & DFB1 booster by BadWolf
- ↳ PSU (power supplies)
- ↳ RTC (Real time clock)
- ↳ FLOPPY DRIVES KITS & UPGRADES
- ↳ RAM UPGRADES
- ↳ ROM UPGRADES
- ↳ PeST MOUSE INTERFACE
- ↳ BLAST FROM THE PAST
- ↳ HARD DRIVES
- ↳ HARDWARE ESSENTIALS
- ↳ RAVEN 060 - A homemade Atari-like computer
- ↳ RAVEN 060 - USER BUILDS
- ↳ SOFTWARE
- ↳ STOS
- ↳ SOFTWARE PROGRAMMING & DISCUSSION
- ↳ GAME ZONE
- ↳ ATARI ST REMAKE PROJECT
- ↳ ALPHA DEVELOPMENT INFO
- ↳ ALPHA USER BUILDS
- ↳ H4 MONGREL EDITION DEVELOPMENT & INFO
- ↳ MONGREL H4 USER BUILDS
- ↳ FPGA DEVELOPMENT
- ↳ H5 Phoenix Platform Edition
- ↳ H5 A3 USER BUILDS
- ↳ H5 B1 USER BUILDS
- ↳ H5 C1 USER BUILDS
- ↳ H5 C5B USER BUILDS
- ↳ LEGACY BOARD
- ↳ TWEAKS & FIXES
- ↳ BASIC TROUBLESHOOTING
- ↳ PHOENIX ZONE
- AMIGA
- ↳ Terriblefire's channel
- ↳ TF520 (OBSOLETE)
- ↳ TF530
- ↳ TF534 (OBSOLETE)
- ↳ TF328 (OBSOLETE)
- ↳ TF330
- ↳ DiagROM
- ↳ TF360
- ↳ TF536
- ↳ TF CD32 Riser
- ↳ TFMSX
- ↳ AMIGA HARDWARE HELP
- ↳ AMIGA MEMBER BLOGS
- ↳ AMIGA FOR SALE
- ↳ AMIGA SOFTWARE
