Final Assignment (Homework due Dec. 20, 2017)

Upon first hearing that the theme for the showcase was “Space”, my thoughts immediately went to creating a space-themed video game. At first, I wanted to recreate 3D Pinball for Windows – Space Cadet. However, I realized that I didn’t really enjoy pinball all that much, so I wanted to change my idea. I had no fresh ideas of my own after my sudden switch, but a friend suggested that I recreate another classic game – Asteroids by Atari. As it was a game that I enjoyed immensely as a child (it also helped that the game had a more space-y theme), I dived into recreating it using Processing.

Continue reading “Final Assignment (Homework due Dec. 20, 2017)”

Final Project Blog Post (Assignment due Dec. 4, 2017)

Background:

Originally, I had thought to recreate 3D Pinball for Windows – Space Cadet. However, after a weekend of reflection (and I just think pinball gets a bit boring, after a while), I thought about trying to create something original. It will still be a game, of course, but one more of my own design.

Continue reading “Final Project Blog Post (Assignment due Dec. 4, 2017)”

Final Project Idea (Homework due Nov. 29th)

Upon reading the words space, I don’t know why, but my immediate thought was 3D Pinball – Space Cadet found on earlier machines running Windows, and since I enjoyed creating my game for Open Studios a whole lot, I had been planning on making a game anyways. So, the two ideas kinda came together. I’ll focus on recreating the game’s interface using Processing. For user interaction, I’ll probably try to recreate the bottom end of a pinball machine with buttons that control the on-screen flippers, a sensor to sense if the machine is tilted and some sort of mechanism to correspond to loading the balls on-screen.

3D Pinball for Windows – Space Cadet

I’m already foreseeing just how much “fun” I’ll have coding this game.

Processing Image Manip (Assignment due Nov. 27, 2017)

Upon seeing the “Pointillism” example, I was reminded of how the world looks when seen through a rain-covered windshield or, more often, wet glasses. I was immediately inspired to take the image of someone standing in the rain and then apply the Pointillism example to it. To make the image a bit more somber, I added a small blur to it, which I adapted from this example on altering image transparency. To round it all off, using control structures, I kept the pointillism ellipses off the girl, giving the picture a kind of Pinterest-y “I’m only looking at you” vibe.

The edited photo is on the left and the unedited one is on the right.

Code:

 

What is Computing to Me? (Homework due November 22, 2017)

Technology has always been something very special to me. As a kid, I used to play video games for hours on end and, even now, I still do (when I can find the time). There’s a pivotal difference now, though. After learning more about computing, the hardware, and the software, I understand how much happens behind the scenes to let all this happen. The mechanisms of a button press and the dimming of the screen right before the credits roll when the video game adventure is complete aren’t entirely abstract concepts to me anymore manipulated by video game magic. Now, they are things that I can manipulate myself.

Continue reading “What is Computing to Me? (Homework due November 22, 2017)”

LCD Circuit (Homework due Nov. 20th, 2017)

Background:

For this assignment, we had to connect a LCD to the Arduino and Processing and use the Dimmer example to change the numbers printed on the LCD as the mouse moved across the Processing window.

Because we had never connected an LCD before, after wiring it up (the first time), I decided to check if it was working using the “Hello World” built-in example. However, when I uploaded the code, nothing but some white rectangles was displayed. I looked at my circuit again and instead of using the wire schematic, I looked at the breadboard schematic. I immediately realized that I had reversed the order of the LCD pins. After switching all my wires, the “Hello Word” example ran perfectly.

I went on to tackle the actual exercise: displaying information from Processing on the LCD. Initially, I tried to combine the Processing Dimmer code and the Arduino Serial Display code. With these two codes combined, all the LCD displayed was rapidly changing characters and symbols from various languages as I moved the mouse across the Processing window. I tried moving around some variables to no avail until I noticed that that the LCD library had both a print and a write method. I read the documentation for both and then realized that the lcd.write() that was in the example only printed characters, so I changed it to a lcd.print(). There was one more adjustment to be made, though. Since the integer was printing multiple times on the screen, I removed the delay() that was in the example and everything began to work as I expected.

Arduino Code:

Processing Code:

 

Processing Game (Homework due Nov. 6th, 2017)

Sorry about the late post, but it totally slipped my mind after how hectic Open Studios was!

For my game, I decided to pay homage to a basic space invaders game that I used to play when I was younger. Instead of the joystick and button, though, I implemented a potentiometer and button. Basically, the goal of my game was to defend the Earth from the randomly spawned asteroids by moving the spaceship with potentiometer and firing its laser using the button. 

This game really gave me the opportunity to experiment with object oriented programming which was great because it’s something I’ve always wanted to dabble more in. I learned to used ArrayLists to store the Asteroid and Laser classes so I could have a dynamic number of them on the screen. My main difficulty was mapping the collision, because I had initially used a PShape group object to draw the asteroids. However, I couldn’t figure out the exact width of the shape, so I changed the asteroids to a regular rectangle. But after I got the collisions working, it was mostly smooth sailing. Aside from when I tried to add sound, but the sketch started using too much memory, so I decided to refrain.

This game was also a challenge for me because I decided the only online help I would look at would be the processing references and tutorials. In the end, I kept to my challenge and it was pretty rewarding when my game worked.

Continue reading “Processing Game (Homework due Nov. 6th, 2017)”

Control Servo and LED Using Mouse (Assignment due Nov. 1, 2017)

Servo:

The first task was controlling a servo using the mouse. Since this exercise was almost 1:1 with what we did in class with the LED, I didn’t have any trouble with it. Instead of making the canvas size between 0 and 180 pixels, I used map() on the Arduino side to scale the byte values received down to between 0 and 180. I also took this opportunity to try out Processing’s text features by labelling one side of the canvas as 0 degrees and the other as 180.

Arduino Code:

Processing Code:

LED:

This one was pretty fun to do, mostly because I like playing with LEDs. Once again, I revisited the principles of the dimmer and the servo control, this time paired with mousePressed. If the mouse was in the bounds of my “off rectangle” while the button was pressed, I used Processing to send a “0” to Arduino which was stored in a variable the used in an if statement to turn the LED off. Similarly, if the mouse was in the bounds of my “on rectangle” while the button was pressed, I used Processing to send a “1” to Arduino which turned the LED on. I labelled the “off rectangle” using a circle and the “on rectangle” with a line to follow standard power symbols.

Arduino Code:

Processing Code:

Video:

Recreating Art in Processing (Assignment due Oct. 30, 2017)

For this assignment, I tried to recreate Manfred Mohr’s P197A which was in Computer Graphics and Art because the piece of writing accompanying his work struck me. In addition to that, the lines and the shapes of his work really caught my eye. From his work, I noticed he drew two perpendicular sets of parallel lines, then drew random shapes around the intersection of these sets. I made that the basis of my piece. Furthermore, inside the random shapes, he drew some lines, the significance of which I still don’t really understand.

Firstly, I set up the same grid he did using loops. Then using their intersections and random(), I drew random four-sided figures using quad(), mostly because I could feel the imminent headache coming on if I tried to create random shapes in PShape() multiple times. Then, within the shapes, using random() and an if() to determine which, I drew random lines that either terminated in the middle of the shape or I drew diagonals.

Code:

Picture: