AnimateSprite

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
J. Baker
Addict
Addict
Posts: 2181
Joined: Sun Apr 27, 2003 8:12 am
Location: USA
Contact:

AnimateSprite

Post by J. Baker »

I could probably figure this out but thought it would be a good request. Preferably compatible with png with alpha channel. Which I don't think would be a problem since current sprites are already. ;)

AnimateSprite(#Sprite, Width, Height, Start X, Start Y, End X, End Y, FPS)
www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef


Even the vine knows it surroundings but the man with eyes does not.
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post by Kaeru Gaman »

it's not that big problem to create it yourself, but it would be quite a problem to integrate it into the language properly.

1. Alpha ot not means Sprite3D or not.
without alpha, you can use any kind of sprite to get it animated.

2. Animation rate
> AnimateSprite(#Sprite, Width, Height, Start X, Start Y, End X, End Y, FPS)
to sync your game is something that is completely up to you.
when you sync your game to frames or tics, you would sync your animation frames to the same base.
when you write your game timebased with independent framerate,
you could either sync your sprites to the timer or still to tics.

to create a bunch of routines that are flexible enough to cope with all situations a game progger may need would create a heavy overload in the routine and need too much efford on side of the creators.

if you need inspiration to write your own routines, I can provide an example a bit older...
http://www.purebasic.fr/german/viewtopic.php?t=2218
oh... and have a nice day.
User avatar
J. Baker
Addict
Addict
Posts: 2181
Joined: Sun Apr 27, 2003 8:12 am
Location: USA
Contact:

Post by J. Baker »

Well, it shouldn't be too hard either way. I'm just trying to think through on how to get an animated sprite done with alpha support. As it looks a lot nicer. And as you know, ClipSprite doesn't work with Sprite3D.
www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef


Even the vine knows it surroundings but the man with eyes does not.
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post by Kaeru Gaman »

it is not necessary to work with ClipSprite.
to be honest, I dislike this approach nowadays, I would alter the routine for creating the animation if I did it again.
for own projects, I always work with rows of single frames.
changing this to Sprite3D will cost nothing but taking care the source frames are (2^n)²

and there is another point:
implementing an AnimateSprite commando would mean to cope with every kind of Frameset PLUS single stored frames...
just one more point to strengthen my opinion that it would be not of much use if Fred wastes time with implementing such a complicated command.
oh... and have a nice day.
User avatar
Fluid Byte
Addict
Addict
Posts: 2336
Joined: Fri Jul 21, 2006 4:41 am
Location: Berlin, Germany

Post by Fluid Byte »

J. Baker wrote:And as you know, ClipSprite doesn't work with Sprite3D.
http://www.purebasic.fr/english/viewtop ... 78&start=5
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post by Kaeru Gaman »

nice one, Fluid.
yap, there are ways to clip a Sprite3D, but as I said, clipping is not vital for an animation.
one could even import a frameset, cut it into single frames and create single sprites out of them,
then delete the frameset and create Sprite3Ds out of the single framesprites.

what I meant above is...
it is not complicated to write an animation routine that fits into a certain setting of screen and grafix handling.

but it is quite complicated to write a universal animation command that fits well into
each and every setting of screen environment you can create with PureBasic.

then it would be even better to write a complete 2D-Gamelib that contains timing routines and an own tile-engine aswell
a whole set of 2D screen game commands including one straight type of animation.
oh... and have a nice day.
User avatar
J. Baker
Addict
Addict
Posts: 2181
Joined: Sun Apr 27, 2003 8:12 am
Location: USA
Contact:

Post by J. Baker »

Fluid Byte wrote:
J. Baker wrote:And as you know, ClipSprite doesn't work with Sprite3D.
http://www.purebasic.fr/english/viewtop ... 78&start=5
Thanks! ;)
www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef


Even the vine knows it surroundings but the man with eyes does not.
Post Reply