# Monday, 21 March 2011

Performance looks hopeful, high potential to be a real game now.


Monday, 21 March 2011 11:38:05 (Malay Peninsula Standard Time, UTC+08:00)  #    Comments [0]  | 
# Friday, 18 March 2011

Well.. I got my phone unlocked... now what?


Friday, 18 March 2011 00:18:28 (Malay Peninsula Standard Time, UTC+08:00)  #    Comments [0]  | 
# Sunday, 13 March 2011

While working on my little XNA sample I bumped into a little problem. No matter how much time I spent on it, I can't draw for the heck of it. And not to mention, the total time it'd have taken me to draw a set of sample sprites might have allowed me to finished another code module on the sample.

In a suddden eureka moment I picked up the Asoblocks I bought a while back, put together some models and then took this photo.

Source

The individual elements were then color keyed so I'd have a pretty nice template to work with.

player

Then it was a matter of resizing the image and adding some extra details and viola…

invaderwin

Definetly better than me trying to draw the whole thing!


Sunday, 13 March 2011 18:20:15 (Malay Peninsula Standard Time, UTC+08:00)  #    Comments [0]  | 
# Saturday, 12 March 2011

Microsoft's XNA is a game development framework which allow the creation of games for various platforms through the use of Managed .Net code. What I found extremely nifty while I was doing some research was that once I had a simple app running on Windows Phone 7. (emulator only since I've run into a little snag trying to obtain deployment credentials)

invadershot

Since the app code is pretty simple, if I wanted to create a Windows desktop app all I needed was to select Create Copy Of Project For Windows and... Windows version of the same app!

invaderwin

Yes, I realize its because I have no UI code or anything platform specific, but I can't help but geek out a little by selecting Create Copy Of Project For XBOX 360 , added some code to control via the gamepad instead of the keyboard and...

DSC01389

As I've dabbled with DirectX previously in the past its very welcome to know that in XNA you get to worry about the important things like how to write your game then worry about detecting device context, getting exclusive access to hardware, etc. etc.

Hope I'll find more time to play with this.

You can try out the Windows version of the program here. Unfortunately, you need a pretty decent video card before you can run it.

Update – Figured out that there's a lower requirement Reach profile I can compile the program for, you can get it here.

You'll need to install the XNA Framework Runtime if you don't already have it by any other means.

Arrow keys to control the ship, Space to fire, Z to enagage DEATH BLOSSOM mode!


Saturday, 12 March 2011 01:48:31 (Malay Peninsula Standard Time, UTC+08:00)  #    Comments [0]  | 
# Thursday, 03 March 2011

From personal experience, and then what I gathered on the web. That question seem to be asked A LOT! The main issue here is that by default the WPF Listbox scrolls item by item due to control virtualizing, which means it only creates visual controls when needed. This is vital for good performance if you decide to bind a large item source to the listbox, say… a few hundred items?

Unfortunately without smooth scrolling, most people find the item based scrolling very sudden and jarring and overall a bad user experience. For me the effect was even worse on my project that was for a touch based application, item based scrolling just wouldn't work!

Turning off control virtualization was not an option because of the amount of data my project needed to handle.

So I did what I took a deep dive and starting reading up on how to create a layout panel, how does control virtualization work in wpf, how to support scrolling.

And I came up with this.

An ItemPanel that performs control virtualizing AND implements IScrollInfo. You can get the sample here. So now you too can have a listbox in WPF that supports smooth scrolling AND item virtualizing.

It wasn't too hard to make it actually, all the code was available around the net in separate places, I have no idea why no one had put this together before. Or maybe I wasn't looking hard enough?

Problems With The Code

  • The control was designed to work specifically with my project, you should read up on all the links I included in the SmoothVirtualizedPanel.vb file and understand how things work before wondering why it blows up.
  • There are parts of the code (particularly in dealing with the ItemGenerator) which I'm not sure how or why it works. So it might blow up in your face.
  • If you have no idea what an ItemPanel is, you really should read up on all the links I put on top of the source file before trying to do anything else.

This is pretty much research quality code, and hasn't gone through any optimization and proper error handling yet so copy and pasters beware.

Oh… did I mention the code is in Visual Basic? ;)


Thursday, 03 March 2011 03:38:11 (Malay Peninsula Standard Time, UTC+08:00)  #    Comments [0]  |