My first homework assignment for ICM!

Play yourself here.

Download the code + images here (or see below for just code).

This was my first time working with Processing in depth, so bear with me. (I have used processing in the past, but only in the context of Arduino and with code I didn't write myself) After class, I was expecting to make some type of simple geometric art… the old Universe of Energy Preshow came to mind:

The huge 'kinetic mosaic' screens were made of '100 rotating triangular panels controlled by a computer to produce three-dimensional images' – a project of  Czech Film Director Emile Radok and WED Enterprises. I still remember how awesome this was as a kid.

I quickly discovered that I had absolutely no idea how to efficiently translate that many primitive shapes and I wasn't clear on what I wanted the interaction & animation to be. Walking down in the subway (and seeing yet another rat) gave me the idea for what I made.

Imagine you are a spacerat(that is, a rat that appears from space) that wishes to seek revenge on city goers who force earth rats to live in the dark depths of the subway system. Seek revenge!

Evil Space Rat!!! Object Oriented Programming

I initially started coding everything individually, but with 14 buildings this quickly got out of hand. I attempted using functions but then saw the tutorial about classes on processing.org. I was able to assemble the buildings, clouds & subway trains using classes. Object oriented magic?

Interaction with MouseX, MouseY

For the interaction of pushing the buildings into the sub-world, I'm using mouseX & mouseY, using a class function to subtract from the initial Y value of the building rectangles when the mouse is pressed. A green (randomly changing) beam & red beams also emanate from the spacerat when you press the mouse.

Images, Text

I also learned from a tutorial how to incorporate bitmap images, such as the spacerat.

And another for incorporating a font for 'game over'. (but it doesn't seem to work in Javascript mode)

Questions / Things to Fix

  • how to pull data out of objects (right now I have a mess of a check to see if all the buildings are destroyed)
  • how to call a bunch of objects at once (nesting?)
  • speed: it seems like things move faster in the javascript version, what's the best way to control animation speeds?
  • finer control of color
  • making curved lines behave
  • coding more efficiently so things don't skip around?
And the code:

 

© 2017. Some Rights Reserved.

Ghostium Theme by @oswaldoacauan

Proudly published with Ghost