How to visualize sprite-like animations

I’m working on a funny game like duck hunt. You can use a regular cheap red laser to shoot down some game-actors. I’m wondering, what method should I use to create movig actors/characters in my game? (for example I want to have similar motion as the puppets in this installation: http://www.flickr.com/photos/prizepony/3088200572/, and a video http://vimeo.com/3209054

Thanks a lot!

well I would actually not go for something similar as in that project because there is alot of physics included that should actually be an overkill for your needs. I would rather write a simple class that renders the animations frame by frame (you would export every frame of the animation as an extra image and then load them into your application).

Hi,

I created my sprite class which draws a couple of .png images. Now, I’m searching for a method/algorithm to move my sprite of a bird just like the ducks in duck hunt. What method can I use for that?

http://www.youtube.com/watch?v=-1NyIsZXeqU&feature=related

My sprite class:

  
  
#include "CSprite.h"  
  
CSprite::CSprite() {  
	m_last_time = ofGetElapsedTimeMillis();  
	setDuration(10);  
}  
  
void CSprite::addImage(string sImage) {  
	ofImage* img = new ofImage();  
	img->setUseTexture(false);  
	img->loadImage(sImage);  
	m_images.push_back(img);  
}  
  
void CSprite::draw(float fX, float fY) {  
  
	if (ofGetElapsedTimeMillis() < m_last_time + m_duration)  {  
		m_drawer.clone(*(m_images[m_index]));  
		ofEnableAlphaBlending();  
		m_drawer.draw(fX, fY);  
		ofDisableAlphaBlending();  
		return;  
	}  
  
	m_drawer.clone(*(m_images[m_index]));  
	ofEnableAlphaBlending();  
	m_drawer.draw(fX, fY);  
	ofDisableAlphaBlending();  
  
	m_index++;  
	if (m_index > m_images.size()-1) {  
		m_index = 0;  
	}  
	m_last_time = ofGetElapsedTimeMillis();  
}  
  
void CSprite::setDuration(int iDuration) {  
	m_duration = iDuration;  
}  
  

And the header

  
  
#ifndef CSPRITE  
#define CSPRITE  
  
#include "ofAddons.h"  
#include "ofMain.h"  
#include <vector.h>  
  
class CSprite {  
	private:  
		vector<ofImage*> m_images;  
		int m_index;  
		int m_last_time;  
		int m_duration;  
		ofImage m_drawer;  
	public:  
		void addImage(string sImage);  
		CSprite();  
		void setDuration(int iDuration);  
		void draw(float fX, float fY);  
};  
#endif