Overlay 2d weapon sprite over character sprite ?

Posted by Mr.Gando on Stack Overflow See other posts from Stack Overflow or by Mr.Gando
Published on 2009-11-22T02:22:11Z Indexed on 2010/05/09 22:58 UTC
Read the original article Hit count: 358

Hello, I'm working on a game where my character needs to be able to have different weapons. For that I think that somehow overlaying the weapon over the moving sprite would be the correct choice, but I'm not sure about how could I do this.

Assuming my Character spritesheet looks like this:

Player SpriteSheet

And my preliminar weapon spritesheet ( haven't decided on a fixed square size for the weapon yet ), looks like this:

Weapon SpriteSheet

How would you make the overlay to set the weapon correctly over the character hand for each of his frames? I know that one way would be just to have a weapon frame the same size as my character sprites, and overlay those too, but I think that if the game has way too much weapons (say 15 different kinds of one hand weaps) this could get pretty insane ( having one weapon sprite sheet the same size as the character sprite sheet for each type of weapon )

Do you guys have any advice on how to implement this? (supporting overlaying the weapon sprites over the character sprites)

Thanks!

© Stack Overflow or respective owner

Related posts about game-development

Related posts about game-design