Yesterday when I published the update about struggling working with Pixel Effects I sort of fantasized about being able to write an update today to portray my success over the Pixel Effect demon in my code. Victory tastes sweet.
I narrowed the problem down to a logic issue within my game loop. Essentially, the game was removing the Tribute upon death (which is to be expected and desired), which removes the blood effect too because it’s a member variable of the Tribute class.
I solved it by creating an if statement to check for whether or not the Tribute’s blood effect has finished playing before removing the Tribute.
This works a lot better now; however, it did introduce a bug where if the minotaur doesn’t fully run through the tribute, sometimes its ghost will persist… I’ll fix this tomorrow. Of course, there is more code which handles the blood effect within the Tribute class, but as always: the source code is readily available on my GitHub repo.
I’ve been meaning to create some medium as to track the development of my projects, so I figured now is as good a time as any to begin doing so. Welcome to Games by Alpacas, a dev blog by yours truly.
Seeing as I’m beginning to document the development in a semi-late stage, I figure it’d be appropriate to explain what exactly Labyrinth is. Labyrinth is a 2D “tile-based” maze crawler based off of the Greek myth of the Labyrinth. According to the myth, young men and women were sent as tributes into the Labyrinth for the Minotaur to feast on. This is a very basic and rudimentary understanding of the myth; however, the that’s just the background of the game. In Labyrinth, you play as the aforementioned Minotaur, hunting down your prey in the enigmatic corridors of the Labyrinth.
Now let’s get this party started.
Today I’ve implemented a basic AI system as well as — what I presume it to be called, — a flexible TiledMap interface. What I mean by that is that the entirety of level design can be completed with the program called Tiled. Character spawn points as well as level design are all encapsulated in the creation of the TiledMap itself within Tiled. Now there is no need to programmatically create and place the game objects in the game as all of the game object creation is handled by the program reading the layers of the TiledMap. The player’s spawn point is on its own separate object layer not unlike how the tribute spawn points are on the tribute layer.
The spawn points must be indicated by Rectangles and the origin of the rectangle (the bottom left corner), is where the character will be drawn. As such, it’s important not to draw a spawn point where the character will be stuck in a wall tile.
This change is really exciting as it will now expedite the level creation process as well as open up opportunities for the possibility of accepting player-generated content to play.
I also mentioned the implementation of an AI system. It’s very rudimentary; however, the tributes will detect the player approaching and attempt to run away. They’re not very smart. I will have to look into improving this as I intend to implement a mechanic where the tributes will attempt to escape the Labyrinth.
Feel free to view the source code on my GitHub. If you’re reading this at a later date than it was posted, chances are the source code has changed as I’m still currently working on the project.
Thanks for reading, and stay tuned for future updates on this project as well as some LibGDX tutorials.