I moved to a new URL! Check it out!

posts dated from: december 2014

Moving the Console Window

Moving the Console Window
Just wanted to share a quick tidbit of code that's useful for making a game with a console window for debug information. A lot of times I want to launch my game and have the console window on a different monitor, or just out of the way in general. It gets super annoying to have to move it over every time I launch a game for debugging, but then I found that I can move it with programming!

I'm going to be honest and say I don't totally understand how this works. It uses DllImport to get some functions from the user32.dll in Windows and then uses those to move the window around... I think? It should be noted that this probably only works for Windows.
class Program {
static void Main(string[] args) {
IntPtr handle = FindWindowByCaption(IntPtr.Zero, Console.Title);
MoveWindow(handle, -700, 50, 1000, 1100, true);

Core.Game.Start(); // Start the Otter game
}

[DllImport("user32.dll", EntryPoint = "FindWindow", SetLastError = true)]
public static extern IntPtr FindWindowByCaption(IntPtr zeroOnly, string lpWindowName);

[DllImport("user32.dll", SetLastError = true)]
internal static extern bool MoveWindow(IntPtr hwnd, int X, int Y, int nWidth, int nHeight, bool bRepaint);
}

I use functions to find the console window by it's name which can be accessed through the Console class in .net, and move the window by its handle. I give it a negative X coordinate because that pushes it onto my left monitor, so now every time I launch the game my console window appears and immediately gets pushed over to the left monitor. Neat!

Doodle Post

Image

Doodle Post

Image

Dev Log: Board Game Stuff

Dev Log: Board Game Stuff
Work continues a little bit on a board game prototype with some local Phoenix developer friends. Dave ended up making some amazing tokens for us to prototype with which makes the game feel a billion times more fun. Every week we have a play test and it seems like we're narrowing in on something that's actually a playable game.

Image


We've been using Google Sheets and nanDECK to prototype and print out our cards, and then sticking them into sleeves along with Magic cards to play with. I think having a total break from making games with code and complex art assets has been pretty fun -- it's a totally different experience than making a video game, and getting better at board/tabletop game design is something I really want to work towards.

Image


I'll get back to my main project soon I promise! (but now holiday travel season is upon us and that puts a giant wrench in everything too.)

Doodle Post

Image

Dev Log: That Lost Feeling

Dev Log: That Lost Feeling
I feel like days are just flying by lately. What have I even been up to?! The past week or so has probably been a record low in the motivation department, and I have no good idea why that is. I guess it just happens. Sometimes I just end up feeling totally lost as to what I should do, or what I should be working on.

I'm working a little bit on a board game idea that some local Phoenix developer friends came up with, and I'm poking around at finishing my two player coop action game, but overall my amount-of-work-getting-done value has dropped off a lot, and the crazy thing is just a week or so ago it felt like it was at an all time high! I've been doing creative stuff and making games and whatever else for years now and I still don't understand how it all works.

Sometimes it just seems like every other developer or creative person on the planet has everything figured out and I'm the only one that totally drops off the face of the earth for weeks. (I know that's pretty hyperbolic, but I'm not claiming to be rational here.) When I get programming demotivated I start to draw more, and you'd figure I'd draw art for my games, but the problem is that for some reason that stresses me out, and so I just start to doodle what makes me comfortable instead.

I'm going to try just fiddling around with Otter to see if I can get a spark going again for programming. I think some of this feeling might have to do with upcoming travel which always stresses me out beyond belief. I wish I didn't freak out so much whenever I have upcoming travel, but I'm not really sure how to fix it!

Oh well, game development isn't all sunshine and puppy dogs and rainbows or whatever. Sometimes it sucks, and it's really depressing! But maybe it will clear up again soon.

On the upside I've been watching Handmade Hero and so far it's been pretty awesome. It's going to be a complete series on making a game from scratch. It's opening my eyes to a lot of stuff that I thought was just dark magic, and there are a lot of great programming and development tips scattered throughout all of the videos.