Posts

Showing posts from March, 2017

Necromantion : A roguelike

Necromantion This is a roguelike game that I have been developing on and off for a year now, starting from March '16. It is a much larger project than those that I have written previously and I believe that it is moderately well written. Documentation is available on only a few classes, though. Over the next few blogs, I would be discussing some of the problems I faced and the solutions to them that I developed. Here is a link to the  code , but I would not give the images, as they are not mine.

Tetris part 2

The GameEngine Class So, this is mainly going to be about the GameEngine class. The main job of the GameEngine is to update and render the game environment. Now, at any moment , there is only one falling Group . So that is signified by currentGroup . Apart from that, the Block s that have already fallen, are just kept in a 2D array. For purposes of collision detection, this array has a padding. The padding is also required as we do not want a block to instantly appear .. We want to to appear slowly, that is first, the lowermost layer, then the middle and finally the upper layer. ( Group s have 3 rows each). The update function, at each call, moves the current Group  down, creates one if not present, and then checks whether any lines have formed. Since this is a small scale game, concurrency of threads has not been considered. When the player presses a key, the methods of the GameEngine  are called from the Event thread itself. The Player can rotate or shift the Gr

JCERB v7.2

The New JCERB This will probably be my last chess engine JCERB version. I have removed a couple of bugs, although speed has been reduced a bit. Please try it out and any feedback will be helpful. JCERB v7.2

The Tetris : A Simple Version

Motivation Tetris is one of the iconic games that everybody has played at some point or the other. For some it has even become an addiction, with all the different versions of the game.  Even though being so popular and played-by-all, it is one of the simplest games out there, if we consider the basic mechanics. Of course UI is something that is really hard to get right for a beginner, so I will not be discussing it right now.  So, why build a tetris? I did it because I was feeling bored and had nothing to do for 5-6 hrs. It took me literally that much time to build it, and I am sure that experienced programmers will take even less time. If I would have built it now, it would have taken even lesser time, for I made that in 2015, a long time ago. Structure So the first thing that we have to notice is that tetris is basically a grid based game. You could make the blocks fall in a continuous manner or smooth manner, but when it finally falls, it is in fixed places of the