Advertisement

tank framework

Started by May 18, 2023 10:46 PM
1 comment, last by LorenzoGatti 1 year, 6 months ago

I am working on a tank game still. I have worked on my classes but I need some more input on how to flesh out my framework.

#include <iostream>
#include <vector>

using namespace std;

class Tank
{
public:
	void move_tank_up();
	void move_tank_down();
private:
	int t_x;
	int t_y;
};

void Tank::move_tank_up()
{

}

void Tank::move_tank_down()
{

}

class Mountain
{
public:
	void draw_mountain();
private:
	int m_x;
	int m_y;
};

void Mountain::draw_mountain()
{

}

int main()
{
	return 0;
}

If you want to get something done you should start from a game engine and face all the technical choices and hurdles that are necessary to be able to write something meaningful in that draw_mountain() function, to call move_tank_up() when you should, and so on. For example:

  • Compile an executable that includes all libraries, content etc.
  • Display a window
  • Accept input (starting from a way to close the window)
  • Draw anything
  • Make a proper game loop with input collection, state updates, rendering
  • Draw assets that you loaded

More or less at this point, give or take many unforeseen complication, you should be able to start seeing what the tanks and mountains in your game will be like, instead of wasting time with meaningless and incorrect empty abstractions, and more importantly to test what you are writing.

Omae Wa Mou Shindeiru

This topic is closed to new replies.

Advertisement