Wednesday, May 7, 2008

Upcoming XNA Racing Game

Soon, very soon......

Sunday, May 4, 2008

XNA and current Gamertag

As I reached my 10.000 (YEAH!) gamerpoints I wanted to see this in
  1. My Blog
  2. In a XNA application

Soooo, I registered at http://www.mygamercard.net/ - which is just a 1 click action - and wrote the app you find below, which gives me a PNG image.

Download source: here

Friday, May 2, 2008

XNA 2D Animated Coin

Something I wanted to do a while ago.
An animated coin.



Be patient source code and description will be released soon!

Thursday, May 1, 2008

XNA Randy walking on a slope

Inspired from Kersson's article about How to move a sprite in a continuous map, I thought it might be cool if :

  1. The terrain also moves around and not only Randy.
  2. There would be a nice background,
  3. and maybe it starts raining.
  4. If Randy starts jumping around, this would make it close for beeing perfect.

Have look at the outcome so far below (sorry, might take a while to load):



Stay tuned as Randy should do some more things soon!

Wednesday, April 2, 2008

XNA Randy Collission prevention

I tried Nicks collission detection example with Randy and a stone texture.
You can see the outcome below:

Still start the app 2 times and use H and C for Host or Client.
Source:
http://hamboeck.googlepages.com/XNARandyWalkingCollission.zip

Saturday, March 29, 2008

Converting XNA PlayerIndex to string and int

It might be obvious, but I needed it today for the networking stuff to pass player data around. I wanted to convert the current Playerindex to a string or int and vice versa.:


PlayerIndex pix = PlayerIndex.Two;
string ps = pix.ToString(); // "Two"
int pi = (int)pix; // 1
pix = (PlayerIndex) Enum.Parse(typeof (PlayerIndex), "Three");
ps = pix.ToString(); // "Three"
pi = (int) pix; // 2
pi = 0;
pix = (PlayerIndex) pi;// "One"


Friday, March 28, 2008

XNA Randy and Lindgren Networking lib

Inspired from two articles I found on ZiggyWare I wrote this short Network sample.
It uses a tile map of Randy and he Lidgren Network library.



Download it from here (link updated on March 29th)

You find the initial articles here:
Moving A Sprite In A Tile Map:
http://www.kersson.com/articles/article.aspx?ar=42
Lidgren, A Safe alternative to using XNA's Networking:
http://www.ziggyware.com/readarticle.php?article_id=168

You should start the application 2 times.

Press H or S to be the Host
Press C to act as a client

Move Randy around by using the cursor keys.

Depending on which application has focus you will move Randy around and in the other application you will see the Network Randy moving around.

Wednesday, March 26, 2008

.NETDJ Article Online

My first article about the XNA Car Cup game is now online.

Read more here: PDF

Sunday, March 16, 2008

Simple XNA Walking Man Animation includes 2D Shadow

A small update to my walking man:
It contains now a 2D shadow for the guy....



Source:

Simple XNA Walking Man Animation

My daughter wanted to see a man walking on the screen. You can see the outcome below.
Special thanks to Gary Darby, Intellitech Systems Inc., who posted a few years ago some Pascal source and the images.....

The amount, the size as well as the speed of the runners is configurable. Enjoy!



Source:

http://hamboeck.googlepages.com/XNAWalkingManAnimation.zip

Saturday, March 15, 2008

Animated Starry Background

As my wife was out with the kids I played around with the VertexPositionColor class and the DrawUserPrimitives in XNA. The outcome is this sample of a starry background where the stars change the color on a random basis.

The image does not really show how cool it really looks like :(


Source Code:
http://hamboeck.googlepages.com/XNAStarBackground.zip

Thursday, March 13, 2008

Marco Monster's Car Physics Demo in XNA

Today I had a little bit of time and I found a very nice (work/learning wise not really graphics wise) little demo about a small car, which one can drive around and all the interesting values when it comes to in game physics and a fast driving car are shown on the screen.

It was written a while ago in C++ and uses Allegro. I thought it would be nice to have a XNA version. I do not know if this is already available or not, maybe the geeks have this already for a while. If you do not have it please feel free to play around with it.

BTW, I have finished my second article for the DNDJ about my XNA Car Cup Simple racing game already, but this might be something for part 3 ;)

People aready start pushing me, but it is done when it is done :))
So stay tuned, there is much more to come. If you have any ideas or wishes, let me know!!



It is still slow, far from beeing perfect, but I am too tired today to look into it again, but I bet you get the idea and there will be an updated version soon....

UPDATE: I uploaded a newer version today, I replaced the drawing method for the lines, I am using the PrimitiveBatch class from the creats.xna.com web site, which makes it much faster.

The keyboard keys used:
Escape ................................. Exit
F12 ...................................... Reset
Up/Down/Left/Right ....... Drive the car around
Q/W .................................... Zoom in/Zoom out
R/F/Space ......................... Slip around (Rear, Front, Both)

Source code:
http://hamboeck.googlepages.com/XNACardemo.zip

Tuesday, March 11, 2008

XNA Car Cup Article for DNDJ Part1

A while ago I bought my XBOX360 elite. As a C# freak I quickly jumped on the XNA Game Studio train. The first outcome of this is a game development series for the DNDJ where I explain some parts I developed for the XNA Car Cup game. The first part is going to be printed this month, below you can find the full source code for VS2005 Prof. and XNA 2.0.

Source code for part1:
http://hamboeck.googlepages.com/XNACarCupSimplePart1.zip

Tuesday, January 29, 2008

WinForm Client for Reporting Server

Introduction
I started to play around with MS Reporting Server. Honestly speaking: I like it. It needs some minor enhancements, but overall it is a very nice product. You create your reports in minutes from within Visual Studio and deploy it to your IIS. The reports are immediatly visible for the audience (if they have the proper rights to access your IIS) and the reports look quite nice from the beginning (do not forget to add a footer with a page counter, today's date and maybe the user name to your reports so that also management likes them). Nice, but a web client alone is not what I was looking for. It is great for your end users, but as a developer I want a WinForm client.

The Winform Client requirements
With this client I wanted to be able to test my reports and use it as a little helper tool during development (check header, footer and the overall outcome of the reports).
  • connect to any reporting server
  • use default credentials or
  • pass a username and password combination
  • get the list of reports dynamically
  • I want to decide how many reports I would like to see
The implementation
It turned out that this is quite easy to implement.
The steps to reproduce are quite short:
  1. Create a new Winform application in Visual Studio.

  2. Place the following controls on the form:
    A Textbox for the server URL
    A Combobox used to populate with a list of available reports
    Two buttons - one to fill the combo and one to run the report
    A tab control with two pages and on both pages we need a ReportViewer control

Let's start coding
We need to create a web reference (right mouse button on References in solution explorer) which gives us a local proxy to the reporting server web service (the url for a local installation is http://localhost/reportserver/reportservice.asmx). I gave it the name RSWebService.

We need to instance variables to hold the web service proxy and the current ReportViewer control:

private ReportingService _rs = null;
private ReportViewer _currentViewer;

Also, a small helper class to hold the report name and report URL comes in handy:

The next thing we need to code is the button to connect to the web service using the proxy, retrieve a list of reports and fill the combobox. You see the full code below (click on the image to get it readable).

Now, our users would like to choose a report and show the report in the tab page.

Last but not least we would like to create a new tab page with a ReportViewer control on it if the user clicks on the last tab page on the tab control - which means we have to code the
SelectedIndexChanged event as you can see below.


Conclusion
Rporting server is really a cool piece of Microsoft SQL Server. With this small helper application development with it becomes even more fun and a bit easier (at least for me).

I hope you enjoyed this small article!







CSharpCodeFormatter