Final Project Report – Void ()


At first, I was pretty much clueless as to what to do for the final project. The idea to do a game came to mind while the others in class were pitching their own ideas. However, since this is Interactive Media, and not Computer Science, I wanted to showcase my hardware knowledge and build some level of interaction between my game and the outside world that doesn’t involve a keyboard. And, so I decided to build an external controller too, a simple joystick in a box. My initial idea was to create a button as well, but since Michael asked us to produce a simple take on our original idea, I decided to scrap the idea of including a button. 

The inspiration behind my game was essentially my childhood memories. Having grown up in the Gameboy Color/Advance generation, I was exposed to games from franchises such as Pokemon, The Legend of Zelda,  Dragon Ball, Dragon Quest and Final Fantasy. These games had very simple graphics, sounds and storylines, unlike the current generation of high spec AAA rating games. However, it was these retro games that left a lasting impact on my mind, and it only felt right to pay homage to the games that made my childhood so memorable.

The structure of the game is simple. Your character, the hero, is on the moon and he fights off space bats and lizards that have invaded the moon. He ultimately discovers a dragon, a.k.a the final boss of the game, and his goal is to eliminate the dragon. 


I implemented the game using PyProcessing, which is Processing that executes native Python code. The reason why I chose this over standard Processing that runs on Java is because I was more confident of my programming skills in Python as opposed to Java. Ultimately, this turned out to be a major inhibitor which I’ll explain later. 

The controls of the game were simple, the player moves the characters left, right or up, and if the player comes into contact with any foe with his dagger facing the right direction, the player would inflict damage onto the foe. Otherwise, the player would lose some health instead. In order to create the necessary software aspects of the game, I used the following :
1) PyProcessing IDE – To program the actual game logic
2) Arduino IDE – To program the hardware aspect of the project to receive input
3) Adobe Photoshop – To crop and resize images
4) Character Generator to create Hero Sprite – Can be found here 
5) Sithjester’s RXMP Resources for the enemy sprites – Can be found here.

The actual code itself is below. I used Object Oriented Programming to implement the vast majority of functions, considering how versatile it is to duplicate elements of the same type with slightly different characteristics. Since I had learnt OOP in Intro to CS, and had implemented a game of similar nature, it didnt prove to be too difficult to come up with the logic for the game.

In addition to the Processing code, I also had 4 CSV files, from which I read the contents for each stage. The contents of the CSVs are below.













The Arduino code was simpler than I thought. It was just a matter of performing a Serial.print() each time the user moves the joystick. Since I wanted only left, right, up and the button press to be recorded, I ignored the bottom joystick movement.
The code is as follows :

For the hardware part of the implementation, I used a RedBoard, a prototyping shield, and an Adafruit joystick housed inside a laser cut box made of acrylic, However, since he connections to the joystick were very close, it was extremely difficult to solder them securely and Michael’s help is what saved the joystick in the end.
The schematic is as below


The main problems I encountered

  1. Cropping the sprite sheets turned out to be quite troublesome, because I’d often end up with half-cropped frames and it wouldn’t animate properly. I think cropping sheets like this comes with practice, since I got it right only after dozens of unsuccessful attempts
  2. PyProcessing does not produce meaningful error messages when code compiles, which means that I might have parse through dozens of lines of code to spot a tiny error.
  3. PyProcessing does not have standard documentation for the Serial library, which meant that I had to use the Java documentation to translate the code into Python, and just hope it works.
  4. Soldering the ends of the joystick proved to be ultra challenging, since they were thin leads close together. Michael showed me a soldering technique for such joints and it worked well.

Further Improvements.

1. I would use have preferred to use Processing in Java, considering the vast availability of documentation for the original version of Processing

2. I would include a button and functionality to make the player able to control when the Hero slashes. I skipped out on this due to time constraints.

3. I would also like to create a better storyline for the game itself, to make it more enriching and engaging.



Professor Michael Shiloh for his constant support, encouragement and advice throughout the whole journey,
James and Ume for always being there around the lab to make sure we knew the resources we had, plus advice on how to make use of them.
Alex for teaching me how to use Photoshop to crop images,
Jennifer for helping me out with getting the Serial library to work with PyProcessing,
Diego and Laine for helping me out with the joystick and designing the box using,
Mateo for helping me resolve errors in the logic of my code,
And lastly, the community at the IM Lab who created an amazing work environment and acted as a strong support system throughout the entire process!

Update on Final Project- As of 2300 December 10th

So, after clocking 36+ hrs worth of code, I’ve managed to construct the core skeleton of my game. The time between now and the showcase would be spent adding other essential features and configuring a physical controller for my game. 
Attached below is a video of my game in its current, buggy state. 


Currently known bugs are as follows:

i)The player’s healthbar fails to decrement visually so you dont see the health change on screen.
ii)The healthbar floats away after the player passes the halfway mark on screen.
iii)The end of the screen has dead pixels which really shouldn’t be there.
iv)The character fails to KO the foes when approaching from the left.
v)The BGM fails to reset after the game is over.


Final Project Proposal

For the final project, I wish to make a sort of arcade game using the Python for Processing, and Arduino for the controls. The game is based off a portion of a satirical article on The Gazelle.
I’ve written a short description of the game which is as follows :

Lack of shawarma to satiate hungry souls. Lack of automation in the “automatic doors”. Lack of direction on the signboards. Excessive flies in and around campus. Excessive KFC every night. Excessive innovation from the world’s smartest minds in one place. All these and more have prompted the students of New York University to seek out new terrain to assert their intellectual dominance. But, being global citizens is no longer enough. It’s time to go universal, and build the first ever Inter-Galactic Network University(IGNU). And, so began the saga to sail through uncharted waters and conquer terrain that no cosmopolitan global leader has ever stepped on – the moon.
Your quest is to explore the moon and find out if the moon is suitable terrain for the newest extension of NYU – tentatively named Moon York University.
Good luck young adventurer, may the power of hummus be with you. 

The tentative list of hardware I have in mind is :

  1. 4 momentary switches
  2. 1 joystick
  3. Laser cut box made of acryllic
  4. A large screen/ monitor to display the game

Homework Due Monday 27th November

For this assignment, I referred the Pointillism tutorial by Daniel Shiffmann which can be viewed here.

The original image that I used is shown below.

I wanted to give it a darker, edgier, silhouette like effect, and this was the outcome that I got.

The code is below :


Homework Due November 22nd

When I think about computing and computer science, my mind invariably goes back to 2010 when I was in seventh grade. That was when I was first exposed to computer science and its marvels, and my teacher would constantly teach us about new, exciting upcoming technologies – virtual reality, 3D printing, NFC and so on. This was probably around the time I decided that this was the field that I wanted to be a part of.

People have a spectrum of opinions with regards to modern technology, but then again, people also had a variety of opinions with all sorts of advents – be it the invention of the wheel, the discovery of fire, and so on. The question always boils down to – is (insertRevolutionaryDiscoveryHere) a virtue, or a vice?
Think about the “modern marvels” today, most of which are taken for granted. Modern communications channels, space travels, banking systems and so on. None of these would have ever come about if not for modern computational capabilities. On the flip side, the digital age did bring with it, a new terrain for crime and misdoings. Cyber crime such as credit card fraud, identity theft, online scams, and so on are pressing issues in the 21th Century. Yet, these are issues that could be tackled, and the numerous benefits of technology certainly outweigh the downsides. 

I believe that technology has played a pivotal role in my life thus far. It has taught me essential problem solving and analytical skills necessary to tackle the winding mazes created by the problems of today’s world. Additionally, it taught me the importance of teamwork, and how it can act as a common platform which unites people from all walks of life towards solving the pressing issues of our day. But, above all, I think technology is something that evokes a feeling of excitement and joy that is difficult to describe. Whether it was 10 year old me gleaming in delight playing Pokemon or present me sighing in relief and content when I see my code compile and run without errors, the feeling of accomplishment is indescribable. 
I’m a strong believer of the fact that technology is for the betterment of all of our well-beings and to that effect, I’d like to leave you with an advertisement that I saw in a textbook sometime ago
This was an advertisement by IBM during the early days of computing.

Assignment Due on November 20th – LCD Screen

This assignment was mostly straightforward,except for the part that involved making the numerous connections between the LCD and the Arduino. I used this tutorial to help me out with that. After the connections were made, the rest of it was fairly straightforward.

Arduino Code :

Processing Code:


Assignment Due November 6th – Helicopter Game

First of all, my sincerest apologies for the extremely delayed submission. 

Once again, I was at a loss as to what to do the assignment, and improving my creative thinking skills has been bumped up right to the top of my priority list for this semester, and I hope to gain more out of this class to enhance that.
I came across a tutorial by a professor at the University of Nebraska and implemented the game.

The main point of the game is to use a touch pot sensor to prevent the helicopter from touching the ceiling or the floor.

A problem that I faced was retrieving a library, but was easily resolved by downloading the library from the Sketches menu.
Also, for the Arduino part of the code, all that was used was the StandardFirmata sketch from the Firmata library, which is some sort of communications protocol(that I do not quite fully understand yet). 

Processing  Code:


Assignment Due Wednesday November 1st

This assignment proved to be very interesting in the sense that I learnt the true power of “Interaction” between hardware and software, and the fluidity of transmission of signals between the program and the software. 

Part I – Controlling a Servo.

For this part of the assignment, I initially assumed that I’d have to use the map function extensively to move the servo. However, after some help from Professor Shiloh, I realised fixing the size of the screen down to 180 helped achieve the same thing.

Part II – Controlling an LED

For this program, I was confused at first as to how the Arduino code would work. After a bit of thinking, I figured that since that the problem is binary in nature, it would be easy to just pass one of two possible values to the arduino. 
Also, I found two very useful functions – mousePressed() and mouseClicked()
(Can be found over here and here.)


PVector Example


Assignment Due Monday 30th October

For this assignment, my initial plan was to convert the polar equations(which I learnt in highschool and thought I was never, ever going to see or use again) to parametric equations to create to retro style design of graph patterns, after seeing this.

But, Natalie beat me to it, and so I decided to find something else. I later stumbled upon this – a program that creates a star field, and I decided to implement that to create a sort of wormhole/vortex/portal through space-time/ Back To The Future sort-of thing.
The outcome is down below. 
Credits to Daniel Shiffman of the Coding Train for the outline of the Code.
(In case anyone is interested, I used Ice Cream Screen Recorder to record the video below. You can download it here.