Remarks: Processing Mazes

From Maze

(Difference between revisions)
Jump to: navigation, search
(Add new Processing code)
Line 7:Line 7:
[NOTE 9 July. Add the second Processing port, which includes making the maze move up the screen, changing the symbol to black and white boxes to show how the effect is lost, change the weight of the random number. Note which can be rewritten for the C64 and which are unique to Processing.]
[NOTE 9 July. Add the second Processing port, which includes making the maze move up the screen, changing the symbol to black and white boxes to show how the effect is lost, change the weight of the random number. Note which can be rewritten for the C64 and which are unique to Processing.]
−
After writing this first program that focuses entirely on the image of the maze, it because clear that watching the maze build one unit at a time on the C64 is a major component of the program. This behavior doesn't naturally work with Processing because the entire screen updates as a whole, rather than character by character. [MORE]
+
After writing this first program that focuses entirely on the image of the maze, it became clear that watching the maze build one unit at a time on the C64 is a major component of the program. This behavior doesn't naturally work with Processing because the entire screen updates as a whole, rather than character by character. [MORE]
int w = 16;
int w = 16;
Line 14:Line 14:
void setup() {
void setup() {
−
size(640, 384);
+
size(640, 384);
−
background(#0000ff);
+
background(#0000ff);
−
stroke(224);
+
strokeWeight(1.5);
 +
stroke(224);
 +
smooth();
}
}
−
+
−
 
void draw() {
void draw() {
int x1 = w*index;
int x1 = w*index;
Line 41:Line 42:
}
}
−
 
−
[MORE] This a akin to using one's native language to write; thoughts flow directly and smoothly.
 
There is a way within Processing to make the 10 PRINT work more similarly to the C64. This method uses the text Console of the Processing Development Environment (PDE) instead of the pixels in the display window. The Console in the PDE is typically used for error messages and writing debug statements through the print() and println() functions which are similar to CHR$() in BASIC. This technique may seem more like the C64, but the console can only print text; programs can't be written there. The other primary difference is the lack of the graphic characters of PETSCII (see p. ??) in the native console font for the PDE. As a result the / and \ characters need to be used in place of diagonal graphics. The result it spaces between the lines, which destroys the illusion of a continuous maze. The Processing program that produces this approximation of 10 PRINT is also a one-line program:
There is a way within Processing to make the 10 PRINT work more similarly to the C64. This method uses the text Console of the Processing Development Environment (PDE) instead of the pixels in the display window. The Console in the PDE is typically used for error messages and writing debug statements through the print() and println() functions which are similar to CHR$() in BASIC. This technique may seem more like the C64, but the console can only print text; programs can't be written there. The other primary difference is the lack of the graphic characters of PETSCII (see p. ??) in the native console font for the PDE. As a result the / and \ characters need to be used in place of diagonal graphics. The result it spaces between the lines, which destroys the illusion of a continuous maze. The Processing program that produces this approximation of 10 PRINT is also a one-line program:

Revision as of 18:39, 9 July 2011

View this revision of Remarks: Processing Mazes.

Personal tools