• Advertisement

Davindius

Member
  • Content count

    5
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Davindius

  • Rank
    Newbie

Personal Information

  • Interests
    Programming
  1. I suggest using sfml-tmxloader or tmxlite. sfml-tmxloader is meant to be used with SFML and is ready to load maps and render with SFML. It has a few examples in the github repo: https://github.com/fallahn/sfml-tmxloader tmxlite can be used with many libraries (not just SFML) and has an SFML example in the github repo: https://github.com/fallahn/tmxlite
  2. C++ 2d Top-Down Enemy Behaviour

    In my 2D top-down shooter, I took a really simple approach, basically just reversing velocity when a zombie collides with another actor object: void Zombie::CollidesWith(Actor& actor) { const float kKnockBackSpeed = 2.0f; GE::Vector v = actor.GetPosition() - m_position; if (v.x != 0 || v.y != 0) { v = v.Normalized() * -1 * kKnockBackSpeed; SetVelocity(v); } } I'm new to game development and have no idea if this is a good thing to do, but it works pretty well for my game. You could also stop the enemies based on a certain distance from the player sprite, so they won't collide with it.
  • Advertisement