New Job.

Published September 07, 2008
Advertisement
I start my new job at Transgaming on Monday. I didn't get to finish a game like I set out to do when I left my last job, but I got at least some time to it.

Hopefully, I won't be to busy after hours to work on my new game.

I've been stuck trying to build my own simple sprite engine. For some reason, I am determined to code this in plain C only. This results however in engines that are not very flexible and I end up re-writing. I am also trying to achieve simplicity in design(which is also very difficult).


So far my sprite management looks like this:

/* Handlers initialize a sprite's data on the 1st call, then updates logic */typedef void ( *SPRITEHANDLER )( struct sprite_t *sprite )struct sprite_t{	float px, py,		  dx, dy;	BITMAP *sprite;		void *extra;	SPRITEHANDLER update;	struct sprite_t *next;};/* Creates Sprite Object and add to sprite list */struct sprite_t *spawn_sprite( SPRITEHANDLER sprite_handler, int x, int y ); /* Removes sprite from the list and de-allocates it */void kill_sprite( struct sprite_t *sprite );/* Invokes the sprite handlers to update logic (at a low internal FPS ) */void update_sprites( );/* Moves all sprites one step based on its velocity, invoked once per frame */void move_sprite( );/* Draws all sprites to bitmap object, invoked once per frame */void draw_sprites( BITMAP *video_surface );


The "sprite handler" functions as a sort of class for each sprite. I would have a handler function for each type of sprite.

I'm afraid however that this design may be too restrictive. I haven't considered how I would display multi-sprite objects, or how they would communicate with each other.

I really need to think the design through. I just need more time.
0 likes 2 comments

Comments

a_insomniac
Congrats on starting the new job mate :)

Your first sketch was pretty cool too! Hope to see more of that.

Good luck with the game!
September 09, 2008 07:08 PM
EnemyBoss
Thanks!
September 11, 2008 01:38 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement