Hurrah Torpex! I remember the demo of this game Schizoid at last year's Gamefest booths..such a wild and different style of gameplay. Now you can get it on Xbox LIVE and make your brain dance in new ways :)
Those of you wanting to top When Cods Collide (and I hope you do!) please check out the 2D Game tutorial the amazing XNA Dev Edcontent team has produced!
The team is getting geared up for Gamefest (booth duty rosters being sent round) and just the general excitement of slide decks. <g>
Meanwhile our work to advance from beta advances. All during this blaze of sunshine which frankly I love, but tempts one away from work...
Live it vivid!
So I went home early today with a snoggy head cold...which gave me the perfect excuse to try out the beta code and the community games launcher. It's a bit tricky I admit - once you redeem the code, you have to go over to My Games Area, make sure you have XNA Creators Club indicated at the top and THEN hit the Yellow Y button for download...then automagically all this cool stuff shows up! It really is like being part of a secret club. (Thank you Michael Klucher for all your hard work on this part of the magic)
And scrolling down.....(there are actually more games as I put this post together, including Sumo...the photos are from earlier this afternoon)
Double checked to make sure the game classification was represented properly...hurrah for the Violence, Sex and Mature Content scores! (Thanks to Paul Tidwell for making that magic sentence happen).
Got the splash screen for Little Gamers after the download....
And away we go...I love rocket launchers.... I really do....
So, it all begins here. Writing a game that someday thousands of people will play on their Xboxes. Or, if you are more an armchair dev, helping other people fulfill their dreams by reviewing their game.
Http://creators.xna.com now has what you need to get started.
You can buy a creators club membership...which unlocks the special abilities to submit and peer review games.
Learn the guts of making a great game with guts...playtest at home with your friends by beaming the game to your Xbox.
Submit your game....recruit reviewers on the forums....
Use your creator code (on your profile)....to download the community player and play other people's games.
The team has busted butt to get this out to you- be sure to give us feedback on the connect site (you can file bugs and take the surveys there). Dave Weller has posted more details on the XNA Team blog.
(You know, I hate the long silences I have to observe before shipping something like this (Live QnA drove me nuts the same way)....such a relief to finally get to talk about stuff!)
Betsyedit: trying to get the datestamp to show up right.
....talk to Let's Kill Dave for more details! Can you say - changing the game on a Zune?
I had one afternoon and one evening this week with our beloved XNA MVPs and it really was a treat. Game developer MVPs are a different breed - they tell more bizarre stories on less beers. Ask George Clingerman about the mustache he doesn't have.
....I am eternally grateful to George for praising my cod game blogs btw.I need some undeserved praise once in a while.
Andy Dunn remainds himself. The Zman. Watch out when you go to his blog - somehow I ended up on a blog page with a Lane Bryant bra ad.
Nick Gravelyn had an interesting take on Seattle having come from Michigan where the buildings in his town were much shorter. Raised a glass with Catalin Zima and Michael Morton (Ziggyware.com)
I met a lot more MVPs - some DirectXish, some XNAish - and after a few gin and tonics, promptly forgot their names. That's why Dave Weller has the swanky job of organizing those kinds of events - my face/name memory is atrocious. :( Sorry guys!
At least we got to show them some sneak peaks of things we are working on and get feedback.
Also my new red streaky hair do. I have to admit, when my hair stylist got done, (she works at Vain which is no stranger to odd hair) she did step back and say...."Er, your workplace won't mind, will they?"
And I said, "Naw, I work at Xbox!" :D
Let's just say...it beats that magenta thing Charles Torres talks about in my Ch9 video. Though not sure how much it will fade if Seattle ever sees the sun again.
Bummer to see Dare go "unblogged". I respect his decision, but hope he will be back. He was an interesting voice, to say the least.
I fielded some questions recently about blogging and engaging an audience from a coworker in another team this week, and realized the awesomeness of time passing, if that makes any sense. I've been upfront about passing the tiara and all the projects I've worked on since being Blog Queen. I tried to set up my successors for success, and create resources for people to go to that can be advice, or other people. I remember when I first chatted with Eileen Brown about blogging..now look at her bringing entire companies together (and blogging about it).
People still ask me for advice, and I still care about this medium, regardless of what social or community app I have sunk my heart into this time. I will still yak endlessly, to whomever will listen, about the power of the conversation a company can have with its customers, when it is two-way, when it is real people talking to real people, when we are authentic. I'll say it if you are a VP, or someone I don't know from another team.
I guess it's ironic or perhaps just lame, that I myself am not a key blogger - "I'm no Scoble" (or Chris Sells, or Raymond Chen, or...). But I think it's been more interesting to enable the conversation than be it - I already know what I would say, what's wild and fun is what YOU would blog about. If Randy Pausch can have fun still, health-challenged as he is, then what are we waiting for?
The best is yet to come in the blogosphere.
Oh yeah - that not-blogging- thing I'm working on - XNA community games beta - ya, we are still plugging away at it. :) Long nights of Diet Coke and Red Vine. Sorta like Wine and Roses, only a ton fizzier. :)
Live it vivid!
Finally finally finally I get to blog about this. :) This is the team I am on you know - I am a pm for the community games team in XNA. But I've been so busy today at the conference, really other people are doing a better job of blogging it now.
:)
There are 3 parts to this blog post - the big community announcement, how you can get games you can play RIGHT NOW, and where developers can find out more about developing community games for Xbox LIVE at GDC.
Oh yeah, and I finally fulfilled a dream of playing Dishwasher with the creator, James Silva. Dean or Cyrus have the photo of the actual playing where I basically hacked randomly and James wreaked carnage.
Announcement
Dave Weller has a long blog post here:
http://blogs.msdn.com/xna/archive/2008/02/20/announcing-xbox-live-community-games.aspx
And there's more going on at the XNA Creators Club Web site:
http://creators.xna.com/whatsnew.aspx
I offer some photos....
Chris Satchell, below, talks about opening up the Xbox to community games.
The initial list of community games is:
• The Dishwasher: Dead Samurai (I played this at Gamefest and could not stop)
• JellyCar ( I loved the sound effects of this game - squishy and addictive)
• Little Gamers (much carnage with cute characters from the Web site)
• Proximity HD (This game got Dax addicted)
• Rocketball (great multiplayer game - met them at Gamefest - playtested with friends and pizza)
• TriLinea (the one game I have not played yet)
• Culture (if you like flowers you will like this - non violent)
How to get community games now is in the FAQ posted here: http://forums.xna.com/ShowThread.aspx?PostID=46554
If you are a visual person, Major Nelson and Michael Klucher show you in video format how to get the community player and download the games:
http://www.xbox.com/NR/rdonlyres/29B2AC5C-DB2C-4A6E-81B8-2AB3C59E509F/0/vidgdcxna001lo.asx
For GDC-goers, the breakout sessions about community games (Albert Ho and Dax Hawkins presiding) and the Zune announcement (which Michael Klucher is speaking on) are tomorrow afternoon in room 3002, Moscone West. They will have additional info not present in the FAQ or other locations. More to come!
Live it vivid!
This is what the conference center looked like on Sunday before I got my badge. It looked the same after, except with a tinge of relief. :)
This is the mysterious shroud Joystiq is talking about. I like my photo better than theirs.
My photos are going to probably run a day or so behind until I get the hang of this conference. Julien and I are wandering the Indie Game tracks for two days til the main conference starts and the rest of the crew are doing talks, setting up stuff for later in the week.
I want to give a shoutout to the kind people who chatted with me today about game development from That Game Company, Gastronaut Studios ( who gallantly claimed I don't drool when I sleep on planes) and the Gameinvest folks from Portugal who shared their table when I was In Need. Thanks all!
It launched on Nov. 15,2000 by a hardy team of renegades.It was the first .NET site built by Microsoft and its first .NET community site.
I joined Microsoft while Gotdotnet was in its fallow period (2003). But Gotdotnet survived, and thrived, even while technically neglected. It got a new lease on life in 2005 when Sandy Khaund gave me the chance to bring it back.
We did it. Even Scott Hanselman agreed. :)
Meanwhile, Jim Newkirk and the folks worked on honing Codeplex with a triumphant launch in 2006. Codeplex took the Gotdotnet collaborative development environment one further (see Channel 9 video. )
With the advent of Codeplex, folks expected Gotdotnet to close fully in the summer of 2007. So did I. :) But while I was fooling around with Live QnA and the Cod of Conduct, and then joined the XNA team - Gotdotnet was still needed.
Today however, Jim IMed me cause he figured I'd want to be one of the first to know what happens when you try to go to www.gotdotnet.com now.
Jim worried that I'd be unhappy ( for various reasons, which I'll get to in later blog posts next week, I won't be able to attend Gotdotnet's goodbye party). But actually I feel good that the Gotdotnet community of developers has found good tools and a home in Codeplex and CodeGallery - they are being looked after. You can't do any better than Jim's crew.
The thing that's funny is, (aside from the fact that all the links to photos I hosted there for my early blogging efforts are now broken :P) ----well...it's weird like a phantom limb...but I don't quite believe it's gone. That is, I know the URL doesn't resolve, but I irrationally feel in the back of my mind somehow, someway, It Will Be Back. It was so very very hard to kill. You know what I mean? Some Web sites have a life of their own, even if they are just in memory.
And also... I have another Web site on my mind, http://creators.xna.com . I hope to hear more and learn from its developer community this year. Right now, all I can do is make 2D cod games. :)
Live it vivid!

In previous posts you've seen me walk you through and discuss the XNA 2D Collision detection sample. I've been taunting you with screen shots of the goofy little 2D Windows game I made called "When Cods Collide" based on that sample...now, I need to come clean on the crude and simplistic methods I used to make the game a bit different from the sample. Note disclaimer on side of blog before trying this at home. :)
( If you want elegant code, as I mentioned, talk to Shawn.)
Here I tackle:
- Changes in movement (cod and martinis)
- Changes in textures (cod and martinis)
- Adding audio
- Adding text
- Adding score that only ever goes up
- Other tips
While I changed the names of some things, I kept some the same as the Rectangle sample so that you can see what I morphed to my own purposes. For example, I don't have a cod object - I left it as person. Likewise, the martinis are still "blocks" according to the code. Only their textures have changed.
Movement changes...up and down
Since the previous post left you thinking about how the random blocks fell on the person's head, I will start first on how I modified the falling blocks code in order to make the martinis "rain" across the screen.
// Spawn new zooming blocks from the side
// have them fall diagonally
if (random.NextDouble() < BlockSpawnProbability)
{
float y = (float)random.NextDouble() *
(Window.ClientBounds.Height - blockTexture.Height);
blockPositions.Add(new Vector2(-blockTexture.Width,y ));
// I can have random x and y to start with
float x = (float)random.NextDouble() *
(Window.ClientBounds.Width - blockTexture.Width);
blockPositions.Add(new Vector2(x, -blockTexture.Height));
}
In order to set this up to work, under GraphicsDeviceManager graphics section I put...
// Cod
Vector2 personPosition;
const int PersonMoveSpeed = 5;
// Drinks
List<Vector2> blockPositions = new List<Vector2>();
float BlockSpawnProbability = 0.005f;
const int BlockFallSpeed = 7;
Image changes
To make things look different, even though the class names were kept the same behind the scenes (blocks, person) I loaded different textures under the protected override void LoadContent() section ....
// Load textures
blockTexture = Content.Load<Texture2D>("martini2");
personTexture = Content.Load<Texture2D>("cod_image2");
Safety Zones
I didn't talk about this much in the rectangle sample blog posts, but there's a section of the code that keeps the objects/sprites contained to an area where they are visible to the player. I had to change the code so that wherever there was an x-direction capability, y was also represented. So under base.Initialize()....
// Start the player in the center along the bottom of the screen
personPosition.X = (safeBounds.Width - personTexture.Width) / 2;
personPosition.Y = safeBounds.Height - personTexture.Height;
Later I change the bounds of where the person (or cod) can move . So I add, under protected override void Update(GameTime gameTime)
// Prevent the person from moving off of the screen in X direction
personPosition.X = MathHelper.Clamp(personPosition.X,
safeBounds.Left, safeBounds.Right - personTexture.Width);
if (keyboard.IsKeyDown(Keys.Up) ||
gamePad.DPad.Up == ButtonState.Pressed)
{
personPosition.Y -= PersonMoveSpeed;
}
if (keyboard.IsKeyDown(Keys.Down) ||
gamePad.DPad.Down == ButtonState.Pressed)
{
personPosition.Y += PersonMoveSpeed;
}
// Prevent the person from moving off of the screen along the Y axis
personPosition.Y = MathHelper.Clamp(personPosition.Y,
safeBounds.Top, safeBounds.Bottom - personTexture.Height);
Adding Audio
It took quite a few MSDN articles to get me through this part. I used :
How To: Add a Sound File to Your Game Using XACT
http://msdn2.microsoft.com/en-us/library/bb203879.aspx
And also...
How To: Play a Sound
http://msdn2.microsoft.com/en-us/library/bb195053.aspx
In terms of tips in setting things up to play audio, I found that the first article sets up a folder/asset structure that you need to scrupulously follow. In other words, you must have an audio folder inside your content folder and your .wav and .xap files go into that folder.
At the very top of your game file, right after you setup the GraphicsDeviceManager, setup your audio objects...
public class Windows_Cod_CollisionGame : Microsoft.Xna.Framework.Game
{
GraphicsDeviceManager graphics;
// Audio objects
AudioEngine engine;
SoundBank soundBank;
WaveBank waveBank;
Next you will see I named the xact file project after the cod. You need to end up with an xgs file, a xsb file, and a xwb file when you are done with the audio tutorials. Below I put in "YourWavFileName" for the name of the wav file - that name needs to change depending on what music you want to use.
Under
base.Initialize();
Put
// Initialize audio objects.
engine = new AudioEngine("Content\\Audio\\codsoundxact.xgs");
soundBank = new SoundBank(engine, "Content\\Audio\\Sound Bank.xsb");
waveBank = new WaveBank(engine, "Content\\Audio\\Wave Bank.xwb");
// Play the sound.
soundBank.PlayCue("YourWavfileName");
In this case, I checked with my friend Clark (aka "Mad Malcolm" for permission to use his song in my game. If you wanted to use this song or any other song from him, you'd have to ask him for specific permission first...same with your favorite song from another band -- unless you write the song yourself, you need to get permission from the person who wrote it.
Adding Fonts
Fonts are another tricky area of game development because yes, other people own the rights to those fonts. Fortunately XNA provides some free ones for use in your games.
I had to use yet another tutorial to make words appear in my game; I added Kootenay as my font. Spritefont drawing is an interesting science and frankly, I didn't master positioning entirely. But at very least the score and the title/music credits appear in the cod game.... I was able to get the letters and numbers to appear. A key resource for this was the article...
How To: Draw Text
http://msdn2.microsoft.com/en-us/library/bb447673.aspx
So what does my code look like for displaying the text?
In the load content section I added this to setup the assets for a "Victory message" when the cod and martini collide:
//load font and what's in that second string
Font1 = Content.Load<SpriteFont>("Kootenay");
VictoryMessage ="Victory";
//center the string
FontPos = new Vector2(graphics.GraphicsDevice.Viewport.Width / 2,
graphics.GraphicsDevice.Viewport.Height / 2);
To actually make something appear, after Sprite spriteBatch.Begin();
I put.....
// Setup a string called output for the VictoryMessage
string output = "";
// Find the center of the string
Vector2 FontOrigin = Font1.MeasureString(output) / 2;
//draw the string for the score
ScoreFontPos = new Vector2(graphics.GraphicsDevice.Viewport.Width / 10,
graphics.GraphicsDevice.Viewport.Height / 10);
spriteBatch.DrawString(Font1, "Your score is " + score, ScoreFontPos, Color.PapayaWhip,
0, FontOrigin, 1.0f, SpriteEffects.None, 0.5f);
ScoreFontPos = new Vector2(graphics.GraphicsDevice.Viewport.Width /6,
graphics.GraphicsDevice.Viewport.Height/200);
spriteBatch.DrawString(Font1, "When Cods Collide... Music By Mad Malcolm Productions", ScoreFontPos, Color.Honeydew,
0, FontOrigin, 1.0f, SpriteEffects.None, 0.5f);
Scoring
There are several places you need to update, to keep score. You added a font and set up the place where the game will display the value already. Now, you need to add the part of the code that does the math and keeps track of the collisions so that the cod can earn his martini points. First, I set up the score variable, right under where I set up my audio objects...
//keeping score
int score=0;
In the section of the program where sprites get drawn, I added the below chunk of code to show the score. You may remember it from the rectangle sample where the screen turns red if the person is hit by a block; in this case, we start tallying martini goodness as well as change the screen color (screen color changes, I kept the same):
//Change when the cod hits the martini
if (personHit)
{
device.Clear(Color.Crimson);
output = VictoryMessage;
score = score+1;
// Draw the string for the victory message
spriteBatch.DrawString(Font1, output, FontPos, Color.AntiqueWhite,
0, FontOrigin, 1.0f, SpriteEffects.None, 0.5f);
}
else
{
device.Clear(Color.CornflowerBlue);
}
You will notice that I setup the score to always rise. This is of course because I want my game to shine sweetness and light upon the player, rather than give them demerits. If there was some action where the cod could lose score (maybe by bumping into an obstacle) I'd have to create code that sets up a scenario where score = score-1 .
Cleanup and -- don't do what I did when naming things!
So making the above changes - assuming you loaded the new music and new textures - should be enough to make "When Cods Collide" run at least inside Game Studio. If you want to share the game with other folks, you have to pay attention to a few other things.
When I originally wrote When Cods Collide I only had the Windows platform in mind and I coded directly into a copy of the Rectangle sample. This was A Bad Thing in that there was a bunch of other housekeeping I overlooked that messed me up when I wanted to share the game.
One, was that I decided the game needed to be called "Windows Cod Collision." This meant I had to change references inside of game1.cs
namespace Windows_Cod_Collision
{
/// <summary>
/// This is the main type for your game
/// </summary>
public class Windows_Cod_CollisionGame : Microsoft.Xna.Framework.Game
Whereas before it looked like:
namespace RectangleCollision
{
/// <summary>
/// This is the main type for your game
/// </summary>
public class RectangleCollisionGame : Microsoft.Xna.Framework.Game
Going over to the properties folder in the solution, I changed assemblyinfo.cs from
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Rectangle Collision")]
[assembly: AssemblyProduct("Rectangle Collision")]
to...
using System.Reflection;
using System.Runtime.CompilerServices;