Category: C#

Awaiting for that Button click

Why wait when we can await? I believe that most of C# developers know about the new language features for asynchronous programming with async and await keywords but how many of us are really exploiting them to full extent? Recently i was watching the excellent C# Language Internals course on PluralSight.com by Bart De Smet and came across very cool idea of using Await to wait for Button to be clicked – which pushed me to write this post and share it with everyone. By implementing a custom awaiter for Button (via extension methods) and hooking up to the Click handler…

Introducing the Unit Testing Context Pattern

Another pattern? Well yes. I write unit and integration tests almost every day and along the way i learned all kinds of different tricks and gotchas on how to be more productive and how to write less fragile tests. But one of the patterns that emerged i never saw in the code of other people so i decided to share it here since i find it very useful. I call it Testing Context Pattern and – unlike it’s name – its very simple. Idea is to create in your Test Fixture a private class called (you guessed it) TestContext and put…

Video of my game Marbles for Windows 8

Hi all, here is 1 minute video of my game Marbles for Windows 8. Its recorded on my desktop machine and played using a mouse, but it works also with touch based devices, and you can even play with multiple hands at the same time, which opens some interesting multiplayer possibilities… Let me know if you have some ideas how to improve the gameplay, what power-ups i could add etc…

Solving Resolution Independent Rendering And 2D Camera Using Monogame

As i promised in my previous post where i announced my Windows 8 game Marbles, i will try to tackle some of the common problems that beginner game developers encounter. In this post i will jump ahead a little and talk about Resolution Independent Rendering using Monogame. What the heck is Resolution Independent Rendering? Well its fancy name for finding ways to not care about resolution during your game development. Idea is that you render always using fixed (internal) virtual resolution you choose and then simply stretch or shrink all that for the real resolution of the current device you…