Nico's digital footprint

I grew up in the nineties, that makes me awesome by default

MonoGame–XNA on Windows 8

by Nico

UPDATE: The good people of MonoGame brought it to my attention that MonoGame currently does not support Windows Phone 7 (XNA is supported on Windows Phone though) but they will probably support Windows Phone 8. Thanks for the heads up guys!

There’s currently no official support for XNA on Windows 8. That’s actually a real shame because XNA is my favorite way to develop games and Windows 8 is a fun platform to develop on. Luckily there’s always the community to come to our rescue. Enter MonoGame, an open source implementation of XNA for virtually any platform out there. Think iOS, Android,  Windows 8, even Playstation Vita.

A while ago Wesley and me started working on a BreakOut clone for Windows 8 using MonoGame. We currently have a raw basic gameplay and a first level. We even released a first official screenshot Smile

I now the screenshot doesn’t look really fancy yet (wel except for the giant pacman which is always awesome right?) but it’s an early build of a work very much in progress.

Follow us on Twitter for more updates (@NicoVermeir & @WesleyCabus), also see Wesley’s blog where he links to more information on MonoGame and how to set it up on your device.


Tags:

.Net | Game development | MonoGame | XNA

Weekly update on my XNA project

by Nico

My first week back on the job is finished, that means I’ve had about 5 hours of time to work on my lunch game. Progress started of pretty small because of some enemy placement issues that showed up after I changed the complete control scheme. After loosing about an hour of time trying to fix it, I’ve decided to revert back to the virtual thumbsticks. About half an hour and some Mercurial commands later I was back to the original controls, the enemy movement behavior also reverted back to normal.

Day 2 I decided it was about time to make the enemy move, the character itself was moving up and down but without any animation, he was just sliding up and down. My animations are done using a spritesheet, the eight walking directions each have a line in the spritesheet. In the code itself I have a rectangle that has the width and height of one texture on the sheet, using the Update method I move the rectangle after x amount of time. This is the piece of code that creates the animation

protected Rectangle SourceRectRunning;
protected readonly TimeSpan RunRate = TimeSpan.FromSeconds(0.1);
protected TimeSpan RunTimer;

public override void Update(GameTime gameTime)
{
    RunTimer -= gameTime.ElapsedGameTime;

    if (RunTimer <= TimeSpan.Zero)
    {
        if (CharState == State.Running)
        {
            if (SourceRectRunning.X >= TextureWidth * 7)
            {
                SourceRectRunning.X = 0;
                return;
            }

            SourceRectRunning.X = SourceRectRunning.X + (int)TextureWidth;
        }

        RunTimer = RunRate;
    }
}

 

The CharState is just en enum that I’ve build. The enum looks like this

public enum State
{
    Running,
    Standing,
    Spotted,
    Walking
}

This makes it very easy for me to call the right code when the player starts moving or when he’s spotted by the enemy.

I was very happy of how the animation looked like, so I figured it was about time to do something about the collision detection. This is something I’ve implemented quite some time ago but it never really worked how it should. The way collision detection is working in my app is a pretty nifty one. I found it in the demo code of the tile engine that I’m using.

A map build with Tiled consist of several layers, I have a layer that contains only the floor textures and a second layer that contains stuff like trees, walls and other non-interactable objects. The demo project contained with the WP7 Tiled engine has a method that can get the color of a certain tile on a certain layer. I take the player’s position, add a few pixels to it and determine the color on that location of the Objects layer, if the color is NULL then there’s no object in the way. Let me show you the code

Color? collColor = _level.Map.GetColorAt("Objects", _player.WorldPosition + 
    (VirtualThumbsticks.LeftThumbstick * 5));

if (collColor == null)
{
    //player can move
}

The GetColorAt method looks like this

public Color? GetColorAt(string layerName, Vector2 position)
{
    var l = GetLayer(layerName);

    TileLayer tileLayer = l as TileLayer;

    position.X = (int)position.X;
    position.Y = (int)position.Y;

    Vector2 tilePosition = new Vector2((int)(position.X / TileWidth), (int)(position.Y/TileHeight));

    Tile collisionTile = tileLayer.Tiles[(int)tilePosition.X, (int)tilePosition.Y];

    if (collisionTile == null)
        return null;

    if (collisionTile.CollisionData != null)
    {
        int positionOnTileX = ((int)position.X - (((int)position.X / TileWidth) * TileWidth));
        int positionOnTileY = ((int)position.Y - (((int)position.Y / TileHeight) * TileHeight));
        positionOnTileX = (int)MathHelper.Clamp(positionOnTileX, 0, TileWidth);
        positionOnTileY = (int)MathHelper.Clamp(positionOnTileY, 0, TileHeight);

        int pixelCheckX = (collisionTile.Source.X) + positionOnTileX;
        int pixelCheckY = (collisionTile.Source.Y) + positionOnTileY;

        return collisionTile.CollisionData[(pixelCheckY * collisionTile.Texture.Width) + pixelCheckX];
    }
    else
    {
        return null;
    }
}

As I’ve said, this piece of code comes from the Tiled engine I’ve found on this site.

The problem I was having before was that I was passing the player’s coordinate on the screen to the method instead of the player’s position on the map. It does work much better now but currently I’m passing the coordinate of the upper left corner of the texture (XNA default) so it does need some fine-tuning.

I’m thinking next week to do some more work on the level editor or maybe start working on interactable objects. I’ll write another post next week, so stay tuned or follow me on Twitter to get daily updates.


Tags:

.Net | Game development | WP7 | XNA

XNA Lunch game update

by Nico

So I’ve already missed my first blog appointment about the Windows Phone game that I’m developing during my lunch brakes. Not a good start, but I’m taking two weeks off work so I do have a valid excuse Glimlach

Last week I worked 3 hours on the game in total, my vacation started on Thursday with the app-a-thon. In those three hours I reworked the control scheme. Previously the character was moved using a virtual, on-screen thumbstick. That worked great but on a device with such small screen estate and my huge thumbs there wasn’t much left to see. So I reworked that into a point and click system, tap on the screen and the character will move to the position of the tap. A side effect of this new system is that some enemy movement bug got fixed automagically, that was a rather nice surprise.

Next to the control scheme I made some progress on the collision detection system, since my level engine is a tile based layered engine it was quite easy to do. I’ll probably dedicate a separate post on the collision detection system.

All in all good progress with little time. The project will now be shelved until the end of June, the day my vacation ends is the day I’ll pick the game back up. So that’ll be two weeks without updates.

Keep an eye on Twitter for upcoming updates and see you in two weeks!

     


Tags:

.Net | WP7 | XNA | Metro | Devices

Lunch development

by Nico

For the last couple of weeks I’ve been developing a game during my lunch break at work. Why? Mainly because I had this project in my mind for a while and I wanted something fun to do while eating lunch. Since I’ve started working on it I made a habit of tweeting my progress after the break, around 1PM GMT+1. Since I’ve started doing so a lot of people have shown interest in the project, providing tips and some even wanted to see the source code or wanted to help on the project.

I never expected to get this much feedback from something like this so I’ve decided to try and write weekly blog posts about the project, I will still tweet daily about the progress and then make a weekly summary post with findings, problems and fixes.

Now, about the game. The game is a stealth, sneak around the level, isometric 2D XNA game build for Windows Phone 7.5. If I finish it and I’m happy enough with the result to submit it to the marketplace then I’ll port it to Monogame and release it on some other platforms (no, not you iOS).

What I have so far: I have a map, created with a free, open source program called Tiled. I use Tiled because it’s pretty easy to use and it provides libraries for Windows Phone to read the maps in an XNA project. Next to the map I have a player that can run around on the map, the player always stays in the center of the screen so I basically move the map around. I have an enemy, with a triangular field of view, who moves up and down between two points. The player gets spotted when he enters the field of view of the enemy.

What I’m working on now: I’m currently building a level editor with winforms. This will make it easier for me to create lots of levels with enemies and objects in them. I currently have the form, I can open a map and read out the size date from the .tmx file (.tmx get’s created with Tiled). I want to finish the editor now so I can complete a first level. Once I have a complete level I can finetune the gameplay.

Will I open source this? Currently not, there are a few people that I know personally who have access to the source code but the repository will remain private for now. Why? because I’m thinking about making this my first paid app (with a free, ad containing version) on the WP7 marketplace. If I get completely stuck I might get some other developers involved, but for the time being I will remain the only developer.

Can I give more information about the story or setting? I probably could Glimlach but I won’t for now, I’m going to build up the hype meter for this project so that everyone will want to get it and I will get rich. Once I’m rich I can start up my own game developer studio, create Version 2 of this, get even richer, buy EA and finally get them to make decent games again. Then I’ll probably wake up and realize this was all a dream.

Should you be interested in following my project, please follow me on Twitter (@NicoVermeir) for daily updates or stay tuned for weekly updates on my blog.

PS: I’m going on holiday from June 12th until August 1st so there will probably be little to no updates in that timeframe.


Tags:

.Net | WP7 | WP8 | Windows programming | XNA | Game development

slides and demo for my WiPhug talk

by Nico

Yesterday I did a talk in the Belgian Windows Phone User Group about beginning XNA development. It was the first time I did a talk in my own user group and I had a great time.

I also learned a very valuable lesson: don't name your Autohotkey snippets the same as your classes. It was quite the hilarious moment when I entered the class name in the "Add File" dialog and hit the Enter key.

Besides that small setback everything went great. The slidedeck and demo (shooting iphones down with a pink magenta Lumia) are zipped up and can be found here.


Tags:

.Net | Devices | WP7 | XNA

BlockAddiction V2.0 online now

by Nico

Version 2.0 of BlockAddiction has passed marketplace certification and is available for download now. The biggest change is the all new Time Attack mode where you have to survive for 60 seconds and score as high as possible. Game Over means no score.

BlockAddiction has reached well over 400 downloads and is available on Windows Phone marketplace (Link).

I was thinking about an About page and advertising but I figured ads could ruin the experience and I completely forgot about the About page. Glimlach I might add it in the future but for now my focus shifted to some other projects.

If you’ve got ideas, bug reports or some other feedback, leave a comment, contact me via Twitter or send me a mail!


Tags:

XNA | WP7 | .Net | Devices

Techdays Belgium 2012

by Nico

So Techdays is right around the corner and I’ll be attending for the third time.I’ll be attending all kinds of sessions going from Windows 8 development to the complete deep dive track on web to my favorite subject, Windows Phone 7 development. I’m also excited about the Scott “The Gu” Guthrie doing the opening keynote and doing a session the second day. Also presenting this year is Laurent Bugnion, the father of the awesome MVVM Light framework.

Here’s the list of sessions I’ll be attending, this list is subject to change depending on if I change my mind the last minute, as I’m known to do sometimes Glimlach.

Tuesday February 14th

  • Opening keynote with Scott Guthrie
  • Welcome to the Metro Application Platform
  • Windows Phone Fast App Switching, Tombstoning and Multitasking
  • The Future of C# and Visual Basic
  • Devices + Cloud: Using Azure on iOS, Android, Windows Phone, …

Wednesday February 15th

  • ScottGu unplugged
  • Take a ride on the Metro
  • The zen of async: Best practices for best performance
  • MVVM Applied: From Silverlight to Windows Phone to Windows 8
  • MVVM & WCF RIA Services: an architectural story
  • Building a data intensive application

Thursday February 16th

This is a deep dive day, I’ll be following the web track that focuses on what’s new in ASP.net 4.5 and Visual Studio 11

 


Tags:

.Net | Presenting | WP7 | Windows programming | XAML | XNA | Web development | MVVM Light | Devices

BlockAddiction: My WP7 XNA game

by Nico

On 8 January my very first game was published to the Windows Phone marketplace. It’s a very simple game called BlockAddiction, the purpose is to keep stacking the blocks on top of each other while they keep speeding up. Now, 19 days later I’ve reached over 250 downloads with this. It may not seem like a lot but I’m pretty pleased with the result Glimlach

Right now, I’m working on version 2.0 and it will include a new game mode and some changes:

  • Time Attack mode: stack as many blocks as possible within 60 seconds without dying (player has 3 lives)
  • About page
  • Maybe some ads but only on the menus, I want the game experience to remain the same and completely ad-free

Time Attack mode is almost complete, just have to develop the difference between time up and game over. Then I need to find out how to add an about page to an XNA game, but more about that later.

For those who want to try out the current version of BlockAddiction, search for it on the marketplace or click here!


Tags:

.Net | WP7 | XNA

Building a game menu and loading screen in XNA

by Nico

I’ve spent a lot of time searching for a way to get menus and loading screens working in XNA. XNA has no controls like textboxes and buttons like we’re accustomed to in winforms, ASP and so on.

So after searching and only finding half working solutions I decided to share the way I do it with the community.
The result is a five page guide and a link to my solution

Click here to get started!


Tags:

.Net | XNA

  Log in

About the author

Hi,

My name is Nico, I’m an MCP living in Belgium.
I’m currently employed as a consultant in the Mobile Solution Center at RealDolmen, one of Belgium’s leading IT single source providers, where I focus on Windows Phone and Windows 8 development.

I'm also founding member and board member of the Belgian Metro App Developer Network, a user group focussed on Windows 8 and Windows Phone development. If you're in Belgium feel free to drop by if we're doing an event. http://www.madn.be

Since June 2012 I'm a proud member of Microsoft's Extended Experts Team Belgium. And in February 2013 I became a member of DZone's Most Valuable Bloggers family.

This blog will be about Windows Phone 7, C#, XNA , WPF, Silverlight, and much more!

I hope to get feedback from my readers either through comments, mail (nico_vermeir@hotmail.com), twitter, facebook, …

 

 

MeetLogo

 

MVBLogo

mybook

 

mybook

 

Month List