The Final Product

Before I get into this post I just want to say that this post is sort of a continuation of a previous post I’ve made and I suggest you check that out if you haven’t yet. In case you don’t want to read that long article, in short, in CSAI class, we were tasked with coding maze games. I made a game in which you explore a dungeon, find treasure, fight monsters, and buy upgrades to try to defeat the final boss. Now, onto what I’ve been working on since.

After finishing the coding for our games, we began making controllers for our game. Everything we needed was given out and after being shown how to make the mechanical parts of the controller, we began construction. We started off with a practice controller. We just used a flat piece of cardboard and a plastic box to put it on top of. I continued by cutting out and putting buttons into the cardboard to use as controls. I then began making wires with which to connect the buttons for the Raspberry Pi which I was going to be using to play my game on. To make these wires I took off one end on two wires and connected them using electrical tape. Then on another end on one of the wires I connected a terminal so that the wire can plug into the buttons.

After finishing up with all the wires I connected the Raspberry Pi to a monitor and a power cable. The pi connected and at first everything seemed to go well but once I stared connecting the wires from the buttons to the pins in the micro bit, everything stopped working. To this day I’m not sure why.

My teacher, Mr. Dembo, gave me a new Raspberry Pi and after I connected everything to the new Pi, the buttons started working.

The prototype was complete and I began work on the final design. I used a regular box for the controller and I went through the same steps I had gone through for the prototype, though this time I didn’t need to make new wires as I could use the ones I’d made earlier. I put in the buttons, connected the wires and tested that everything worked.

The buttons, to my delight, worked first time and it was amazing to play a game that I had coded on a controller that I had made. To be honest, this is one of the first mechanical projects that I’ve made which have worked just as intended, so yeah, it felt pretty cool playing on the controller. All I needed to do now was to make the controller look better. I connected the Micro Bit to the side of the box using wires to make it accessible and covered the box with purple construction paper and an image of the hero character in my game. Here’s the result:

Anyway, this was a big project and I’m quite happy with the result. Hope you guys enjoyed this blog post, bye!

The Maze Of Myths

In CSAI class, we were tasked to create a Maze game based off of one of the subjects at school. I chose to make my maze game based off of math and I began to brainstorm ideas for my game

The first thought that came to my mind was making a game in which a character traveled throughout a dungeon, slayed monsters and bought upgrades. I loved the concept and began expanding on it. I decided to make the player character and all enemies geometric shapes to tie the game into math. Every time a monster was damaged it would become the regular form of a shape with 1 less side than it. For example, hitting a square creature once would turn it into a triangular one which would maybe move at a faster speed, but be smaller and therefore it would need to get closer to you to hit you.

I also thought that the game would probably end up being to hard if the only way to earn coins was by killing monsters, so I added chests to the game. These chests would be scattered throughout the maze and when found would give you lots of coins to buy upgrades with.

I’ve been talking a lot how in my game players would kill monsters, but I haven’t explained how fights work. Monsters, when you get close enough, start chasing you. If they touch you, you lose a life, but you have an attack. By clicking the button B, the player character becomes temporarily immune to monster attacks and will hit every monster it touches while the attack is going. I know it might seem like it would be too easy to defeat monsters this way, but trust me, it’s not. The fact that most enemies have multiple lives forces you to have to hit the monster and dodge out of the way before your attack ends or the enemy will end up hitting you back. Also, attacks are short and reload only every couple of seconds so you have to hit the monster quickly or you’ll have to wait another couple of seconds to strike again. These factors combine to make battling monsters more than just a little bit difficult.

The last part of the game that I needed to think of, was how to purchase upgrades. I was considering having some sort of button that you can click to lead to the store, but that idea had a couple of problems. pausing the game at any time could be a big advantage to the player as they could pause the game by entering the shop, think up a plan, and then unpause the game and enact those plans. The player should have to make choices on the spot and not be given time to plan.

The other reason I decided against this concept was because I thought it would fit more with the game that I had so far planned if there was a shop somewhere in the maze and to purchase upgrades, you would be forced to explore more. So I settled on the concept of a shop in the maze where you can go to spend coins.

Now that I had the planning out of the way, I started coding. I came across my first problem quickly. To confine a player to stay inside a maze using the a sprite as the maze, the maze would have to destroy the player when it touched them as there was, to my knowledge, no way to stop a character from going through another sprite.

I found the perfect solution to this problem in a tutorial. I discovered something called a tile map. A way to easily create a maze and define where walls would be. This was perfect as it allowed me to stop the player from walking through where walls should be and didn’t force the player to have to avoid the walls to survive. I used tile map to draw tons of custom tiles and designed the map, which I, in the end, was very happy with.

The next problem I encountered was with enemies chasing the player. I couldn’t figure out a way to have enemies chase the player only if the player came within a certain distance of the enemy. My teacher, Mr. Dembo, helped me out with that problem. He suggested that I should have the monsters start chasing the player when the player stepped on a tile in the map that was near the monster. I created a couple of new tiles that were very hard to tell apart from the normal floor texture and positioned them around the maze near monsters. I coded it so that when the player walks over one of these tiles, a nearby monster would start chasing the player.

The last problem I came across had to do with coding the store. I tried using ask dialog blocks to ask the player for yes or no multiple times for whether or not they wanted to buy a certain upgrade. That turned out to be a tedious process for the player to go through every time they wanted to buy and upgrade. After a lot of thinking and looking over the dialog block tutorial Mr. Dembo had sent me. I realized that I could use the “ask number block.” I coded it so that the player chose a number, each number representing and upgrade that as shown on screen, and then a variable was set to the chosen number. Then, depending on what number was chosen and whether or not the player had enough coins for that upgrade, the player would receive the chosen upgrade or if they had too few coins, would not get the upgrade.

Now, without further ado, you can try out my game for yourself!

FLEE FROM FISH (My First Game on Makecode Arcade)

In CSAI class, we are starting to program on makecode arcade, and, after a quick tutorial to introduce everyone to simple coding on this site, I got to work on a game.

The tutorial showed the coding to make a game in which you control a character and try to collect pizza’s, which, after they are colected, teleport to a random location and you need to catch it again.

The basic idea for my game is similar in that you are a fish and are chasing fish food, but the catch is that, chasing you is another fish. You need to catch the fish food without becoming the fish food of the other fish chasing you.

But the game gets harder once you have collected 5 fish food. Every 5 seconds or so, an obstacle appears and if you crash into it, you lose the game.

Making this game introduced me to all basic blocks on Makecode Arcade and taught me how they worked and why some combinations of blocks might not work.

I ran into a lot of problems while making this game. Originaly, I wanted new fish to appear and start chasing you after a certain amount of seconds. A problem arose though, as, after the set time passed, fish began repeatedly appearing instead of just one being spawned.

I attempted to use variables to make sure just one appeared by increasing the variable by one when the set time passed and creating a fish to chase you when the variable is increased. That sadly, did not work and, after trying to figure out why for some more time, due to the limited time frame for making this game, I decided to scratch that idea and think up something new to make the game harder as you got farther into the game.

That is when I came to the idea that is being used for this game. I added obstacles such as rocks and nets which would only start appearing after you collected five fish food.

Now that you’ve read about my game, you can try it out (P.S. you control the fish with arrow keys)!