/** * *

SpaceBoxes_by_spxl

*

by subpixel

*

Version 1.2.1, 2009-01-24

* *

Original idea and code ased on Falling Box by takumi

*

Flying through an asteroid field, kind of.

*

Autopilot (no controls!)

*

Keys:

* */ /* * 2009-01-18 Version 1.1 by subpixel * - Code tidy. * - User controls: toggle spin, toggle tumble, scene orientation, timewarp. * * 2009-01-20 Version 1.2 by subpixel * - Massive rewrite. Program broken into classes. * - Concept of (control) channels introduced (including master channel). * - draw() broken into draw() and update() parts. * - Effect parametrs and sample effects. * - Library of background images to cycle through. * - User controls: random action on numbered (and master) channel, * effect toggle on random channel, effect shot on random channel, * cycle background images. */ //import processing.opengl.*; // Only need if you want to use OPENGL mode Scene scene; // Everthing (well, almost) there is to know about the scene. // ---------------------------------------------------------------------------- // Setup method // ---------------------------------------------------------------------------- public void setup() { // size(screen.width, int(screen.height*0.5), OPENGL); // Fullscreen anyone? :o) // size(800, 600, OPENGL); size(720, 320, P3D); // Applet-friendly dimensions frameRate(30); String[] bgImages = new String[] { "bg1.jpg", "bg2.jpg", "bg3.jpg", "bg3.jpg", "bg4.jpg", "bg5.jpg", "bg6.jpg", "bg7.jpg", "bg8.jpg" }; scene = new Scene(this, bgImages); } // ---------------------------------------------------------------------------- // Draw method // ---------------------------------------------------------------------------- public void draw() { scene.update(); scene.draw(); } // ---------------------------------------------------------------------------- // Handle keyboard input // ---------------------------------------------------------------------------- void keyPressed() { scene.keyPressed(); }