Posts Tagged ‘Game Programming’
These posts are related to game programming.
Android Manifest File for a Game
Posted by Dimitri | Filed under Programming
Android was designed to see every application as a collection of Activities united by intents. It also relies on the Activity stack to determine what Activity will be launched after the user finishes it by pressing the ‘back’ button. While the stack system is helpful for users and for some applications, this default behavior isn’t a necessarily a good thing for games.
That is mainly because of two things: a game use a lot of hardware resources from the device that runs it, meaning that having other activities in the same stack as the game Activity can have an impact on its performance. And the stack default behavior could lead to multiple instances of the same game running in the same stack.
Extra life after a certain amount of points
Posted by Dimitri | Filed under Featured, Programming
Finally, a post directly related to game programming! I will explain how to write a piece of code responsible for giving an extra life to the player’s character after a certain amount of points. TheĀ following code was written in Java, because it’s it would be shorter and easier to explain. Since this a generic algorithm, let’s assume that the game logic runs inside a method called Update() that is a member of the GameLogic class, responsible for our hypothetical game logic. Additionally, we need to have in mind that this method is being constantly called inside the game loop.
So here’s the code: (more…)