• Advertisement
Sign in to follow this  

Weapon actions

This topic is 4793 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

ok im working on a 2d RPG as some of you know and im trying to figure out how i would do attacks with diffrent weapons if the what the weapon looked like could change. It would be nice if i could just set a template way to rotate and move the weapon regardless of the way it looks but i cant figure out a way to do this. Maybe if i were doing OpenGL but i dont think there is a function in SDL that dose that so i was hoping someone here could help me think of a way. Thanks [grin]

Share this post


Link to post
Share on other sites
Advertisement
what kind of view is the game? maybe you could come up with some sort of "overlay" system where you first draw a bare character, then draw over him any "pieces" to him , such as the weapon hes holding, or armor he is wearing. it would be tricky to set everything up right (sorting, setting the offsets correctly), but in the end would let the player fully customize his character (if you had the art, that is [smile]).

Share this post


Link to post
Share on other sites
i was planning on doing that but the question now is how i can kind of ATTACH the weapons and armmor onto the player so that they move in sync with him but so that i dont have to have the same animation with ever image and every type of armmor/weapon

Share this post


Link to post
Share on other sites
Associate weapons and armor with the player struct.

Give the weapons and armor information about where they are drawn relative to the player.

When it comes time to draw the player, have the player draw itself, then tell the weapons and armor where it is, so that they can draw themselves at the appropriate world coordinates.

Share this post


Link to post
Share on other sites
that works great if the weapon is static and is probibly the method i will have to use if this thread dosnt turn up much but what if i want to rotate it? I would have to have animation of all the diffrent rotations unless i used hardware sprite rotation and i really dont want to require any kind of graphics hardwear for a 2d RPG

Share this post


Link to post
Share on other sites
thanks ill use that one thing though

it gives me a

[Linker error] undefined reference to `_imp__rotozoomSurface'

NOTE: it adds the _imp_ by itself thats not how im calling it
but i am including the file and everything but it still gives me that why?

thanks again

Share this post


Link to post
Share on other sites
when you get it working, what you could do is take a "weapon" graphic and automatically rotate it to several different angles for a kind of "animation". Then save each frame as a seperate SDL surface (i assume you are using SDL). That way, you don't have to create multiple static frames of animation by hand.

Share this post


Link to post
Share on other sites

when you get it working, what you could do is take a "weapon" graphic and automatically rotate it to several different angles for a kind of "animation". Then save each frame as a seperate SDL surface (i assume you are using SDL). That way, you don't have to create multiple static frames of animation by hand.
[/Quote]

ill do it that way or ill rotate it on the fly thanks for the idea


did you include the libs
[/Quote]

the thing i download didnt come with libs were can i find em?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement