Ejemplo n.º 1
0
	bool addBullet(int bulletType, float accelMag, float initialVelMag, vec3 direction, 
		           vec3 startPosition, float damage, int numberOfAcclUpdates) {
		if(wSoftEntities.size() == SOFT_ENTITIES_COUNT) return false;
		switch(bulletType) {
		case ID_BULLET_STRAIGHT:
			wSoftEntities.push_back(new StraightBulletEntity(accelMag, initialVelMag, direction,
				                                        startPosition, damage, numberOfAcclUpdates));
			std::cerr<<"Soft entities alive: "<<wSoftEntities.size()<<'\n';
			break;
		case ID_BULLET_GRENADE:
			wSoftEntities.push_back(new GrenadeEntity(startPosition,direction));
			break;
		default:
			throw new CException("Unknown bullet type given to addBullet()");
			break;
		}
		return true;
	}
Ejemplo n.º 2
0
	GameEntityList::iterator deleteSoftEntity(GameEntityList::iterator b) {
		delete *b;
		std::cerr<<"Soft entities alive: "<<wSoftEntities.size() - 1<<'\n';
		return wSoftEntities.erase(b);
	}
Ejemplo n.º 3
0
	bool addSoftEntity(GameEntity* g) {
		if(wSoftEntities.size() == SOFT_ENTITIES_COUNT) return false;
		wSoftEntities.push_back(g);
		return true;
	}
Ejemplo n.º 4
0
	bool addEntity(GameEntity* g){
		//Adds the passed GameEntity to the scene
		if(wEntities.size() == GAMEENTITY_COUNT) return false;
		wEntities.push_back(g);
		return true;
	}
Ejemplo n.º 5
0
	bool addWall(Wall* w){
		//Adds a wall to the scene
		if(wWalls.size() == WALL_COUNT) return false;
		wWalls.push_back(w);
		return true;
	}