File
158380266711.jpg
- (111.79KB
, 640x480
, aa719ac50c0b1dbb27ba1ede985aae253bee1325-700.jpg
)
I'm building a little demo in Win32 using GDI and C. I need multiple instances of sprites with different speeds.
Code is below. The question is, how do I pass an instance to the UpdateSpritePosition function? Pic unrelated.
Currently, I am calling the function like this- UpdateSpritePosition( &rcClient); from WM_PAINT
I need something like- sprite_sp1.UpdateSpritePosition();
// The struct containing sprite information
struct SpriteAnimation
{
int frames;
int direction;
float counter2;
float counter;
float sprite_speed;
float sdrift_speed;
float animation_speed;
float x;
float y;
}SpriteAnimation;
// The function which updates the sprites position/movement
void UpdateSpritePosition( RECT* prc){}
// The sprite instances defined in WM_CREATE
struct SpriteAnimation sprite_sp1 = {0, 0, 0, 0, 0.07, 0.04, 0.05, 83, -7};
struct SpriteAnimation sprite_sp2 = {0, 1, 0, 0, 0.04, 0.04, 0.05, 202, -24};
struct SpriteAnimation sprite_sp3 = {0, 0, 0, 0, 0.02, 0.04, 0.05, 333, -36};