SET ANIM(frame) TO SPRITE?

Previous topic - Next topic

Hark0

Well, I search on forum for this question... and no found none related.


Any way to copy ANY frame of ANIM to an SPRITE???

Or a method like SPRITE2MEM but for one frame of ANIM?


"ANIM2SPRITE" function??? or... "ANIM(frame)2MEM" ???


TIA, Hark0
http://litiopixel.blogspot.com
litiopixel.blogspot.com - Desarrollo videojuegos Indie · Pixel-Art · Retroinformática · Electrónica Development Indie Videogames · Pixel-Art · Retrocomputing · Electronic

Kitty Hello

Yes.
Createscreen 0, targetsprite, widht, height
usescreen 0
Drawanim sourcesprite, animnumber
Usescreen -1

Hark0


I think in similar solution... but, due to my sync video frames/loop, etc... it's make a "blink" of screen... (maybe the time for calculate status of pixels/mem for "explosion"  :P).


I make a "trick" in my code to avoid this.... ;)


ANYWAY, THANKS!!!!!  ;)
http://litiopixel.blogspot.com
litiopixel.blogspot.com - Desarrollo videojuegos Indie · Pixel-Art · Retroinformática · Electrónica Development Indie Videogames · Pixel-Art · Retrocomputing · Electronic

mentalthink

And make a simple solution... More memory needed but using another "battery of sprites" in paralell to draw anim... if it´s only in some cases... can be a very simple solution... the drawanim, and when you need the Sprite number X, uses it?¿...

matchy

I presume you can just put the animsprite in the array and access it that way. What is it that you are trying to achieve?

Hark0

#5
Well, in my project I load a set of sprites using LOADANIM...

If you are viewed the screenshots of my game, I only use TWO colors...

I made a routine for combat (my game are a roguelike/rpg gameplay)... and I think to add some kind of FX for a dead/bonus due the display specifications I used...

When one enemy dead I make a routine for explode it... but, the sprites are loaded into a ANIM...

The initial idea are:

1- "copy" sprite of anim to a NEW sprite.
2- "trap" 0 or 1 active dots for make the matrix of "sprite".
3- calculate transformations for each dot for make the explosion. The initial position of dots are the same of sprite.

BUT, not are valid for me at 100%... some sprites have poor dots, and the FX of explosion not are very "good".

In other hand, when my program starts to read sprite values (ARGB), make the matrix, make calculations for explosion dots, etc... the main loop of the game have "very minimal" blink of screen...


I tried this solution:

When a enemy dead, the game starts a routine ONLY for calculate he position of explosion dots, but NOT BASED on original enemy sprite... I use a random number of dots every explosion... the results are correct for me...

;) Thanks to everybody!
http://litiopixel.blogspot.com
litiopixel.blogspot.com - Desarrollo videojuegos Indie · Pixel-Art · Retroinformática · Electrónica Development Indie Videogames · Pixel-Art · Retrocomputing · Electronic