ashish2199 / Aidos

A beginner friendly project with aim of creating our own version of Bomberman.
GNU General Public License v3.0
41 stars 27 forks source link

Added Entity Vector to GameVariables #32

Closed ItsStolas closed 6 years ago

ItsStolas commented 6 years ago

All Entities are now to be added to GameVariables

The GameLoop then goes down the list of current entities and calls their draw() functions.

         for(Entity e : GameVariables.getEntities())
                    e.draw();

Initalize objects in the scene, like so:

        //Initialize Objects
        Player p = new Player();
        Player p2 = new Player();
        p2.positionX = 300;
        p2.positionY = 100;

        GameVariables.addEntityToGame(p);
        GameVariables.addEntityToGame(p2);
ashish2199 commented 6 years ago

I feel level classes like sandbox should have list of entities as entities belong to a scene.

Gamevariables class is for having variables related to game. Like which level the player is on, Score , things and other such similar things.

ItsStolas commented 6 years ago

Sure that seems logical to me too

ItsStolas commented 6 years ago

Changed them.

ashish2199 commented 6 years ago

Merged along with some changes to resolve conflict. Now Sandbox class will have a reference of player also. I dont see use of more than one player now as we will mostly be working towards a single player game. If in future we plan to make game multiplayer, we will have a array of players instead with the scene.

ItsStolas commented 6 years ago

Sounds good :)