I've tried reading books and various sources for making a game but I tend to get lost as I get more into it.
I was wondering if I could have something simple and the game still work? I don't have any code but I've been trying to think of a simplified way to think about the code, simple enough that it'll run.
class game
{
main()
{
createWindow();
gameLoop()
{
Update();
Render();
}
closeWindow();
return 0;
}
Update()
{
CreateObjectEntities();
Input();
UpdateObjectEntities();
}
Render()
{
//I have no idea what kind of methods go in here
}
CreateObjectEntities()
{
//Creates objects and add them to an array? I don't really know how to handle this
}
Input()
{
//Looks for input and updates player
}
UpdateObjectEntities()
{
//AI method that updates all the NPC characters
//Method that checks if anyone was hit, killed, falling, etc.
//Any other methods to update anything?
}
};
If I went about making a simple game with psuedo-code as like a guideline would this be fine? Am I forgetting anything, I know I probably am? Would something need to be put in a different order? How should I go about handling rendering things? Should I put all the object/entities made that will be displayed into an array and then in the render method read from that array and render through the information given in that?
Thanks for any help.