Sign in to follow this  
Eralp

Side-scrolling shooter

Recommended Posts

Hello, I've been doing a side-scrolling shooter I already made some progress but I am now thinking about how to attach weapons to mobiles/players. I mean currently I have a player sprite, how would I give a gun or rifle to him ? It needs to "hold" it somehow, and if I even make him hold somehow then when I rotate the gun his hands will look -corrupted-.

I hope you'll see my point. I can't talk to my artist because I want to get my game to alpha stage before recruiting. What kind of handling should I implement before going on ?


edit: I also thought about pre-drawing sprites for each rotation(obviously not 359 but 50 should be OK, but again It should be done for every single weapon I guess, and that doesnt sound logical that way

Share this post


Link to post
Share on other sites
It's a side-scrolling shooter... You don't need more than 3 sprites per animation frame. Left and right are just mirrors of each other, so the only others are up and down.
Of course, this is multiplied by each frame of animation, and multiplied again by each different animation (walk, fire, etc).

Still, having a different sprite for each gun*animation*frame is doable.

Share this post


Link to post
Share on other sites
Your gun would have to be it's own sprite drawn overlapping the character. You'll see plenty of shooters that allows a full 180 degree turn of the gun. Some artists choose to have the gun & the arm holding it the same sprite. That way it looks like the character's arms are moving with the weapon.

So basically you have an armless main character. Then drawn on top is the arm and gun. The hardest trick is to make it still look good...obviously you don't want to make the arm look like it can pop out of the characters shoulder sockets. :D

This way, you only need to draw 1 armless main character sprite (and his basic animations). And then draw sprites: Arm with machine gun. Arm with hand gun. Arm with shot gun. Arm with grenade. Etc. etc.

Share this post


Link to post
Share on other sites
Yeah I have been trying shooters now and its tricky to make arms not look like as if they could pop out :)

So okey I'll add one more renderable to my mobile class for the weapon&arms and consider it later when I recruit an artist.

Thanks. But it's welcomed if anyone has further suggestions.

Share this post


Link to post
Share on other sites
Not sure how you setup your character class, but if you intend to have more then just one character consider adding an attachment point. This is basicly just a variable that specifies where on the character to draw the gun :)

Share this post


Link to post
Share on other sites
Quote:
Original post by Eralp
But the point is how to rotate the gun? I don't want just to fire left right and up but in every direction


I have the same question, I hope some people can help us

Share this post


Link to post
Share on other sites
Assuming you want to rotate the gun/arm with the mouse.

Ok you could do this. Have a separate sprite for the character's body and the character's arm (The arm that holds the gun). Then attach the arm sprite to the character sprite so now you can control the arm independently of the character.

The center of the arm_sprite will be at the shoulder joint so that when you rotate it the whole arm moves in a circular fashion. Now you need some trigonometry to go from the mouse's X, Y coordinate to the appropriate angle needed to rotate the arm by.

To make it look smoother you can have the arm_sprite change or animate when a rotation angle is reached. That way the arm looks like it is rotating fluidly and correctly(Like when firing backwards). You probably only need 2-3 sprites to achieve this effect.


See easy as that!

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