Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

part 1 complete

  • Loading branch information...
commit 08d92d3755b7aef1815396e5ad961e352ad48ed0 1 parent 4ddea6a
@presstube authored
Showing with 66 additions and 0 deletions.
  1. +66 −0 index.html
View
66 index.html
@@ -0,0 +1,66 @@
+<html>
+<head>
+ <title>Cyclic Vacuum Cannon</title>
+ <style type="text/css">
+ body {
+ padding: 0px;
+ margin: 0px;
+ background-color: #333;
+ }
+ </style>
+</head>
+<body onload="new p.CyclicVacuumCannonApp">
+<canvas id="canvas"></canvas>
+<script type="text/javascript" src="http://code.createjs.com/easeljs-0.5.0.min.js"></script>
+<script type="text/javascript">
+
+ // herein lies the juice
+
+ // namespacing & shortcuts
+ var c = createjs;
+ var presstube = {};
+ var p = presstube;
+
+ // create our app
+ p.CyclicVacuumCannonApp = function() {
+
+ var canvas = document.getElementById("canvas");
+ var stage = new c.Stage(canvas);
+ var bgRect = new c.Shape;
+ var centeredContainer = new c.Container;
+ var placeholderDot = new c.Shape;
+
+ c.Ticker.setFPS(30);
+ c.Ticker.addListener(stage);
+
+ stage.onTick = function(e) {
+ // console.log("stage tick here!", e);
+ }
+
+ function resize() {
+ canvas.width = window.innerWidth;
+ canvas.height = window.innerHeight;
+
+ bgRect.graphics.clear().beginFill("333").drawRect(0, 0, canvas.width, canvas.height);
+
+ centeredContainer.x = canvas.width / 2;
+ centeredContainer.y = canvas.height / 2;
+ }
+ resize();
+ window.onresize = resize;
+
+ stage.onClick = function(e) {
+ // console.log("stage click here!", e);
+ }
+
+ stage.addChild(bgRect);
+ placeholderDot.graphics.beginFill("f00").drawCircle(0, 0, 30);
+ centeredContainer.addChild(placeholderDot);
+ stage.addChild(centeredContainer);
+
+ }
+
+
+</script>
+</body>
+</html>
Please sign in to comment.
Something went wrong with that request. Please try again.