浏览代码

include particleView, add particles to canvas when they are created

Kevin Heinicke 10 年之前
父节点
当前提交
3c74ec3dd1
共有 2 个文件被更改,包括 2 次插入0 次删除
  1. 1 0
      index.html
  2. 1 0
      js/controller.js

+ 1 - 0
index.html

@@ -4,6 +4,7 @@
 	<title>Snakey Particles</title>
 	<script src="https://code.createjs.com/createjs-2015.05.21.min.js"></script>
 	<script src="js/views/physicist.js"></script>
+	<script src="js/views/particle.js"></script>
 	<script src="js/models/physicist.js"></script>
 	<script src="js/models/particle.js"></script>
 	<script src="js/models/collectible.js"></script>

+ 1 - 0
js/controller.js

@@ -36,6 +36,7 @@ Controller.prototype.spawn_collectibles = function(){
 		collectible.position = rnd_pos;
 	}
 	this.collectibles.push(collectible);
+    this.add_view(new ParticleView(collectible));
 }
 
 Controller.prototype.start_game = function(){