C++ Game Engine Development – Part 39 – Removing Projectile on Collision

Last week we wrote the code that will enable communication between objects when they collide. This communication can happen at three stages of a collision: when the collision occurs, every frame the collision is maintained, and when the collision ends. This week we are going to write a new component for our projectile that will remove it from the game when it collides with another object (so when collision first happens). It will be a simple component but will hopefully show you how to respond to collision events.

C++ Game Engine Development – Part 38 – Collision Communication

This week we are continuing where we left off by editing the collision system to call the OnCollisionEnter, OnCollisionStay, and OnCollisionExit functions that we wrote last week. This will lay the groundwork for many future features that require interaction between colliding objects.

C++ Game Engine Development – Part 37 – Collidable Component

This week we will start work on a collision communication system. Currently, when two objects collide the only action they can take is to prevent the collision by moving apart, however what if we want more complicated behaviour? Such as causing damage to an enemy when the projectile collides with them or making the arrows disappear when they collide with a tile.

C++ Game Engine Development – Part 34 – Direction Component

This is part of an ongoing series where we write a complete 2D game engine in C++ and SFML. A new tutorial is released every Monday. You can find the complete list of tutorials here and download the source code from the projects GitHub page.A couple of weeks ago we started work on spawning projectile and ended up […]

C++ Game Engine Development – Part 33 – Shared Context

This is part of an ongoing series where we write a complete 2D game engine in C++ and SFML. A new tutorial is released every Monday. You can find the complete list of tutorials here and download the source code from the projects GitHub page.At the moment the classes we want to include in the context are: Input: […]

C++ Game Engine Development – Part 29 – Velocity Component

This is part of an ongoing series where we write a complete 2D game engine in C++ and SFML. A new tutorial is released every Monday. You can find the complete list of tutorials here and download the source code from the projects GitHub page.Last week we begun work on our projectile system and quickly ran into an […]

C++ Game Engine Development – Part 28 – Projectile Animation

This is part of an ongoing series where we write a complete 2D game engine in C++ and SFML. A new tutorial is released every Monday. You can find the complete list of tutorials here and download the source code from the projects GitHub page.This week we will add a new projectile attack animation to our player. We […]

C++ Game Engine Development – Part 22 – Camera Follow

This is part of an ongoing series where we write a complete 2D game engine in C++ and SFML. A new tutorial is released every Monday. You can find the complete list of tutorials here and download the source code from the projects GitHub page. In this weeks tutorial, we start work on a camera component for our […]

C++ Game Engine Development – Part 15 – Collider Component

This is part of an ongoing series where we write a complete 2D game engine in C++ and SFML. A new tutorial is released every Monday. You can find the complete list of tutorials here and download the source code from the projects GitHub page.This week we’ll be starting our object collision system. As this is a big […]