Permalink
Browse files

"3/3/12 0024"

  • Loading branch information...
1 parent 696f4ab commit afeb2ba59732634abd7aa90b7e596703112ca4de @G3n3r0 committed Mar 3, 2012
View
BIN Graphics/Icons/rocket2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
34 Graphics/Icons/speaker.svg
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
-<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
- width="93.32px" height="100px" viewBox="0 0 93.32 100" enable-background="new 0 0 93.32 100" xml:space="preserve">
-<polygon points="0,37.457 0,62.542 22.076,62.542 39.135,79.601 39.135,20.398 22.076,37.457 "/>
-<path d="M63.217,50C63.217,50,63.217,50,63.217,50L63.217,50c0-0.001,0-0.001,0-0.002c-0.16-11.028-3.777-20.315-11.345-28.367
- c-2.663-2.834-6.913,1.431-4.257,4.257c6.487,6.903,9.443,14.674,9.581,24.111c-0.138,9.439-3.094,17.208-9.581,24.113
- c-2.656,2.826,1.594,7.092,4.257,4.256C59.439,70.317,63.057,61.03,63.217,50C63.217,50,63.217,50,63.217,50z"/>
-<path d="M78.269,50C78.269,50,78.269,50,78.269,50L78.269,50c0-0.001,0-0.001,0-0.002c-0.208-14.764-5.27-28.018-15.477-38.723
- c-2.684-2.815-6.936,1.449-4.257,4.257C67.647,25.091,72.062,36.821,72.248,50c-0.186,13.179-4.601,24.91-13.713,34.468
- c-2.679,2.809,1.573,7.072,4.257,4.256C72.999,78.019,78.061,64.765,78.269,50C78.269,50,78.269,50,78.269,50z"/>
-<path d="M93.32,50L93.32,50C93.32,50,93.32,50,93.32,50c-0.208-18.576-6.708-35.666-19.606-49.083
- c-2.694-2.804-6.946,1.459-4.257,4.257C81.258,17.45,87.109,33.004,87.3,50c-0.19,16.996-6.042,32.55-17.843,44.828
- c-2.689,2.797,1.562,7.059,4.257,4.256C86.612,85.665,93.112,68.577,93.32,50.001C93.32,50,93.32,50,93.32,50
- C93.32,50,93.32,50,93.32,50z"/>
-</svg>
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+ width="93.32px" height="100px" viewBox="0 0 93.32 100" enable-background="new 0 0 93.32 100" xml:space="preserve">
+<polygon points="0,37.457 0,62.542 22.076,62.542 39.135,79.601 39.135,20.398 22.076,37.457 "/>
+<path d="M63.217,50C63.217,50,63.217,50,63.217,50L63.217,50c0-0.001,0-0.001,0-0.002c-0.16-11.028-3.777-20.315-11.345-28.367
+ c-2.663-2.834-6.913,1.431-4.257,4.257c6.487,6.903,9.443,14.674,9.581,24.111c-0.138,9.439-3.094,17.208-9.581,24.113
+ c-2.656,2.826,1.594,7.092,4.257,4.256C59.439,70.317,63.057,61.03,63.217,50C63.217,50,63.217,50,63.217,50z"/>
+<path d="M78.269,50C78.269,50,78.269,50,78.269,50L78.269,50c0-0.001,0-0.001,0-0.002c-0.208-14.764-5.27-28.018-15.477-38.723
+ c-2.684-2.815-6.936,1.449-4.257,4.257C67.647,25.091,72.062,36.821,72.248,50c-0.186,13.179-4.601,24.91-13.713,34.468
+ c-2.679,2.809,1.573,7.072,4.257,4.256C72.999,78.019,78.061,64.765,78.269,50C78.269,50,78.269,50,78.269,50z"/>
+<path d="M93.32,50L93.32,50C93.32,50,93.32,50,93.32,50c-0.208-18.576-6.708-35.666-19.606-49.083
+ c-2.694-2.804-6.946,1.459-4.257,4.257C81.258,17.45,87.109,33.004,87.3,50c-0.19,16.996-6.042,32.55-17.843,44.828
+ c-2.689,2.797,1.562,7.059,4.257,4.256C86.612,85.665,93.112,68.577,93.32,50.001C93.32,50,93.32,50,93.32,50
+ C93.32,50,93.32,50,93.32,50z"/>
+</svg>
View
BIN Graphics/space.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
7 README.md
@@ -107,4 +107,9 @@ An odd mixture of many genres
* Moar 3D
* Made it so that the canvas is even bigger on large screens
* Web Sockets Test
-* Fullscreen API
+* Fullscreen API
+
+###March 3rd, 2012
+* Added 3D in the background
+* 3D is all controlled by one variable
+* Attempted to move the space background to C9 so I can 3D it. Didn't work.
View
4 Scripts/3D.js
@@ -19,7 +19,11 @@ function threed(img) {
canvasContext.drawImage(img, offset, 0, width, height);
canvasContext2.drawImage(img, -offset, 0, width, height);
// grab the pixel data from the <canvas>'s
+ //try {
var imgData = canvasContext.getImageData(0, 0, width, height);
+ //} catch(e) {
+ // console.log(img, e);
+ //}
var imgData2 = canvasContext2.getImageData(0, 0, width, height);
var data = imgData.data;
var data2 = imgData2.data;
View
62 Scripts/main.js
@@ -5,33 +5,73 @@ window.onload = function() {
var otherMenu = $("#otherMenu");
var touchCons = $("#touchControls");
var stage = new Stage(canvas[0]);
+ var three = true;
var imgs = {
- playerShip: "Graphics/starship.png",
- enemyShip: "Graphics/starshipdark_flipped.png",
+ playerShip: "Graphics/starship.svg",
+ enemyShip: "Graphics/starshipdark_flipped.svg",
speaker: "Graphics/Icons/speaker.svg",
muted: "Graphics/Icons/speaker_muted.svg",
pause: "Graphics/Icons/stop_hand.svg",
- play: "Graphics/Icons/right_arrow.svg"
+ play: "Graphics/Icons/right_arrow.svg",
+ stars: "Graphics/space.svg"
};
//alert(Modernizr.svg);
- if(!Modernizr.svg) {
+ if(!Modernizr.svg || three) {
imgs.playerShip = "Graphics/starship.png";
imgs.enemyShip = "Graphics/starshipdark_flipped.png";
+ imgs.stars = "Graphics/space.png";
}
+ function blank() {}
+ var cbs = {
+ playerShip: blank,
+ enemyShip: blank,
+ speaker: blank,
+ muted: blank,
+ pause: blank,
+ play: blank,
+ stars: function() {
+ if(!Modernizr.svg || three) {
+ //console.log(imgs, imgs.stars);
+ canvas.css("background-image", "url("+imgs.stars+")");
+ }
+ }
+ };
+
function make3D() {
for(var i in imgs) {
var a = new Image();
a.i = i;
a.onload = function() {
imgs[this.i] = threed(this);
+ cbs[this.i].call();
//window.open(imgs[this.i]);
};
a.src = imgs[i];
}
- console.log(imgs);
+ //console.log(imgs);
//window.open(imgs.playerShip);
+ /*var i = 0;
+ var nxtImg = function(e) {
+ i += 1;
+ console.log(i);
+ if(i>=imgs.length) {
+ alert("Bazinga!");
+ cb();
+ } else {
+ a = new Image();
+ a.onload = nxtImg;
+ a.src = imgs[i];
+ }
+ };
+ var a = new Image();
+ a.onload = nxtImg;
+ a.src = imgs[i];*/
+ }
+ if(three) {
+ $("#3dstyle").attr("rel", "stylesheet");
+ make3D();
}
//var shootInt = 0;
@@ -67,6 +107,7 @@ window.onload = function() {
return false;
}
}
+
var playerBullets = [];
var enemyBullets = [];
var enemies = [];
@@ -510,7 +551,10 @@ window.onload = function() {
var shipW = (64/640)*canvas.width();
function init() {
- if(document.body.webkitRequestFullScreen) document.body.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);
+ if(document.body.webkitRequestFullScreen) {
+ alert("Durr");
+ document.body.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);
+ }
if(document.body.mozRequestFullScreen) document.body.mozRequestFullScreen();
soundManager.url="./Scripts/SoundManager2/swf/soundmanager2.swf";
@@ -567,8 +611,10 @@ window.onload = function() {
//travelTo(5000);
//splashScreen(menuScreen);
}
-
- make3D();
+ /*if(!Modernizr.svg || three) {
+ console.log(imgs, imgs.stars);
+ canvas.css("background-image", "url("+imgs.stars+")");
+ }*/
init();
var currentWidth;
View
10 Scripts/sockets_test1.js
@@ -1,8 +1,14 @@
function socketStart() {
- var connection = new WebSocket('ws://html5rocks.websocket.org/echo');
+ var server = "ws://html5rocks.websocket.org/echo";
+ //var connection = new WebSocket(server)||new MozWebSocket(server);
+ if(WebSocket) {
+ var connection = new WebSocket(server);
+ } else if(MozWebSocket) {
+ var connection = new MozWebSocket(server);
+ }
// When the connection is open, send some data to the server
connection.onopen = function () {
- connection.send('Ping'); // Send the message 'Ping' to the server
+ connection.send('Derp'); // Send the message 'Ping' to the server
};
// Log errors
connection.onerror = function (error) {
View
3 Styles/3d.css
@@ -1,6 +1,9 @@
#menu ul li h2 {
text-shadow: -0.06em 0 red, 0.06em 0 cyan;
}
+/*#splash h1 {
+ text-shadow: -0.006em 0 rgba(255,0,0,0.5), 0.006em 0 rgba(0,255,255,0.5);
+}*/
#menu ul li {
box-shadow: -1px 0 0 red, 1px 0 0 cyan;
}
View
2 index.html
@@ -12,7 +12,7 @@
<link rel="stylesheet" href="./Fonts/Segoe WP/stylesheet.css" />
<link href='http://fonts.googleapis.com/css?family=Ubuntu&subset=latin,greek' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="./Styles/main.css" />
- <link rel="stylesheet" href="./Styles/3d.css" media="print" />
+ <link rel="derp" href="./Styles/3d.css" id="3dstyle" />
<link rel="stylesheet" href="./Styles/desktop.css" media="screen and (min-device-width: 640px)" />
<script src="Scripts/EaselJS/lib/easel.js"></script>
<script src="./Scripts/EaselJS/src/easeljs/ui/Touch.js"></script>

0 comments on commit afeb2ba

Please sign in to comment.