Nested For Loops, Quaternions and Multidimensional Arrays… OH MY!

ransomware profile cropped

Well actually, no quaternions. At least not this time. I just needed a third complicated sounding thing for the title. The other two are legit though. This week I began a new level with a puzzle. Worry not, player, you won’t have to be a rocket appliantist to solve it. But good God! It was a pain in the rear to set up.

So I’ll let you in on a little secret… Since you’re reading. This level is based off the concept of a certain type of malware called Ransomware. In real life, what happens when you suffer a ransomware attack, is that you basically get locked out of your computer by a nefarious piece of software. It won’t give you access to wares unless you cough up some coin (And even then, it’s not guaranteed you’re getting anything back). (Protip: cloud storage)

So anyway, I figured, what better way to start off a level based on ransomware than to lock the player out of it. Hence… the puzzle. Let me tell you something about puzzles. Solving them is hard, but making them is even harder. My original idea was to lock the level within a giant cube. The player would have to solve an orthographically projected rubix cube type puzzle, shot in 2.5D,  to gain access. It sounded great in theory, but when I tried to make it happen, my brain literally imploded… Literally. The only solution, of course, was to douse the poor think machine in alcohol so that it might expand back to its original shape, size, and contour.

After I regained my composure, I went back to the old drawing board and tried to cook up something that was actually within my abilities. For whatever reason, my mind went back to an old PS1 game that my dad, long ago, picked up for me one day from GameStop. A little game called ‘The Next Tetris’. Obviously, the game is based off the original Tetris, but it had an interesting mechanic where portions of a piece could fall apart and continue down, if uninhibited, to break lower layers.

So it began. With my thirst for conquest, I started to devise a solution in which I would replicate the old dinobot but with a new twist. Initially, I had the idea of pretty much making the exact same game, except you would have to go in four directions; down, right, up, left. (As opposed to just going down). I soon found though, that the game is pretty damn complicated to program… In come the multidimensional arrays.

Multidimensional arrays are not as complicated as they sound, but still, it was something I haven’t really dicked around with much before. (I’m guessing database programmers deal with them all the time though.) Anyway, I needed to make a grid. And that’s what multidimensional arrays are good for. (You make an array of objects, and each one of those objects has its own sub array). I could bore you with the details of setting up the grid and making the game, but honestly, all you need to know is that it’s a lot of ‘for loops’. You know… for(int i = 0; i < x; i++){//do derp} type of thing.  Again, I won’t bore you with the details, but I just want you to know that I put in a 15 hour day on Monday. On hour 9, I realized I completely fucked up and basically had to start over. I just wanted you to know that.

Anyway, the puzzle is done, and I also modeled the boss for the level. Here here’s a sneak peek:




One thought on “Nested For Loops, Quaternions and Multidimensional Arrays… OH MY!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s