Author Topic: Good Features for Sprite Library?  (Read 5509 times)

0 Members and 1 Guest are viewing this topic.

Offline spathi

  • C= 64
  • **
  • Posts: 78
  • Karma: 5
    • View Profile
Good Features for Sprite Library?
« on: March 29, 2012 »
Hey gents, I'm currently writing a small sprite library containing various animation functions.  I'm wondering if anyone has any ideas for functionality that I could include.

I have such things as fades, with function pointers to different ramping functions.

Ideally I would like all those ramps to be generic and usable for numerous different features, like smooth interpolation between color values.

There are also various types of bouncing and jiggling.

I'm just soliciting ideas so that I can put as much as possible into the library while I have the code fresh in my mind.

Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2757
  • Karma: 493
    • View Profile
    • https://www.rbraz.com/
Re: Good Features for Sprite Library?
« Reply #1 on: April 03, 2012 »
Hi spathi,

How about sprite collision and rotation functions.

Challenge Trophies Won:

Offline spathi

  • C= 64
  • **
  • Posts: 78
  • Karma: 5
    • View Profile
Re: Good Features for Sprite Library?
« Reply #2 on: April 06, 2012 »
That would certainly be reasonable to include.  I write in Blitz and it already has those things.  The sprite collision is noted for being slow, though.  Perhaps I could put in some sort of minimal bounding box code to cull the collisions, if it's not already in there...

Any other thoughts?  I am primarily looking for animation features.

Was thinking of having an editor where you could bind various entities to xy coordinates on the sprite, entities like sub-sprites (googly eyes, turrets) and particle emitters, which would all then translate and rotate along with the sprite.  Perha.ps that is best done at an object level...
« Last Edit: April 06, 2012 by spathi »

Offline Raizor

  • Founder Member
  • Pentium
  • ********
  • Posts: 1154
  • Karma: 175
    • View Profile
Re: Good Features for Sprite Library?
« Reply #3 on: April 06, 2012 »
Not sure if blitz comes with any 2d physics stuff, but it might be worth checking out Box2d and Chipmunk physics. I played with these quite a lot while making a game for iPhone a little while ago. They certainly help bring sprite based games to life.

You can probably get some ideas from Cocos2D or something similar. The iPhone incarnation in particular is quite mature now and will no doubt give you some ideas for functionality related to sprites.

I'd certainly add functionality for flipping the sprites (x/y) and scaling them as those features will very handy. Some kind of animation (using spritesheets or whatver) would also be cool.
raizor

Challenge Trophies Won:

Offline Stonemonkey

  • Pentium
  • *****
  • Posts: 1315
  • Karma: 96
    • View Profile
Re: Good Features for Sprite Library?
« Reply #4 on: April 07, 2012 »
Some sort of parallax system combined with scaling where you can have layers at different depths that move/scroll at different speeds depending on the depth.

Not sure if it's what you're looking for or if it'd be possible with blitz sprites but I always thought normal mapped sprites could look pretty good. Maybe some other types of lighting effects though.

Fryer.

Offline spathi

  • C= 64
  • **
  • Posts: 78
  • Karma: 5
    • View Profile
Re: Good Features for Sprite Library?
« Reply #5 on: April 07, 2012 »
Blitz doesn't quite have the per-pixel processing power for normal-mapped sprites, at least not in its 2D library.  It will do OpenGL though and that could look really nice. 

I was thinking of actually writing some sort of normal-mapping system that would use alphablending of lights from 4 angles (lit from north, south, east or west, then blending from those 4 directions depending on where the light was) but if I am going to go the 3D modeling route I will just do OpenGL.

I've also been thinking of making a procedural ship generator that "evolves" shooter enemies out of numerous component sprites.

Offline hellfire

  • Sponsor
  • Pentium
  • *******
  • Posts: 1294
  • Karma: 466
    • View Profile
    • my stuff
Re: Good Features for Sprite Library?
« Reply #6 on: April 07, 2012 »
All the features of a game library are useless if they're not used in a game.
In other words read Write games not engines.
« Last Edit: April 07, 2012 by hellfire »
Challenge Trophies Won:

Offline Kirl

  • Senior Member
  • Pentium
  • ********
  • Posts: 1217
  • Karma: 230
    • View Profile
    • Homepage
Re: Good Features for Sprite Library?
« Reply #7 on: April 07, 2012 »
I've also been thinking of making a procedural ship generator that "evolves" shooter enemies out of numerous component sprites.
I like the modular vehicle idea! :)
www.kirl.nl
Challenge Trophies Won:

Offline spathi

  • C= 64
  • **
  • Posts: 78
  • Karma: 5
    • View Profile
Re: Good Features for Sprite Library?
« Reply #8 on: April 07, 2012 »
That's true, Hellfire, and what I am making is at least partly a harvested framework, but when you're polishing up each part of it, it does make sense to add a few more things.  I know what I need in my games and instead of just writing those things I am making an effort to generalize them so that they are usable in a wider context.