Jump to content

Recommended Posts

normal.PNG.af7e7e3d204cc513c320455597380961.PNG

 

I've been messing around with sprites and animations in SFML. I tried to animate the tux penguin from Linux and came out with this. In fact, I believe I might make this the player. I mean, why not? What do you all think?

 

  • Like 3

Share this post


Link to post
Share on other sites

Here's a challenge. Try to change the sprite based off how much health it has. sprite.setTextureRect(); uses all 4 values in sf::IntRect. The first 2 values corespond to the exact pixel in your sprite sheet, the second 2 values represent the size of the texture. You can dynamically change the first two values to jump between rows and columns to make some pretty cool stuff.

 

Another little thing you could fool around with is sf::Image, which allows you to actually edit whatever texture is loaded using various functions.

 

And if you really wanna get some game development practice, try to make the controls smooth. An extremely key part of making good 2D controls is adding weight to your characters movement. If your character instantly switches direction upon pressing a directional button the controls are going to feel stiff and weirdly unresponsive. Try to see if you can't fool around with floating point and make the movement feel smooth. Make your movement have acceleration. Make your character have to gradually shift from one direction to the next if you move your character from one direction to another direction.

  • Thanks 1

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

×
×
  • Create New...