/* Filename: AnimatedSprite.cpp * * Author: Br. Isidore Minerd * * Date: July 31, 2009 * * Description: This is a very simple program to demonstrate the use of * sprite sheets. For now, our animation is rather trite, * but in the future it will hopefully develop * into rather detailed sprite sheets. * Nevertheless, you will begin to get the feel for * how important visual and audio designers are. Imagine * the complexity of a fully 3D game only from * an art perspective! That by itself should make * your head spin. * * Images used with permission from: * The Game Creators * (http://www.thegamecreators.com) * and * Mr. Mark Simpson (deviantART pseudoname "PrinzEugn") * (http://prinzeugn.deviantart.com/) */ #include "DarkGDK.h" void DarkGDK ( void ) { dbSyncOn(); dbSyncRate(20); // These first several function calls should look familiar dbSetWindowTitle("UFO Invasion Attempt With Short-Range Lasers!"); dbLoadImage("Space.png", 1); dbSprite(1,0,0,1); dbLoadImage("Scout.png",2); dbSprite(2,342,275,2); /* Using dbCreateAnimatedSprite, we can load a spritesheet. The sprite sheet being used consists of a six frames, each of dimensions (52,26). */ dbCreateAnimatedSprite(3, "ShipSpriteSheet.png", 2 , 3, 3); dbCreateAnimatedSprite(4, "ShipSpriteSheet.png", 2 , 3, 3); while(LoopGDK()) { dbPlaySprite(3,1,6,200); dbSprite(3,350,260,3); dbPlaySprite(4,1,6,100); dbSprite(4,350,290,4); dbSync(); } return; }