The Character - Multiplayer Indie Game - Gether

The Character - Multiplayer Indie Game - Gether

Procedure

When realizing a game project, I have developed my own approach over time. After the rough planning, how I imagine the final result, I start to realize most of the graphics. Especially as a 1-man team, if you want to do everything yourself for financial reasons, this is not a wrong thing. So you know if you can overcome the most difficult hurdle and you are all the more motivated when you have overcome it. At least that's the case with me.

Fast results!

This is enormously important and a big advantage if you have directly realized some good graphics for the game. Motivating results. Especially if you've worked on bigger projects before, you know that motivation will become a boss in the long run.

Motivation killers should be avoided for this reason. For example, if you spend 2 weeks on a project and as a visible visual result you only have a perfect menu, although you have already developed half the game logic, this is certainly anything but motivating.

What's the bottom line that most important?

The most important thing in the game we're making here is probably the character. And we take care of it first and use it as our starting point. It's best to ask yourself some good questions. What does the character have to be able to do? How does he move? Where can he interact with the game world?

Once you have answered these questions in your head, you can get started and realize the whole thing.

The character

I ended up choosing a simple character design. Nothing special. But decorated with a small animation, which should give the player the feeling that the character is at least a bit alive.

Sufficient for our purposes: One game character.

At this point I have to mention again that I am not a pixelartist. The focus of this game project is on its basis and content. Main focus is the cooperative multiplayer part, but it should be completely hidden for now. The content of the game will be realized offline first and only at the end cooperatively Online.

C++ and SFML

The game is completely realized with C++ and SFML. The character class currently looks like this:

Vielleicht auch interessant
2D Skeleton
2D Skeleton

Die Grundlagen für 2D Skeleton Animationen.

class Character : public AniObject
{
	public:

		Character();
		
		void setHp(float hp);
		void setExp(float exp);

		float getHp();
		float getExp();

		void move(float dx, float dy);
		void move(float ft);
		bool isSolid();

		void drawGUI(sf::RenderWindow &app);

	private:

		float m_speed;
		float m_hp;
		float m_exp;
		int m_level;

		sf::RectangleShape m_hpRect, m_expRect;
};

I will only deal with the most important aspects here and later. AniObject describes a game object that can be animated. The class itself contains very trivial animation logic. AniObject also inherits from sf::Sprite.

A class like this can be realized independently with the help of my article "SFML 2.5 - Animate Character". Following this article series I will publish the complete source code of this project.

The move methods may still be interesting at this point. The first method overwrites the inherited SFML Sprite move method. The second method intercepts keystrokes and works with the frametime to achieve the same movements on every device. (SFML 2.5 - Move character)

void Character::move(float dx, float dy)
{
	sf::Sprite::move(dx, dy);
	this->play(1);
}

void Character::move(float ft)
{
	if(sf::Keyboard::isKeyPressed(sf::Keyboard::A))
	{
		this->setRotation(0);
		this->move(-m_speed * ft, 0);
	}
	else if(sf::Keyboard::isKeyPressed(sf::Keyboard::D))
	{
		this->setRotation(180);
		this->move(m_speed * ft, 0);
	}
	else if(sf::Keyboard::isKeyPressed(sf::Keyboard::W))
	{
		this->setRotation(90);
		this->move(0, -m_speed * ft);
	}
	else if(sf::Keyboard::isKeyPressed(sf::Keyboard::S))
	{
		this->setRotation(-90);
		this->move(0, m_speed * ft);
	}
}
Next article
Tiled Map - Multiplayer Indie Game - Gether
Leave a like or comment (~‾▿‾)~
Name Text
Kommentare
LeoNins> 1 JViagra Mehrmals Taglich https://abcialisnews.com/# - Cialis Il Cialis Aumenta La Pressione <a href=https://abcialisnews.com/#>cialis 5 mg</a> Viagra Pas De La Case