2D Game Change Weapons

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
[BROKEN]
Posts: 12
Joined: Thu Mar 03, 2005 11:56 am

2D Game Change Weapons

Post by [BROKEN] »

We're building a 2D RPG here, can anyone think of a better way of having the graphic change weapons rather than having to make a sprite for every combination of weapon availiable? In 3d the weapon would be a seperate model, and would be attached to the player, but how would I do that in 2D?

Thanks :twisted:
sudi
Posts: 1686
Joined: Fri Aug 26, 2005 8:38 pm

Post by sudi »

Just the same way.
use the (alpha)force...lol
i made a examepl pic but figured out that i can't attach an image to the post without uploading it somewhere else.....to bad
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
[BROKEN]
Posts: 12
Joined: Thu Mar 03, 2005 11:56 am

Post by [BROKEN] »

What you mean have the sprite of your character, and a seperate sprite of his weapon, and move it with him? Hey can u email that pic to me please at

rippingandfailing@gmail.com

Thanks :twisted:
Ced666
Posts: 86
Joined: Fri Jan 13, 2006 10:29 am
Location: Belgium

Post by Ced666 »

He meant that you'll need two sprites: one that contains your character without the weapon, and one containing only the weapon. Then you need to blit them separately on the screen (of course, you use a colorkey in order to avoid blitting everything that cannot be blitted).
sudi
Posts: 1686
Joined: Fri Aug 26, 2005 8:38 pm

Post by sudi »

Thats what i meant...and the pic isn't that great that it should be send by email....it's just a stick man
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
[BROKEN]
Posts: 12
Joined: Thu Mar 03, 2005 11:56 am

Post by [BROKEN] »

Thats all well and good, but then wont I need the weapon animations to match the player animation perfectly? I don't know if it would work that well, but thanks for the input...

Oh also, has anyone made a better keyboard input class yet? Because just to add a chat feature to my game i have to collect input ftom every key seperately include capitals and all the $%^& and so on which is very long winded! Is there a better way of doing this? thanks :twisted:
Post Reply