Showing posts with label C#. Show all posts
Showing posts with label C#. Show all posts

Monday, November 7, 2011

XNA - CAD2D Framework

Last month I've started to write my own simple game framework for XNA but recently the progress has been stopped for awhile. Hope I have time to finish it.

Well anyway, just to update my current progress, I've finished a simple 2D image/sprite libraries, which support texture atlas and animation.

In addition, I've done a simple GUI library too, currently there is only 1 available which is Button.
More GUI features coming later.

Below picture just to illustrate what are available classes/features in the framework now:

As you can see, it's a very simple framework which I only spent 1 week to finish it. Hopefully in future I can continue to add more features on it :)

If you are interested you can download and have a look at it, for GUI event handler I uses delegate pattern to design it.

A simple test program is available here and more information about this test program can be found here.

Thursday, October 20, 2011

XNA - Sprite Viewer

It's been a while I didn't update my blog. Recently I've done a simple sprite viewer in XNA.

Basically it be used to view a texture atlas by providing correct texture data file.

In short, you will need to use Texture Packer to pack all your textures and generate the texture data file by selecting LibGDX format.

Just to promote a little bit about Texture Packer in case anyone of you who do not know what is that. The main role of Texture Packer is to combine different texture into one big texture which we call it as Texture Atlas. The purpose of doing is to optimize the in game performance so that it does not need so many draw calls to render sprites/animations.

This is even more important when u are developing games for mobile because it has limited memory so you must save as much as u can while maintaining the performance and quality of your game!

In addition, the main lesson I learned from this simple application is the input system that I designed based on delegation concept. Well there are other different ways of pattern you can use to implement your input system but most likely they'll be using delegation pattern too.


Sample screenshots:

Screenshot 1

















Screenshot 1


Download link:

Saturday, February 26, 2011

Spaceship Fighter - A Simple Shooting Game

Hello guys, after been through some series of beginner tutorials of Unity. I've came out a simple spaceship shooting game.

All the arts and models are taken from somewhere else.
It's not a fun game but it is my first experience of working in Unity!

All the scripting was done in C# :)

Here's are some screenshots:
*Game screenshot

*Player spaceship exploded (Particle effect)

*Lose screen

Video demo:




If you are interested to try out this simple game, you can download here:

Hope you enjoy :)

Tuesday, January 25, 2011

First Investigation Team: Intruder

Finally, I have finished developed another game by using XNA!

Basically it is a 2D real-time strategy game. All you need to do is conquer/eliminate your enemy bases.

This is my first time to develop a game with AI. The AI that's I've included is Decision Making + Finite State Machines. Although the AI is still not smart enough but hope that in future if I have free time I will try to improve it :)

Again, since I'm not an artist, so what I did was using google to find images and edit in Adobe Photoshop. Hope that you won't mind about it.

Enough of talk, here are some screenshots:
*Main menu screenshot

*In game screenshot 1

*In game screenshot 2

*Pause screeen

Video demo:




Download link here:


PS: You need to have XNA Runtime Redistributable 4.0 and .NET Framework 4.0 installed before you can run this game.

Friday, December 31, 2010

Magnight - A 2D Puzzle Platformer with Physics

I've almost forgot to introduce a game call Magnight to you guys. Basically this is what we have done during our internship back to October time. The internship program known as GameINC, it is organized by MAC3.

I'm the lead programmer of the team and we have few programmers, few designers and artists to work on this project. After been through a complete game development cycle, I'd learned a lot and feels like I have up 1 more level :P

*Magnight poster

Well, enough of introduction, basically Magnight is a 2D puzzle platformer game, all you have to do is solving puzzle and proceed to the next level. The gameplay is casual and suitable to all kind of gamers :)

*Gameplay video 1

We only used 3 months to develop this from idea pitching until post production. Although it may not be a very fun game but it's still fun to play.

*Gameplay video 2

We are using Microsoft XNA to develop this game and Farseer Physics Engine.

For more information you can visit our blog.

You can get the game here:

I hope you enjoy this game :)


PS: Before you can run this game you will need to install:

Tuesday, December 28, 2010

Simple Collision Avoidance

Recently I'm been thinking about how could I implement collision avoidance in my game.

Well, after googling, I found a very useful blog and he'd teach about how to implement collision avoidance.

Here's the link:

Basically his idea is simple, when the object is near to obstacle, the obstacle will act like a magnet pushing you away from itself. After that, it will try to pull you back. With this implementation the effect of movement is quite smooth but sometimes it will still stuck due to the path between two obstacles is not big enough for the object to pass by.

Since it is not a path-finding based implementation, so it might not give you the shortest path.
If you're looking for A* implementation you might need to search for other resources which uses A* to implement collision avoidance.

Here are some screenshots:
*The object trying to move to the right

*It will slide down and continue its path

*Until it reaches the destination

Video demo:



You can get the program demo here:
PS: It's in XNA 4.0 so you need to install XNA redistributable 4.0 before you can run it

Tuesday, December 21, 2010

AI - Flocking Behavior

Flocking is a popular term in AI field and it indicates the behavior of a group of birds flying on the sky. Originally it is simulated on a computer by Craig Reynolds in 1986. For more information about flocking's history, you can wiki it out :)

Birds are smart, while they are flying, they won't "crash" with each other. Craig Reynolds named those birds as boids in his simulation program.

This behaviors is very useful when you are simulating a group of units moving to certain target.

Since my current game needed flocking behaviors so I need to learn how to implement it!

Luckily I found an useful tutorials:

In short, you just need 3 main rules to achieve flocking effect:
1) Boids try to fly towards the centre of mass of neighbouring boids.
2) Boids try to keep a small distance away from other objects.
3) Boids try to match velocity with near boids.


Sample screenshots:
* Just initialized

*Pursuing the target

*Target changed

Video demo:



Download link here:
PS: It's in XNA 4.0, so you need to install XNA redistributable 4.0 before you can run it.

Friday, December 17, 2010

Under Development - FIT: Betrayal

After a long time of delay, finally I have another episode of First Investigation Team under development!

Here is First Investigation Team 1 link:

Basically it is a real time strategy game which focusing in AI! It is developed for PC platform by using XNA :D

More details for the game would be posted in later time because the gameplay is still uncertain so it might change eventually. For now it is something like resource gathering and building army to conquer your opponent's base!

This is my first time to learn AI so it might take a lot of time for me to finish it.

Here are some sneak peek!
*Sample screenshot 1

*Sample screenshot 2

Say Hello to XNA!

XNA basically is a new API developed by Microsoft for developing games. It is an extremely easy to learn and use and friendly :)

There are a lot of online resources, tutorials available, anyone can learn it. BTW, learning XNA give you another benefit which is you can easily just port your game to XBOX in 1 or 2 seconds! COOL, right? In addition, with the latest XNA 4.0, now you can even develop game for Windows Phone 7! It is a nice phone and I believe it has a lot of potential for game development!

Well enough of talk, this is what I did after 2 days of learning XNA. A very simple game, all you need to do is control your character moving around and try to avoid as many obstacles as you can!

Sample screenshots:
*Screenshot 1

*Screenshot 2

*Screenshot 3

Video demo:



If you are interested to test it out, you can download here
(You need to install at least version XNA 3.1 redistributable before you can run it)

Farseer Physics - Raycasting Demo

Hmm, I'm not sure what is the proper way to implement laser but this is what I did by using Farseer Physics.

Sample screenshots:
*The laser colliding with obstacle, the laser will stop

*The length of the laser is following my mouse cursor.

Video demo:




Basically I'm just using Raycasting provided in Farseer engine and try to implement some demo.
It's just some simple test out anyway XD

If you are interested to download you can get it here:
(You need to install at least version XNA 3.1 redistributable before you can run it)

Farseer Physics Engine for XNA - Magnet Simulation

Nowadays, physics is playing important role in games. Since it is so important so I think I should give it a try. I've chosen Farseer Physics Engine for XNA, it's quite nice to use and it is developed based on Box2D :)

Here are some tech demo that I've done. What I'm trying to do is basically testing the attract and repel effects of magnet.

Sample screenshots:
*Screenshot 1

*Screenshot 2

*Screenshot 3

*The implementation

Video demo:




If you are interested to test out this demo by yourself, feel free to download it:
(You need to install at least XNA 3.1 redistributable before you can run it)