Posts

Of Screen Resolutions and Minimaps

Image
If you ever see the code for ABC-Pop (not if I can help it). You would soon became rationally angry at my design choices. And then, very soon - irrationally angry. In my previous post I wrote about camera-pan movement and render to texture functions in which I rendered entire level to a texture and then just rendered the camera view to the screen. Well, when I was developing ABC-Pop, I never knew about SDL_SetRenderTarget function (in hindsight, it's obvious) and I soon encountered the problem of handling my UI and game rendering for multiple resolutions. A sane mind would go on the net and search about handling UI rendering and game rendering against unknown target resolutions. Not me. I like to invent and discover stuff for my self. But sometimes instead of discovering hot water, you end up discovering piss. And that was what I did for ABC-Pop. So instead of heating water to boil, I pissed in the pan and called it hot. Okay, enough metaphors. I made my entire game work

Implementing Camera Pan in Critters

Image
Camera Pan Speaking about another thing I never paid attention to in my 2D game prototypes, camera movement and camera view ranks just around the top. Next to the UI. They're friends in fact. When implementing parallax scrolling and even when playing with the top down tiled based programs I coded, the idea of camera control was always there, but as my prototypes never did move above, well the prototypes phase, I never really needed a true camera view and control. Until I started playing with the Critters Level design that is. And the first design decision was: Levels will be larger than device max resolution. So no more cheating and moving level layers at different speeds, It's time for a serious 2D Camera implementation. So what does camera object needs to properly function? Not much as it turns out. It needs CameraView rectangle, UpdateCamera function, x and y relative to mouse motion and current level's width and height to make sure camera view stays in bo

Programming UI for Critters

Image
I never really thought about how UI is coded for games. For me, mostly working with OS level APIs UI was something that's handled by the OS and I just mostly put my controls on the provided IDE's canvas and code away - mostly. Even for fun, when making mechanical prototypes at home, UI was almost an afterthought. The most I ever made was maybe a start screen with a few buttons to start game or quit game. It worked fine for my needs and even when I started seriously working on ABC-Pop , UI was the last thing I started to work on.  Pretty much all the mechanics for the game was finished at that time. I mean, how hard can it be? Put buttons on the window, and when clicked, change something. Well, as it turns out it can be pretty fucking hard. I soon found myself entangled in 3 separate execution loops all firing different type events toward the main loop all juggling in my head and me trying to keep it all under control. And if you've seen the trailer for ABC-Pop you can a

Of Loot Bombs and Sticky Walls

Image
While you program, you create and form a thought and visualize it through a programming language. It's a beautiful and interesting process that is its own reward. But inevitably, this process will also create nasty little buggers called  bugs.  A flaws in thought, programming logic or simply an error while writing code. In the early Critters development, back in the dawn of time (few weeks ago). I implemented a Toolbar HUD element with a few Critters-Murder tools I wanted to test and play around with, with one of them being a grenade type weapon that player can drop on the little bastards. After timer is complete, the bomb grenade explodes with the satisfying destruction inside its radius. Critters die and spawn gems and ammo. Player collects loot and continues the destruction. All in all, often used but a proven little concept of blowing stuff up. Until loot pickup started spawning their own grenades - that is.  Now, I'm the first one in line for more Critter destruction,

Trouble in Qt Paradise

Image
I've spent more than a decade making professional commercial programs in Windows and MFC. Before that, I was working in now extinct Borland C++ Builder and VCL (I miss you old friend). Way back when, around year 2000, I had Linux as my primary OS installed (Mandrake - I don't miss you) and was testing different APIs to get a feel of programming GUI for Linux. At the time I had access to KDE and Qt. KDE was OK, but when I tested Qt, something clicked. Their entire programming paradigm just resonated with my programming style. And while KDE had more of the Win32 API approach, Qt was entirely different. And while KDE and Win32 at the time made me code message loops, in Qt, all was provided on more or less few lines of code. I think I made Tetris clone in Qt before ditching Mandrake for Windows. Fast forward a few years and I got my first job as a C++ programmer. Me being a self taught programmer I walked to work every morning with an ear to ear wide grin every day. After my tr

Critters is NOT a Tower Defence.

Image
The idea for critters originally came from the old DOS game called Chickens 2, by Brainchild Design. You can find the game here https://www.dosgamesarchive.com/download/chickens-2/. Chickens 2 by Brainchild Design I originally wanted to recreate this game for mobile platforms partly to practice mobile development and partly because it is a simple but addictive game design that is perfectly suited for Mobile platforms. Chickens come from left and right end of the screen and must not reach opposite end. Every time a player shoots, time decreases by a second and there is a chance for a gem to be generated from a dead chicken that increases the time by a few seconds. Simple and addictive. Few days later, and the first prototype was finished. It featured SDL for graphics and Box2D for physics. Critters, Prototype 1 But as these things go, I soon encountered the feature creep. The game was fine as is an was was ready for porting to Android. BUT WHY STOP THERE! And the sc