Sign in to follow this  
wface12

Changing sprites' costume (2d)

Recommended Posts

Hey, I'm new here and not a programming expert; I was wondering if I could get some help. Let's say I have a main character sprite, and he's in his starting costume-armour thing. I'd like to have the game where if I equip a different armour, the sprite's clothes change. Would I have to save the sprite's head to a some sort of picture file, and paste the new outfit under it? You have no idea how much help is appreciated.

Share this post


Link to post
Share on other sites
You're working in 2d? Yeah, something like that should work.

You might want to think about for each set of sprites (each costume), the sprites will need to be the same size, right? So, you don't have to explcitly draw the head at one position and then the costume at another position, you can draw them at the same position, but the position of the costime in the actual bitmap places it under the head of the character.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Imho the best ways are either:

a)draw multiple sprites, one set for each outfit

b)use multiple sprites at the same time: draw a basic non-dressed figure, and put each piece of clothing into its own sprite set and draw each of them over the figure sprite.

The first solution is simple to program, but requires way too many sprites.
The second solution means that each character is drawn with multiple sprites layered on top of each other, but it's more flexible. For a simple example, check out the so called 'paperdoll' technology.

Viktor

Share this post


Link to post
Share on other sites
Thanks alot for the input, just one more question.

As I already mentioned, I'm no expert. How would I do this inside of the program? I'm using Allegro as my library right now, and it would probably help to know that I'm doing the program in C++.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this