Wizards came alive with our adventure game “WD” 🧙‍♂️

Applied Computing Foundation
6 min readFeb 16, 2023

--

The Journey of Wizard Dungeon — “Two ACF Pygame wizards’ irresistible and enigmatic story that you would have never heard before”

Team Started on: September, 2022

About the Developers:

Neil Nabar:

I first started my coding “career” when I was six years old, programming using the block coding tool, Scratch. My father then taught me basic javascript, and I created simple programs such as rock, paper, scissors. After this, there was a while when I stopped coding. When I was about eight, though, I first heard of the coding language, “python”. This sparked my interest, and so my parents enrolled me in a multiple month long course called CTY for coding. Once I completed this course, my knowledge of python was greatly increased, and I realized that I wanted to continue using python. Over the next period of time, I took many smaller camps and courses on python. Then, in the summer of 2022, I started my next large venture into the world of coding. I took classes with my instructor, Coach Izzy, and we mainly worked on implementing classes into python. After this, I wanted to continue by learning the visual gameplay aspects of python, so I joined a team that included Coach Izzy and Jayden. We worked on creating a game using the Pygame module, and also a new coding software called Pycharm. Below is a screenshot of a roman numeral translator I coded:

Jayden Choi:

I first started coding on scratch.mit.edu when I was seven years old and created a lot of games such as a ball juggle, a dodge runner game (I guess?), my personal favorite, the bomb fall (with a hard version), etc. At age eight, my mom enrolled me in classes every Wednesday where I learned about Pygame and turtle. Ten months later, I was told I was to join another student (who is Neil) and use Pycharm which brought us here after five months of coding.

The Story & Background:

Level 1 & the Reason of the Game:

Once you hit play, you should be sent to the plains where you get a hang of the controls. Then, you go to the mountains to practice sharpshooting. After that, you get a cutscene in which after you fight your first boss. The reason for this game is that you are an apprentice. Your mentor’s source of magic is then suddenly taken! Now you must make your journey to reclaim the source.

Level Two Gameplay & the Second Part of Our Story:

After the boss in level one is defeated, the player transitions into the second main phase of the wizard dungeon saga. Level two mostly comprises of four major “scenes”, and also three other minor scenes, including a cutscene and tunnel scene. This level is based as a dungeon maze where the player must navigate multiple labyrinths thats’ exits are guarded by ferocious enemies, including spiders and minotaurs. Along the way, the player will gain spells, defeat powerful foes, and explore new areas.

This is an image of one of the dungeon scenes, the “dark tunnel”.

Code & Images:

Level 1 Images and Code as well as Player Objects:

Level 1 is made of images we design on Piskel, rectangles from “pygame.rect”, and the code that makes it all happen. We load the images (a.k.a. “pngs”) into the code with “pygame.image.load” and then we use “pygame.transform.scale()” to change its size to whatever we want it to be. Then we can finally “screen.blit()” it to the screen to make it appear. For the player controls, we made the left and right just affect the x value. The jumping though, was a bit harder. We had to detect if the player was in the air, and then see if the up button was being pressed. The collision code was harder. We made a variable “player.grounded” to see if we were on the ground. We gave the player a bounding rectangle so we are able to detect collisions. We then added collisions for from under, above, left or right individually.

This picture shows the code for moving the player around.

Images & Code Regarding Level Two and Spells:

In level, there are a variety of images, including all the scene backgrounds and many of the items. We first design a draft of the image we want in a pixel drawing tool called “Piskel”. Then, if needed later on, we revise the draft to better fit our needs. After we have a complete and finished image, we download the image and place its file in our game folder. This makes it ready to use code-wise. Now we use the Pygame built-in functions, “pygame.transform.scale” and “pygame.image.load” to create a good size for our image. Finally, we can use “screen.blit” to paste the image onto the pygame screen — (screen in this case being “pygame.display.set_mode(width, height)”, which creates a basic screen).

Besides the images, the main code topics are basic variables, enemy spawning, dungeon platforms, player pos, player functions in each scene, and the driver code, which is what runs everything.

This is a pedestal that I created to hold a scroll that increases jump height.

This is a snippet of the code that is used to load images into pygame.

Spells:

The primary method of combat in our game is using a wand and spells. We thought that long-ranged fighting would be more interesting to code. We first created a starter wand and a few basic spells, such as fire and ice. Then we added stats like speed, damage, and damage multiplier. Finally, we coded the wand-to-enemy firing mechanics so the spells could be used. Later on, we also added more advanced spells and wands, such as the “Medium Wand” and poison spell. To make it easier for the player to see what spell they are currently using, we also made a mini version of the selected spell appear on the top-left corner of the Pygame screen.

This is an image of the medium wand that you acquire in level three.

This is a snippet of the code we used to create spells.

Future Goals we Hope to Achieve:

One future goal that we would like to accomplish is finishing level three. The basic idea for level three is an escape room, in which the player must defeat enemies and bosses to earn keys that will unlock vaults that allow you to pass through a blocked door. In this level, the player will also face more powerful mobs such as the zombie and vampire. To make the level fair, the player may also pick up overpowered loot and gear in the form of mob drops. Along with these new features, level three will also have the basic qualities of a level including platforms, spells, and more!

Another future goal we hope to achieve is level 4 which includes a (spoiler alert!) spider, vampire, zombie, and a new skeleton. It will also introduce lava to the game which will kill you instantly. You can also get a new spell to heal 100hp but only once until the next level. The jump boost spell will help as there are bigger jumps so don’t mess up your platforming.

This is our logo — (WDG stands for Wizard Dungeon Game).

Thank you for reading and please follow our weekly progress at https://www.linkedin.com/in/wizard-dungeon-13a225250/

and here is our presentation to another ACF Pygame team(Block Buster) during our season 1- https://vimeo.com/769753954/b890e26b89

--

--

Applied Computing Foundation

Develop mastery in technical and collaborative skills; Empower young leaders to drive change in communities