Skip to content

Instantly share code, notes, and snippets.

View ybakos's full-sized avatar
💭
the machine stops the machine stops the machine stops

Yong Joseph Bakos ybakos

💭
the machine stops the machine stops the machine stops
View GitHub Profile
<table>
<tr>
<td>1</td>
<td>Sgt. Pepper's Lonely Hearts Club Band</td>
<td>1967</td>
</tr>
<tr>
<td>2</td>
<td>Are You Experienced?</td>
<td>1967</td>
// Yong Bakos
// Breakout/Arkanoid Remixed.
// This program is based on the classic game of Breakout, by Atari's
// Nolan Bushnell and Steve Bristow, released in 1976.
// A playing field of bricks lies at the top of the screen, and a
// player-controlled paddle lies at the bottom. A ball bounces around
// the playing field and the ball destroys a brick when it contacts the
// brick.
// If the ball reaches the bottom of the screen, the user loses a ball.
// If the player loses 3 balls, the game is over.
@ybakos
ybakos / Breakout.pde
Created February 12, 2014 16:56
In-class example of if/else, mouse/key events, and functions.
// Yong Bakos
// Breakout!
boolean displayStartScreen = true;
final int BALL_SIZE = 20;
final int BALL_SPEED = 4;
int ballX;
int ballY;
int ballXDirection = 1;
// YOUR NAME
// Breakout/Arkanoid Remixed.
// HW 11: Functions that return values
boolean displayStartScreen = true;
final int BALL_SIZE = 20;
final int BALL_SPEED = 4;
int ballX;
int ballY;
// Yong Bakos
// An exploration of functions...
void setup() {
size(400, 400);
}
void draw() {
drawCar(200, 100, 1);
}
@ybakos
ybakos / function_invaders.pde
Last active August 29, 2015 13:56
A starting point for class, Feb. 26.
// TODO: your name
// Decomposing space invaders, for function re-use
// Focusing on remaining ships and the forts.
final int TEXT_SIZE = 32;
color green = color(0, 200, 0);
color white = color(255);
int shipsLeft = 4;
int credit = 0;
// TODO: Your Name
// Homework 14. Practicing using a loop to remove repetitive code.
// Improving drawAllForts with a loop.
final int TEXT_SIZE = 32;
color green = color(0, 200, 0);
color white = color(255);
int shipsLeft = 4;
int credit = 0;
@ybakos
ybakos / composition.pde
Created March 19, 2014 13:45
In-class refactoring goal for March 19
// YOUR NAME
// Refactoring global variables and functions into appropriate classes.
// And an exploration of composition.
Car hooptie;
Engine hemi;
void setup() {
size(500, 500);
// ???
@ybakos
ybakos / composition_start.pde
Created March 19, 2014 13:46
Global variables and functions that need refactored into classes. And an opportunity for composition.
// YOUR NAME
// Refactoring global variables and functions into appropriate classes.
// And an exploration of composition.
int carX;
int carY;
int carW;
int carH;
int engineX;
int engineY;
@ybakos
ybakos / symbol_table.rb
Created March 21, 2014 14:39
The hack pre-defined symbol table.
@@symbols = {
'SP' => 0,
'LCL' => 1,
'ARG' => 2,
'THIS' => 3,
'THAT' => 4,
'R0' => 0,
'R1' => 1,
'R2' => 2,
'R3' => 3,