Archive for the ‘Uncategorized’ Category

Gertboard Motor Test

April 28, 2013

Well I have been running through the test programs for my gertboard and they all seem straightforward. There are a few snags you can hit even using the manual.

The manual has lots of wiring diagrams but it does not clearly explain you need to put the 3V jumper on to fully enable the buttons and leds. Secondly for the motor test it does not fully explain the type of external power source you need. I initially had a 2 AA battery pack as used on the adafruit example. This did not produce enough voltage to power the motor through the gertboard (it did power when the battery was hooked direct to the 3V motor)
A 9V PP3 battery is required to power the 3V motor on the motor test program.


Torchlight2 Item DB

April 6, 2013

I have been working on an ASP.Net MVC EF Application that allows you to explore, query and analyse that Item and Gem Data in the TorchLight 2 Game. I thought it would be an interesting project that would allow me to compare ASP.Net MVC with Ruby on Rails and more importantly Oracle Applications Express 4.1, a tool that I use reasonably often at work.

I have to admit I have found ASP.Net in the past not that interesting especially compared to classic ASP, the whole Web Forms concept seemed to be too custom and too dependent on clicking in controls, seemed too ActiveX or VB6.

ASP.Net MVC does give you complete control of the code, you can use many open source controls and the Microsoft specific HTML helpers are generally useful although the Ajax Helpers are a bit too restrictive you are far better just writing it yourself in Javascript at least that way you can debug it. The Entity Framework does a good job of replicating Ruby on Rails ActiveRecord Framework although I found defining the relationships through the Model a bit awkward, it’s simply an annotation in Ruby on Rails. Now as I have an existing database (I had to pull the Item/Gem data out of Torchlight 2 I  could not use the Code First Method) so that may be one reason but again it was easy to use Ruby on Rails annotation to define how things are mapped.

Saying that Visual Studio Express 2012 is much nicer than the gedit environment I used on my netbook for Ruby on Rails. Git Integration is nice however I could not use it well with AppHarbour, in fact Git Integration in the Express version seems quite awkward, how you rollback from within Visual Studio seemed impossible

I used the Windows 8 Github add on and that worked seemlessly with AppHarbor and AppHarbor is free unlike Azure which is free for 3 months. Should have realised that going the way Microsoft charges you even to play online with XBox ;). Also another nice think with AppHarbor, once I had my connections set up I could easily copy my databases across though that might be to do with Sql Server Management tools.

So my Torchlight 2 Application, what does it consist of. Well firstly the home screen.


As you can see it is all fairly standard from here you can explore the search for specific items/weapns, there is also a couple of Wizards which advise use the best use of a gem and the best use of the weapons.

You can also Explore through the Item Database

Below is a screenshot of searching through the Item database


Below is a screen of the Gem Wizard where it give advice on their best use.


Below is a screen of the Item Detail Screen



Below is a screen of the Best Weapon Use Screen


Screen of the Explore Items Screen


There are quite a few screens, they all make use of Partial Paging, Ajax and the Entity Framework, You do not have to log into the application except if you want to add Items to the basket. I have not done anymore with this and probably won’t, I have a raspberry pi and gertboard to play with.

Do feel like doing a post comparing ASP.Net MVC with Oracle Applications Express 4.1, comparing Models, Views, Controllers, ModelViews and separating out database code into separate classes is kindof hard to do in Apex but there are ways of structuring code in Apex. And I will find it interesting thinking about how my Apex code has been formally structured (packages, functions, Apex API and of course that front end).

My torchlight2 app can be found at















XNA Screen Manager

March 23, 2012


Developing a game i have found is very different from developing a business application.  In a business application you will have a menu, then a series of screens which will as a rule run independently and have similar behaviour, the user will enter data and save this to the system

A Game however will behave differently depending on what screen you are on,the main screen will contain a menu to start the game,view instructions and exit the game.  The user will press Up or Down and select the appropriate option. The Gameplay screen will be completely different, you will have a main Gameplay Loop that iterates throughout the game, updating the position of enemies, drawing on the screen and handling updates.  It will also be possible for this screen to be left immediately for example if they go to a Pause screen.

There is sample XNA code available called ScreenManager which can be used. If you google it you will soon find it

This is how you call it

screenManager = new ScreenManager(this,graphics);



You can then add screens using the following screens

screenManager.AddScreen(new MainMenuScreen(), null);


You can then use this for all the screens including the Gameplayscreen which will contains the Gameplay screen.,

To enable this function the screen will need to inherit from the Gamescreen class.

Put your own logic into the Update method in the Screen Manager class shown below to control what screen is shown or when you need your Gameplay screen to show a new level

public override void Update(GameTime gameTime)
           // Read the keyboard and gamepad.

           // Make a copy of the master screen list, to avoid confusion if
           // the process of updating one screen adds or removes others.

           foreach (GameScreen screen in screens)

           bool otherScreenHasFocus = !Game.IsActive;
           bool coveredByOtherScreen = false;

           // Loop as long as there are screens waiting to be updated.
           while (screensToUpdate.Count > 0)
               // Pop the topmost screen off the waiting list.
               GameScreen screen = screensToUpdate[screensToUpdate.Count – 1];

               screensToUpdate.RemoveAt(screensToUpdate.Count – 1);

               if (screen.isLevelChange == true)
                   //new leve
                   PlayerIndex e = (PlayerIndex)screen.ControllingPlayer;

                   if (icurrentLevel == 14)
                       icurrentLevel = 1;


                       // I think isLevelchange should be false
                       LoadingScreen.Load(this, true, e, false,
                                 new GamePlayScreen(icurrentLevel));
                       // Just added this
                       //screen.isLevelChange == false;
                       // Just added this
                       //AddScreen(new GamePlayScreen(icurrentLevel),e);
               //    }

                   // Update the screen.
                   screen.Update(gameTime, otherScreenHasFocus, coveredByOtherScreen);

                   if (screen.ScreenState == ScreenState.TransitionOn ||
                       screen.ScreenState == ScreenState.Active)
                       // If this is the first active screen we came across,
                       // give it a chance to handle input.
                       if (!otherScreenHasFocus)

                           otherScreenHasFocus = true;

                       // If this is an active non-popup, inform any subsequent
                       // screens that they are covered by it.
                       if (!screen.IsPopup)
                           coveredByOtherScreen = true;

           // Print debug trace?
           if (traceEnabled)


XNA Development – Boo Boo Birds

February 10, 2012


Coming soon for X BOX INDIE CHANNEL BOO BOO BIRDS a 2D Physics Arena  Game starring some very irritated birds ………..

The Case for Super Meat Boy and Dark Souls

October 23, 2011

Well I have decided to split my blog into Gaming and Programming. This anonymous ones gaming…and what I have been playing is Super Meat Boy…..and the one thing I think about his game every time I play it is euphoria…well that and anger. With this game and Dark Souls it seems finally gaming is starting to be about challenge rather than putting the time in and collecting achievements.

Still I have not got Dark Souls…there is no way I can play no pause gaming with few save points when I have a baby to look after and a wife to keep happy as well.

So Super Meat Boy with its hardcore skill level and 5 minute bite size levels is what is right now…Deus Ex 3 is coming this week so my 360 will finally get used for more than Kinect games and Forza

26 march 2010

March 26, 2010

Do you ever wish to sleep for 14 days

XNA Development

March 10, 2010

Well development is moving with my Word Game. A Suffix Tree for the Dictionary and the Marblets sample for the starting point. There does seem alot of code needed to create a game in comparison to Flixel. Yet I guess this is a bit less hacky.

I am switching to a more slick game instead of something amateurish with badly drawn zombies. I still want “Power Ups” in this word game with Sprites running round the screen.

My XNA game book has arrived, will use it to add special effects once the game is ready. Word Soup made some money. And I think using XNA I can target windows 7 phones,,..should be a few of these around once I finish this game.Another 40 minutes of work time left 🙂

Herding Monkies game is still getting hits. Maybe I will get some payment after all


March 3, 2010

Started on XNA . Visual Studio XNA is a wonderful environment, so easy to plug in existing C# routines such as a suffix tree. This will be useful for my word game as I can use it to searxch through the dictionary. In fact I already got that working, now draw the word tiles.

Will be somewhat different to the flixel flash platform game Herding Monkies. there is some differences, no built in 2D physics….Built in 2D, gamepad controls though.

On the Flixel point it is nice to see Gravity Hook coming out 🙂

Ohh has a way to come.

It will get there

Bye Bye Flash

February 23, 2010

And now I put my game out,

Looks like it takes a bit more work crafting a game that will make a lot. The takings for the Herding Monkies game is about 52 cents. Making money out of this sort of thing is possible though I suspect it requires a bit more work, maybe a professional artist and if you are lucky you should make about 1500 dollars at that.

Still it will stand me on good ground for my next game which I think I will do in XNA. That way it is good experience doing .Net. It will be word based, two player split screen and should be playable by anyone.

My First Project

February 23, 2010

My first goal on this web site was to be able focus my work on one location. Well I have created the first level of ,y Action Script 3.0 game. Is it worth doing more than 1 level. Not so sure. I think it would be easier if I had created a game where you would shoot things, instead of just throwing bananas at them..or perhaps a puzzle game.

Still it is always good to finish what you start so maybe I will create three levels, integrate with Kongregate and move onto the next think. System so far can be played at


See this is what I meant the site to be for. Now. I think Bayonetta. Haven’t played it for a week and been too busy talking to Aci the past 90 minutes…visiting parents to get anything done. First..fix the gibs heart bug..Add the 8 bit collective music from  this guy and fact now Bayonetta