Vector Construction problem..
Ok so here's my problem:
I'm making a little game project that's like a clone of Breakout, which I'm sure everyone has played before, and I encapsulated the game variables in its own class called "Game" that looks something like this...
Code:
//game.h
//Game class header file
#ifndef GAME_H
#define GAME_H
#include <vector>
#include "player.h"
#include "brick.h"
#include "ball.h"
using namespace std;
class Game
{
public:
Game(int player_x, int player_y, unsigned int player_w, unsigned int player_h, int player_lives,
int ball_x, int ball_y, unsigned int ball_w, unsigned int ball_h, double ball_XSpeed, double ball_YSpeed,
int brick_x, int brick_y, unsigned int brick_w, unsigned int brick_h, int brick_hp,
int level_width, int level_height);
void Reset();
void Play();
Player player1;
Ball ball;
vector<vector<Brick> > bricks;
};
#endif
Not the most efficient code on the planet, I KNOW. . -.-
But! I'm having trouble creating the constructor of this Game class. As you can see, the "bricks" variable is a 2-dimensional vector. What I'm having trouble doing is creating a constructor that assigns two of the parameters "int level_width, int level_height" as the width and height dimensions of the vector.
I hope I explained that fully. O_o
Thanks for the help, and sorry in advance about all my constructor parameters - I want to keep it that way for certain reasons though. >.<