When code blows you a raspberry, make Jam

They don’t move at the moment, but the program sees the input…
So things started out well for me. I came up with a decent idea out of the gate: You play as a group of neanderthals, the Stone Age evolutionary also-ran competitor to Homo sapiens. Using Civilization-style turn, movement and combat mechanics, you’re given an increasingly hostile environment you will inevitably succumb to the forces of natural selection against the better-equiped Homo sapiens, so the goal is simply to survive as long as possible. Play continues either until you run out of food and starve (prey animals like mammoths wander the map) or are killed off. I knew I don’t have enough coding experience to be able to pull off some of the fancy mechanics other people are doing, so contained within one map, this seemed doable.
Well coding experience still bit me in the ass. Here’s how things have gone down so far:
6 pm: LD Starts.
8 pm: Decide that I have a good enough sense of the mechanics that I can at least start writing code, so fire up the python editor and lay out the basic Pygame framework, some sprite classes. Look on the web for advice on making tile-based maps which I haven’t done in my practice.
9 pm: I’ve thrown together some stick-figure placeholder graphics and decided to go with random map generation that I can fine-tune later. Hello 2d arrays, my old nemesis.
12:30 pm: Victory! My map generator is working, and can translate grid coordinates into tile placement coordinates. I’ve earned myself some sleep.
4 am: FFFFFFFFFF- This sleep thing isn’t working out well tonight. Pull down some podcasts to in an attempt distract my brain from the fact I can’t sleep.
6 am: Damnit, this isn’t working. Make a pot of oatmeal for early breakfast.
6:3o am: Eating the oatmeal had made me sleepy enough to fall over and actualy sleep somewhat
8 am: Wake up about when I had planed to. Make a pot of tea and open Photoshop to work on proper tile art until the left side of my brain wakes up enough to deal with code.
10 am: Ok, let’s try to get these neanderthal sprites working with turn-based movement.
2 pm: It seems I don’t really know how to deal with state management very well. My loops are spinning without regard for whose turn it is and aren’t receiving input consistently. I’m geting to the point where I’m starting at the screen for long periods of time without work.
5:30 pm: Wake up from a nap. My code is glaring at me defiantly.
7:30 pm: Talking through the current tangled mess that is my code with my boss suggests that my way forward is going to involve a lot of refactoring. Here we go…
11:30 pm: After a slow and tedious refactoring process I realize that one of my big assumptions about how Pygame, looping, event.wait() and the Clock() works was wrong, and suddenly my event handler is behaving, even if the refactored movement code doesn’t yet. By this point the lack of sleep has me pretty braindead and I know from previous game jams that not having my base code working by several hours ago doesn’t bode will for me finishing anything playable for the competition.
So in exchange for settling on going for the Jam deadline, I got a proper amount of sleep last night, for I knew without it I would only make myself miserable and even less competent. And being miserable defeats much of the purpose of doing LD in the first place.
With a clear head now, once more into the breach!