Browse files

temp changes

  • Loading branch information...
1 parent 781ef8a commit fa281e1936c81e508f4bc88f9db450702a000c86 @pcarleton pcarleton committed Apr 2, 2012
Showing with 14 additions and 10 deletions.
  1. +13 −10 html5/index.html
  2. +1 −0 html5/views/simulation_view.js
View
23 html5/index.html
@@ -38,9 +38,16 @@
var rectBounds = new Rectangle(tr, bl);
rect.fillColor = 'black';
var repClicks = [];
+ var circle = new Path.Circle(new Point(500, 500), 10);
+ circle.fillColor = "blue";
+ var circSym = new Symbol(circle);
+ circle.fillColor = "green";
+
+ var goerSym = new Symbol(circle);
+
function createRep(position) {
- var shape = new Path.Circle(position, 10);
+ var shape = circSym.place(position);
shape.fillColor = "blue";
shape.type = "rep";
var frameCount, age, duration, alive;
@@ -58,30 +65,25 @@
shape.die = function() {
shape.alive = false;
- shape.remove();
+ //shape.remove();
}
shape.bounce = function() {
position.blink;
}
shape.clicked = function() {
- shape.fillColor = "red";
+ circleSym.definition.fillColor = "red";
game.frat.rep += 1;
updateStatsBar();
shape.die();
}
return shape;
-
-
-
}
- window.globals.createRep = createRep;
-
var create_goer = function(start) {
- var shape = new Path.Circle(start, 10);
+ var shape = goerSym.place(start);
var destVect, inHouse, age, dur, minDist, curDest, speed, destNum, dests = [];
destNum = 0;
minDist = 5;
@@ -181,7 +183,7 @@
var goers = [create_goer(new Point(600, 500))];
- game.sim.goersCount = 20;
+ game.sim.goersCount = 200;
function onFrame(event) {
if (!game.sim.stopped) {
if (Math.random() > 0.95 && game.sim.goersCount > 0) {
@@ -228,6 +230,7 @@
function onMouseDown(event) {
var hitResult = project.hitTest(event.point, hitOptions);
+ console.log(hitResult.item);
if (hitResult && hitResult.item.type == "rep") {
hitResult.item.clicked();
}
View
1 html5/views/simulation_view.js
@@ -30,6 +30,7 @@ $(document).ready(function(){
$("#skip").click(function(){
//game.sim.end();
+ console.log(game.sim);
game.sim.cleanUp();
game.sim.stopped = true;
results();

0 comments on commit fa281e1

Please sign in to comment.