|
-
Hype over content...
You don't actually have to do either for a shooter ( Just to muddy the water )
How about this: Just have all the bullets and baddies as author time content ? Just slap those sprites straight down on the stage.
Arrange your sprites like you would your tiles in a scroller. So all the bullet sprites contain all the frames for all the bullet types so you can just gotoAndPlay to the correct frame, and then same with all your baddies.
Cause they are already sitting on your stage, you don't have the overhead of having to attach or duplicate when you need them.
Remember, when you press fire you've got a load of stuff to do. Firstly you'd attach / duplicate your bullet. Run a thumping sfx. Set a flag to say the bullet is running, put collision checks in place for it etc.
If it's already there, you miss out a stage of that ( The slowest stage at that ).
Also your game won't suffer slow down, because every sprite is already present you just request a free sprite when it's needed ( Say when a baddie wants to shoot ). If there's no free sprite, then it can't shoot.
That way on later levels when you've bumped that baddie fire power up high you don't have to worry about too many sprites on screen, cause it will never be greater than your already max number of sprites.
( Ok, you can still do this with dynamic allocation but it's easier this way ).
I did it this way for shooter games cause of the old days of having a C64 and Amiga, where you had a set number of hardware sprites to use, so I got used to recycling the same ones for different uses.
It also means you can test the game on it's max settings ( All your sprites running ) nice and easily and see how adding new code to your game affects it's overal speed.
Squize.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|