So far this concept of Context-Component structure is going very well. It gives the flexibility, simplicity, and power that I need. Here is an example of creating an entity:
Entity* entitiy = createEntity("BOX",Transform(Vector2(0,0)) );
entity->attachComponent(new BoxSelector(150, 150));
entity->attachComponent(new SquareShape(150));
This will simply create a box in the middle of the screen 300 pixels wide, that when the user clicks on it, an event will be fired.
In order to test my game engine, I figured that it was time to make an actual game. I less than a day, I was able to make a simple Tic Tac Toe clone, called CircleSquare:
You can download the program here
No comments:
Post a Comment