Balloon Blaster ( XNA 2D Game )

This is not actually a project, but a small and quick implementation of a basic gameplay of 2D graphics and effiecient game state management. Created with Microsoft DirectX 9 based XNA platform. Goal is to shoot down as many as balloons while escaping from bombs and collecting medicine packs as the name of the game clearly implies :P This is done for a class assignment for Project Development and Management subject for my friend at university. I always hate that subject. We are given most retarded stuff to do. Seriously? A simple 2D game for a 3rd year undergraduate? That's awful. This is like a 1st year project work.

Anyway this is kind of a good reference for rendering and basic coding on XNA. Source can be obtained via Github. 

These are some of the screenshots :) 

Motor Massacre - Prototype 1.0

Motor Massacre is a 3D game project developed for Microsoft Imagine Cup 2014 competition. Team consisted of 4 members including me and 3 or my friends at college ( Lasitha , Sehan and Kumudu  ) .  Me and Lasitha did the programming part and other two did modeling and designing part. Unfortunately project was rejected in the very first national round due to it's rather less educational level. Ooops! :D

It took 3 months of time to learn practical 3D rendering and HLSL stuff to emulate particle systems and lighting effects. So even though team got scattered and development is stopped right now, I hope to finish this up in my vacation time. So far these are implemented.

1) Basic rendering
2) Acceleration and braking physics
3) Meter board
4) Particle system ( For night sky and collision effects )
5) Lighting effects ( Directional Lighting and illuminating )
6) Blur
7) Reflections
8) Sounds

So far car accelerates and stops as a real car smoothly. Meter board is fully functional. When it comes to lighting you can clearly see the blue, illumination and reflections in the uploaded video. It's a bit too bright when applied but other than that it works flawlessly. We'll improvise in upcoming sessions. As team is scattered it's me vs HLSL and XNA in vacation time :P  Shooting hasn't been implemented yet. This will get more badass after that's implemented! That's about all for now. Have a nice weekend :)

Enjoy! Sorry about the bad video quality though :)

Creating models for XNA with Blender

Hola mi amigos! Today I'm going to talk about how to create models with Blender for Microsoft XNA. Blender uses Z axis up and Y axis forward. And XNA uses a right hand co-ordinate system which (-Z) forward and Y axis up.

So normal models we create with Blender renders fine in XNA but they cannot be transformed well. For that changing the local axis' using a separate matrix and using world matrix for translating can be used. But in this way you don't have to worry XNA's local axis' rotations. I uploaded the video on to youtube. And in the description there is a text file to be downloaded with steps. Adios :)

Banana Hunt for PC ( Abandoned Projects )

About a month earlier I started to create a 2D scolling/platformer game, Banana Hunt. Idea was to make the game for PC, And this was not the first try. First I tried to make it on iOS with Cocos2D ( See this post ) But it was abandoned because of the lack of a proper story line and the determination. And the same happened with the PC version of Banana Hunt. Or may be the bad luck comes with the name "Banana Hunt" may be? I don't know.

 Above is a screenshot of the current development. Graphics are from the 
Vicky Wenderlich's web site. She makes so amazing graphics. Check her web site for free game art. ( www.vickywenderlich,com )

Anyways currently the project is kind of on hold. But if anyone's interested in writing a proper story for me, I'm all in for that. 

You can download the source code from my github. ( Link to Source Files

So far implemented :

1) Game states and menu systems 
2) Scrolling 2D camera 
3) Movement and jump physics 
4) Target to catch
5) Scoring and rendering text 
6) Texture animations

See ya'll soon with another post. Adios! :)

Banana Hunt for PC Build Log ( Day #1 )

I was out from making anything for quite a long time. So I thought of doing something productive after like 5 months. Then I remembered that I have some unfinished business with Banana Hunt game which I started in iOS platform. So I looked in to it, and OMG it was such a mess and I felt horrible about that. Thanks to my foolish brain I've lost track of most fundamentals in iOS programming and on Cocos2D library ecosystem.

So I took an easy way, chose to code it from scratch with XNA :D  Yeah I know it's already out dated and so on. But these awesome people at Monogame studio have resurrected this beast again. XNA may not be the best API. But it's simple and elegent for projects. IMHO it's not that good for industrial projects. And with monogame it has become a cross platform library. So Kudos to the Monogame team for doing such awesome work :)

Unlike XNA you can use monogame to do your work in Visual Studio 2012 as VS2012 doesn't support XNA at all. But hey remember that even with monogame extension installed you don't have a .XNB file generator mechanism inside visual studio 2012 as it doesn't support pre compiled resources. So to convert images, sounds and movies to XNB format you still need Visual Studio 2010. Bit of a mess. But you can do it in Visual Studio 2012. But I'm still going with Visual Studio 2010.

Enough of that I guess...


When last time I made a XNA game, it hardly had any OOP. So this time apart from the player ( monkey) all other sprites are handled with classes. The mosed 'desired and praised' way of most people is making classes for every sprite and using Drawable component class for managing those classed. But in terms of simplicity without component classes I'm using good old OOP concepts. And the game is to collect as much as Bananas in a given time :D :D

I've allocated 2 hours a day per everyday and I'm going to try my best to publish a post on day's progress. As for today these were what I was able to do.

1) Created the repeatable background and scaled sprites ( Original sprites are from Viki Venderlich. Kudos! )

2) 2D centre following Camera  ( Modified the Camera class taken from the last project and used it  )

Not going to give the code itself because quite unsure how it will perform until I see the end of this project. But I tell how I did it, and when this completed you will be able to download everything from github. But for now...
Create a viewport object so you can reference for that. Then create a 2D vector variable to record the centre. Because we are going to track the centre position of the screen and move the camera along with the player ( monkey ) sprite. And also a Matrix transform to move it. Then inside a function, calculate the centre. For that pass Game instance and gametime instance from the main class. Then translate the view matrix according to the differnce of calculated centre between time laps.

3) Drew the repeatable background and Monkey itself :)

 That's all for today. Hoping to do some RANT learning sessions on Cuda and DirectX. Let see how it goes. Bye :)