Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

This morning I worked on creating the Player classes for the game. This will allow me to create AI players for each of the three factions (Aliens, Fighters, Traders) that handle the high level actions that are similar to those that a human may take when playing the game. These are asymmetrical factions, so it will be a little bit difficult to transition to a game where the player can play as any of the three factions, but I am not going to worry about that right now. For now, the player is hard coded as the Aliens faction.

I wanted to work on the AIs after that, both for the Players and also for the individual units of the game. I got sidetracked however implementing a parallax background for the stars.

I implemented this using three layers of textures, each of them represented by a matrix of my custom ParallaxSprite class. That class has members for the Texture, x position, y position, width, and height. At first I went down the wrong path, trying to use the camera movement to move the texture positions. It turned out that there was a much easier way to do it, which I found here in the libGDX tests https://github.com/libgdx/libgdx/blob/master/tests...

This way, I did not have to couple things together as much. Unfortunately, I still had to add the ParallaxCamera as a member of the CameraPanner class. I wanted to have two CameraPanner classes working together, but when I added a second CameraPanner to the input handler, it prevented the previous one from working. So instead I add the ParallaxCamera to the CameraPanner class and pan both cameras at the same time.