import processing.xml.*; /* This one's got: * converted to something closer to what is needed for the hardware version. * the code in the "classes" and "screen-related" tabs won't be included in the hardware version * any calls to functions starting with "screen" will be deleted or replaced. A comment on the line of the function will say if something should replace it. * the code in the "faux_buttons" tab needs to be replaced with functions that work with the hardware * calls to functions that start with "faux_" need to be replaced with hardware-valid functions * so * nodes, links, and a network to relate them * the updates for that network working * click party * illustrator import (limited) * better color, timing * center drawing Next: * one big question: how to manage the order of the nodes in the arrays? */ long millis_betweenUpdates = 200; // could possibly be changed with a nob. otherwise, there's no need for the variable (if memory is an issue), since it's only called once. long millis_sinceUpdate = 0; long millis_prevFrame; boolean[] on; boolean[] visited; boolean[] on_next; boolean[] visited_next; boolean[][] network; void setup(){ screenSetup(); screenLoadXML(); //will be replaced with the instantiations of on[], on_next[], visited[], visited_next[], and network[][]; millis_prevFrame = millis(); screenDraw(); } void draw(){ long millis_curr = millis(); millis_sinceUpdate += millis_curr - millis_prevFrame; if(millis_prevFrame > millis_curr) millis_sinceUpdate = 0; // to account for millis() rolling over to zero after 9 hours. if(millis_sinceUpdate > millis_betweenUpdates){ millis_sinceUpdate = 0; updateNet(); } millis_prevFrame = millis(); screenDraw(); if(faux_isAnyButtonPressed()){ millis_sinceUpdate = 0; int clicked_i = narrowDownButtonsInit(); //********************************** // pick things back up here. //********************************** //reset all int i = 0; if(allHaveBeenVisited()){ millis_sinceUpdate = 0; screenReset(); for(i = 0; i < on.length; i++){ on[i] = false; visited[i] = false; on_next[i] = false; visited_next[i] = false; } } if(clicked_i != -1){ on[clicked_i] = true; visited[clicked_i] = true; on_next[clicked_i] = true; visited_next[clicked_i] = true; } } }