Zombeesh back in 2D

After lately chat with my tutor I have to move back to 2D based game. – time pressure and general overloading forced me to make this decision.
GDD must be finished by tomorrow – but shall not fear! I have some resources. I will borrow units tile set from star craft – come on zombies looks almost like infected marine

as well as terrain tiles – provided by Maniak – thanks man!

I am improving level manager so I will be able to deal with offsets and a stuff.. as far as now I have prototype and hopefully it will be ready in next couple hours.

// LevelManager.h

#pragma once


#include "Level.h"

class LevelManager
  //list of maps
  static std::map levels;
  static int currentLevelId;	
  static LevelManager* instance;
  static void init();
  static void loadLevel(Level* level); // load level
  static void unloadLevel(Level* level); 
  static void registerLevel(Level* level); //add level to levels pool
  static Level* getLevel(int id) ;
  static D3DXVECTOR3 getOffset(); //gets offset off current map;

// LevelManager.cpp
#include "LevelManager.h"

int LevelManager::currentLevelId=-1; //no level
LevelManager* LevelManager::instance =0;
std::map LevelManager::levels = std::map();


void LevelManager::init(){
  LevelManager::instance = new LevelManager();

    std::map::iterator iter = levels.begin();
    for(; iter != levels.end(); ++iter){
      delete iter->second;
      iter->second = 0;

void LevelManager::loadLevel(Level* level){
  LevelManager::currentLevelId = levels.size();

void LevelManager::unloadLevel(Level* level){
  std::map::iterator iter = levels.find(level->getId());
  if(iter != levels.end())

void LevelManager::registerLevel(Level* level){
  //get size of current levels list and increment by one
  int size = levels.size() + 1;
  levels[size]= level;

//ok do I need to register all entitys into level? - I guess I do. need to double check that with Kevin
Level* LevelManager::getLevel(int id){
  std::map::iterator iter = levels.find(id);
  if(iter != levels.end()){
    return iter->second;
  return 0;

D3DXVECTOR3 LevelManager::getOffset(){
  std::map::iterator iter = levels.find(currentLevelId);
  if(iter != levels.end())
    return iter->second->getOffset();
  return D3DXVECTOR3(0,0,0);

Published by

Luke Iwanski

Senior Graphics Programmer @ CD Projekt RED

Leave a Reply

Your email address will not be published. Required fields are marked *