Arno De Keukelaere

Game Developer

arnodekeukelaere@gmail.com

Grot Verhaal

 

Description:

A Cave Story tribute C++ game.
The entire game was build from the ground up using a Box2D based game engine provided by the school and free graphic assets from Kenney.nl.
The challenge for this project was to keep the code readable, simple in design and

maintainable. The use of various intermediate and advanced C++ topics like inheritance and polymorphism was also a basic requirement.

Applications used:

Visual Studio 2013, Adobe Photoshop, Tiled and Bfxr.

Download mirrors

Screenshots

Code snippet(s)

Bitbucket repository

/*
Enemy Slowpoke(C++):
Each enemy type in the game inherits from a base class called "Actor".
*/

// Reset the camera on button press, this resets the camera to it's initial rotation and zoom state.

void EnemySlowpoke::BeginContact(PhysicsActor *actThisPtr, PhysicsActor *actOtherPtr)

{

 int damage = 3;

 

 // ENEMYHOPPER::ISONFLOOR

 Actor::BeginContact(actThisPtr, actOtherPtr);

 

 // DAMAGE PLAYER

 if (actThisPtr == m_ActPtr &&

  actOtherPtr == m_ActPlayerPtr->GetActor())

 {

  m_ActPlayerPtr->Health(-damage);

  m_ActPlayerPtr->Experience(-damage);

 }

 

 // FLIP ON WALL/LEVEL HIT

 if (m_ActWallPtr->IsOverlapping(m_LevelPtr) && !m_HitWall)

 {

  FlipDirection();

  m_WaitTime = WAIT_TIME;

  m_HitWall = true;

 }

 if (actThisPtr == m_ActPtr && actOtherPtr->GetCollisionFilter()

  .categoryBits == CaveStory::FilterCategory::ENEMY)

 {

  FlipDirection();

 }

 

 // DAMAGE SELF IF HIT BY BULLET

 if (actOtherPtr->GetCollisionFilter().categoryBits ==

  CaveStory::FilterCategory::BULLET)

 {

  Health(m_ActPlayerPtr->GetWeaponDamage());

 }

}

Copyright @ Arno De Keukelaere 2019. All rights reserved.