The eight week of programming.

This is the week we started with our project for real. We got a sort of late start since both of us fell in sick at the beginning of this week. But now we’re working full time on our game.

I’ve so far added a few different classes such as Bomb, Bomberman, Wall, BrickWall and Fire. Meanwhile Emil has been working on a EntityManager.

There’s nothing special to be said about my code It’s pretty standard. I’m using our Fire class as an example.


#include "stdafx.h"
#include "Fire.h"
#include "Collider.h"
#include "Sprite.h"

Fire::Fire(Sprite* sprite, int x, int y)
{
m_sprite = sprite;
m_x = x;
m_y = y;
}

Fire::~Fire()
{

}

void Fire::Reset()
{

}

bool Fire::IsVisible()
{
return true;
}

EEntityType Fire::GetType()
{
return ENTITY_FIRE;
}

Collider* Fire::GetCollider()
{
return m_collider;
}

void Fire::Activate()
{
m_active = true;
}
bool Fire::IsActive()
{
return m_active;
}

void Fire::SetPosition(int x, int y)
{
m_x = x;
m_y = y;
m_collider->Refresh();
}

void Fire::Update(float deltatime)
{

}

Sprite* Fire::GetSprite()
{
return m_sprite;
}

float Fire::GetX()
{
return m_x;
}

float Fire::GetY()
{
return m_y;
}

About Joakim Ädel

2014  Programming