Friday, 7 November 2008

Dave throws a bone !

I'm now spending most of my time developing C# applications so I haven't had much free time to work on my "Dave" game. Shown below is the latest video showing how far the game has developed. I hit a few problems with the collision detection mainly due to the diagonal movement of the "grannies". I decided to just let them move in the more normal left, right and up, down style. I had always thought that in the finished game they would probably not just stay in the current screen but actually walk around the whole map, going into the shops and houses etc. This more linear movement should work better and also allows me to get on with the rest of the game rather than hitting my head on the desk due to diagonal collision problems. The areas that Dave can walk are defined by rectangles and you will see in the video that Dave can walk up to the door. The code just checks that Dave is in (or is moving into) one of the defined rectangles. In the debug mode the rectangles are drawn on the screen which allows me to check that all is as it should be. The last thing that I have added it to allow Dave to throw bones at people (well he is a dog). This works quite nicely but has brought to my attention a small problem that I need to address. At the moment the collision detection is based on the bottom of the bones rectangle in relationship to the other sprites. It should be based on the initial position of Dave's feet (ie, it needs an off set value). It shouldn't be too hard to fix this as long as I can find some time to do it. The next job will be to enable the exits so that I can write the flip screen code. I will probably then look to add the collectable objects and maybe some street furniture and general obstacles. The movement of the sprites in the video isn't very smooth due to my capture program. in "real" life, they move very nicely, even when the screen is windowed rather than full screen.

Wednesday, 1 October 2008

Attack of the grannies !

Having found a few spare minutes, I've been able to work on a couple of key features of my Dave the Dog game. I've started defining the game map as an XML document. This file defines the areas of each screen that Dave and the citizens of Dave's town can walk around. It also defines which citizens appear on each screen and their starting location and direction. There is also loads of other details that are yet to be implemented. To show the current state of the game I've put together another short video. It may seem that the game is running a little slow but I turned down the speed so that my screen capture program did a better job of capturing the animation. You will also be able to see that I haven't implemented collision detection or z-ordering. These will be worked on when I next get a bit of time. For now, enjoy the site of Dave trying to avoid those annoying grannies.

Thursday, 11 September 2008

What a great summer !

Work has been a bit busy recently so Dave the Dog has not really progressed much further. In the few spare minutes before work I've been able to design the XML that describes Dave's village. I have added a couple of simple screen descriptions so that I can work on the next major area which is the code that will import the data and create a screen and all its elements. These elements define the exit points and the areas that Dave and the other villagers can walk. Any objects that can be collected or interacted with are also held in this XML. I wasn't going to use XML but it makes life so much easier to add extra data as my ideas change. This file will only be loaded when the game starts so there will be no performance problems once the XML is read in and screen objects created. As Dave leaves a screen the code just gets the next appropriate block of pre processed data from the list. It's this screen manager and list code that I'm working on at the moment. I hope that over the next few weeks I'll be able to walk between a couple of screens and be restricted to areas of the screen defined by the XML.

I feel a lot fresher after my summer holiday. For a change I didn't spend anytime thinking about programming. Instead I went kayaking on the sea and photographed steam trains and waterfalls. Unfortunately the English summer also showed why most people go abroad for their holidays. Shown below is a picture of Sidmouth (Devon) in the middle of August. Please note that I did not go out in a kayak whilst the weather was doing this.

Thursday, 24 July 2008

Into the world of Dave

Coding has taken a bit of a back seat whilst I worked on some graphics. I needed to produce something to code against so that I can check the animation etc. Shown below is a mocked-up screen showing what has been produced so far. Now that I have produced some sprites I need to get back to writing the code. Hopefully I'll have another short video soon of Dave walking about his town (need to think up a good name for it).

Wednesday, 9 July 2008

Dave the Dog lives...

I've been a bit quiet recently as the day job has sapped all my time. To make matters worse I got a virus that was so bad I had to format my drive and re-install Windows ! I lost some code as well as time which was depressing. To try to cheer myself up I had a quick look at my "Dave the dog" game and even found time to create a short video of the basics. I resized the "granny" sprite as the last post showed her a little too small (or was Dave too big?). Anyway, this video shows Dave walking about under the control of the keyboard and the granny is controlled by the computer. If I'd captured more video you would have seen that she bounces off the sides of the screen and changes direction. [NB: This video has now been removed. See the more up to date video in a more recent blog entry.] Currently this is written in Delphi but I am very tempted to produce an XNA version using C#. I may well develop both simultaneously just to see if I can fry my brain. From now on I'll be storing my code in different places so that if I get another virus I won't loose my data.

Friday, 6 June 2008

Its Dave the dog

A few months ago a private joke amongst my family and friends got me thinking about a game I started for the Amstrad over 20 years ago. It was based on a dog walking around a town doing jobs etc. This reawakening of a distant memory has inspired me to start it again but this time for the PC. Once its completed I'd like to write it for the Amstrad and Spectrum computers. The main character is called "Dave the dog". He is based on the dog that appears in the first (and possibly the second) Jack the nipper game.

By using my game library code I quickly got Dave controllable and a mad granny bouncing off the edges of the screen. I have created a map of locations and have a reasonably good idea for the story line. I just need some help with the graphics and plenty of time to get it done. I'll post more screenshots as I progress.

Cavern Fighter 2 is on hold for the moment as I was finding it difficult to get motivated with it. I'll revisit the code in the future.

Thursday, 20 March 2008

DevWeek 2008

I've recently got back from this years DevWeek held in London ( This event was biased towards Microsoft products so wasn't really relevant to any Delphi programmers. Obviously as most of it was .net related I guess you could implement some of the technology using Delphi for .net. Now that I'm back at work and no longer have the "fun" of standing on a train as it meanders its way in to Liverpool street station, I can get back to some fun stuff. Over the next few weeks I'll have less spare time as new work projects will take up all my time. The company I work for will be concentrating their efforts using the new MS products. So it'll be less Delphi and more C# along with Silverlight and AJAX. All interesting stuff but I'll still be looking at my games as a break from managed code.

Friday, 22 February 2008

The Explosion Editor

I have put together a quick and dirty utility that allows me to design the path that a particle will follow during an explosion. Its all pretty much point-and-click and quickly produces the numbers that I can paste into my game. This is why I'm a fan of Delphi, it makes producing applications like this so quick and easy. Shown below is the editor, just in case you are interested in what it looks like.

Thursday, 21 February 2008

After a short break I've started work on Cavern Fighter 2 again. I have just finished work on the explosion classes that will allow me to create some interesting effects. In the last game almost every explosion consisted of a single sprite cycling through 8 frames to simulate a fireball. This time I wanted more control to be able to change the explosion depending on what had been destroyed. To achieve this I have developed a set of classes that make up my "Explosion Manager". All I need to do is make a simple call into this class and pass in the ID of the explosion and the starting X and Y location. The manager then creates an explosion based on the ID. Each explosion will consist of multiple burning particles to create some spectacular effects. Each particle will follow a predefined path allowing them to create distinctive patterns. What I need to do now is to create a separate utility to enable me to design and test these patterns.

The next big job will be to combine the weapon classes and the explosion classes with the (not yet written) collision detection. Once this is done that will be the core of the game completed.

Tuesday, 15 January 2008

A Happy New Year to you all. I've not done much in the way of Blogging recently as I've just been way too busy. So here is my first Blog of 2008. Shown below is a screenshot of my Cavern Fighter 2 game. Its based on my Game Library and so far its developing smoothly. Although this image is static it does show many important elements of the game. The background is being scrolled and the background items were placed as described by the data from the level designer. The two fuel dumps are animated and the ship is controllable by the user. A laser blast has been fired which will soon fade. The shot can be animated and have a gravitational pull applied to it. The weapon class defines the quantity of shots that can be fired simultaneously, the distance the shot will travel and the damage it can impart. All of this make for an almost playable game. Next on the to-do list is the Explosion classes. I want different items to explode in different ways. After that I will implement some collision detection and put together a wrap around demo so that people can try it out. I can then start to add the other elements that need to be displayed such as lives, health, selected weapon etc. The final parts of the development work will then be the in game "shop" which allows you to upgrade your ship, the splash screens and anything else I've left out. By then I hope to have found someone to help me out with the graphics so that it will have a more "professional" look about it. For now I'll let you look at the image whilst you wait for the next instalment.