Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
107 lines (91 sloc) 3.99 KB
<!DOCTYPE html>
<html class="vocabbi_document">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<script src="js/processing-1.4.1.min.js"></script>
<script src="js/webpd-latest.min.js"></script>
<script src="js/jquery-1.8.2.min.js"></script>
<script src="js/windowScripts.js"></script>
<script src="js/common.js"></script>
<style>
body {
margin: 0px;
overflow: hidden;
background-color: black;
font-color : white;
}
</style>
</head>
<body>
<script>
// -------- Pop-up management -------- //
(function() {
var currentWindow = null;
var numWindows = 19;
var projectWidth = 1024;
var projectHeight = 768;
var screenWidth = screen.width;
var screenHeight = screen.height;
var xoffset = (screenWidth / 2) - (projectWidth / 2);
var yoffset = (screenHeight / 2) - (projectHeight / 2);
var winVars = [];
// X, Y, WIDTH, HEIGHT
winVars[0] = [1, 1,200, 200]; // level1
winVars[1] = [215, 0, 200, 200]; // level2
winVars[2] = [430, 0, 200, 200]; // level3
winVars[3] = [645, 0, 200, 200];
winVars[4] = [860, 0, 200, 200];
winVars[5] = [1075, 0, 200, 200];
winVars[6] = [0, 264, 200, 200];
winVars[7] = [215, 264, 200, 200];
winVars[8] = [430, 264, 200, 200];
winVars[9] = [645, 264, 200, 200];
winVars[10] = [860, 264, 200, 200];
winVars[11] = [1075, 264, 200, 200];
winVars[12] = [0, 528, 200, 200];
winVars[13] = [215, 528, 200, 200];
winVars[14] = [430, 528, 200, 200];
winVars[15] = [645, 528, 200, 200];
winVars[16] = [860, 528, 200, 200];
winVars[17] = [1075, 528, 200, 200];
winVars[18] = [300, 0, 700, 700]; // finishing animation
// This function pops-up a new window containing assets of level `winNum`.
var popUp = this.popUp = function(winNum) {
if (currentWindow) {
console.log('closing window ' + currentWindow.name);
if (currentWindow.patch) currentWindow.patch.stop();
currentWindow.close();
// If no `currentWindow`, we assume that we are on index.
} else {
window.patch.stop();
}
window.focus();
currentWindow = getWindow(winNum);
console.log('opening window ' + currentWindow.name);
currentWindow.focus();
}
var getWindow = function(winNum) {
var newWindow = window.open('level-template.html?level=level'+winNum, 'level'+winNum,
'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,left='
+(winVars[winNum][0])+",top="+(winVars[winNum][1])+",width="+winVars[winNum][2]+",height="+winVars[winNum][3]);
return newWindow
}
}).call(this);
// When page is loaded, we load patch an sketch, and start the WebPd patch.
$(function() {
downloadSketchAndPatch('themidst', function() {
// WebPd patch -> Processing.js sketch
// -------------------------------------
// This is how you receive a message from a patch, and send it to processing
//
//patch.receive('thunder', function() {
// sketch.startLightning();
patch.play();
});
});
</script>
<canvas id="canvas" style="overflow:hidden;width:windowWidth;height:windowHeight;padding-left:0px;padding-top:0px;"></canvas>
<input type="button" onClick="popUp(0)" value="Start">
<p id="text" style="font-family:verdana;color:white;"></p>
</body>
</html>
You can’t perform that action at this time.