About peeweek

VFX Artist and hobbyist coder


Ludum Dare 31

peeweek's Trophies

peeweek's Archive

Finally!!! My first compo : Through the Windows

Posted by
Sunday, December 7th, 2014 5:17 pm

/!\ WARNING : tl;dr INCOMING /!\


Finally! I’ve made It! This is my first LD entry, and my first compo. I was quite anxious since I hadn’t really completed a project alone in such a short time period, but I guess I tried to make It right in the end. And now i’d try to make, as everybody else…


Here in France, the subject was delivered at 3AM and I discovered when I woke up at 10AM with joy that this snowman rascal wasn’t elected at all *JOY* *JOY*. After a morning of shopping and cooking, I started to think about this subject that was clearly an invitation to create a rectangle area and throw a crateload of gameplay inside of It. At first I was confused because the subject would lead to simply abide by the rules. I tried to think about this rectangle area that we call screen, and in the case of a windowed game, this window is just a portion of a larger screen. Then eureka, the idea was born : use that window to reveal a portion of a larger screen, within the area of my main monitor.

At 4PM (around this time), I started a C# project using a previously installed monogame that I did not previously test. I really should have… I wrestled around one large hour because of my VS2010 being unable to create a content project.  Despair came poking on my shoulder, I slapped him hard then downloaded a XNA 4 as an emergency. Hopefully, no problems, and the project was started.

My first project hours were dedicated to create the backbone of the game, and the base classes in order to get graphics, animations, and input. I also added the basics of manipulating the game window, by creating a new windows every time a new room would be setup. Bad luck, XNA’s internal voodoo wouldn’t let me do the trick and I struggled around one more hour trying to figure why my new GameLoop exited at frame one >_<.

Despair poked again at my shoulder. I faced him, smiled and kicked his nuts. No way, I’m going to reuse the same window, bu updating the backbuffer size and manipulate the window as a Windows Forms C# Control. This is something I had tried a while ago by docking a XNA viewport inside a C# WinForms panel. The trick is really simple as you interpret the XNA Form not as a XNA.Window but as a System.Windows.Forms.Form, with flexibility unleashed.

The first night was going on, so I took an hour or two working on the Player Sprite and some of the Dungeon Walls and ground. I used quite rapidly to create the base classes for the animated sprites, and i derived from these static sprites as they can be interpreted as single-frame animations and save me time coding at the expense of some useless calculations. At this time I started to figure out I was going to write a ton of code to provide basic functionality to my game…. but whatever. Midnight passed and I started to code the room generation algorithm. I called it a day at 2PM, after succesfully creating a room, and implementing collisions.


The night was not so short, I woke up at 9AM, head full of hope since I ended last night with a positive note.  A pint of Coffee and I started to hack with the room extension algorithm. Everything went well until er… stuck on this rectangle bounding conditions and the Min/Max Size of the rooms. Dammit, I just thought this was a simple thing to achive, yet I was confused as every single attempt resulted in bugs, out of bounds indices. I spent two hours struggling again on this, writing and crinkling paper. Then I realized I only wanted to write a beatiful block of code that would solve every case beautifully. I ended up by creating a dirty, huge, unmaintainable, but fully working pile of crappy code, and promised I would never lay my eyes ever on It (and prayed for It to work eternally).  Then I took a break from 11AM to 2PM.

The afternoon was mainly to create enemies, assemble the game, and to evaluate what content was really useful to the game. I started playing around and I realized that the weapons I wanted to create at first were not necessary. The rooms were recorded in order to travel back, but as I disabled the recording, I found something interesting : I was thrilled to travel back and discover another room yet more dangerous than I imagined. I decided to cut the room recording and focus on the main concept of being unable to predict what would lie in the next room.

Around 5PM, I was playing around, proud that I could run my game without a crash, and without any blocker bugs. Then I realised the game did not have neither a goal, nor a game over. Then I started to think about simple goals that I could achieve in the late hours of the project. I added three variables to the game : player health, collectibles and difficulty. I assumed that the player would be unable to fight monsters but instead be able to escape them. As a progression I added a byte value that I incremented every room change in order to manipulate enemy stats (spawn count, velocity), and as a goal I spawned randomly crystals to collect. I started working on flames that would burn monsters, but no need, I created the graphics but never used them.

The problem is : the difficulty raises quite hard, that I kinda liked, but the crystal spawns were too sparse and increasing the rate would not be a good Idea, as the game sessions would be awfully short. Instead, I added a balancing for the player by adding randomly 1UP Hearts instead of crystals in some rooms. That would lead the player to take risks in order to extend its survivability. And so by tweaking the stats, the game was on. I struggled hard to finish a game (by chance I admit) , and decided that the balancing would do the trick, so you Hardcore players.

As I’m not a musician, I finally tried my best to create a simple layer of sound in order to sustain the improbable rhythm of the game. Using Famitracker (simple enough for the time left) and Audacity (in order to clean up the sound loops). I created really quick some short loops, jingles, and SFX. Hopefully the Low level Audio layer of XNA is simple enough to play loops and SFX so I did not struggle (even though I never coded a single line of audio in XNA). Finally the game was done. I gave the exe to my girlfriend in order to test It on some other PC, and I discovered It needed the XNAFX4 redist (pfew, included in the zip in time :))

Cool Story Bro, the game is Out. My first one. It’s really weird and hard, but Im proud of It.




  • The Collision Algorithm is not quite smooth as I wanted to, but I ended up assuming its functionality and its constraints (unability to glide around walls) as a difficulty challenge for the game.
  • I always want to write clean and beautiful code: and I waste often too much time. In the end, I ended up writing KISS but working code.
  • I did not start with a full goal, but with only a piece of concept that I wanted to improve on a experimental basis: this was quite a waste of time but could have been really wrong if I
  • As my friend Dralym asked me a minute ago : My game lacks dual or triple screen support, but did not have the time to hack around and detect exotic configurations :(
  • Not using Monogame for the multi-platform :( Ill try to port It later if I’m brave enough to dive again into this.



  • XNA Game Studio 4.0
  • Paint.NET / TileStudio
  • FamiTracker / Audacity


You can review my entry here : http://ludumdare.com/compo/ludum-dare-31/?action=preview&uid=45217
I have captured some minutes of gameplay and put It on youtube here : https://www.youtube.com/watch?v=giFm_z_PjY4&feature=youtu.be

[cache: storing page]