소스 검색

collectibles bugfix

Dima Mironov 10 년 전
부모
커밋
4d7fb43108
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      js/controller.js

+ 1 - 1
js/controller.js

@@ -30,7 +30,7 @@ Controller.prototype.update_views = function(){
 Controller.prototype.spawn_collectibles = function(){
 Controller.prototype.spawn_collectibles = function(){
 	var collectible =get_random_element_with_probabilities(this.possible_collectibles);
 	var collectible =get_random_element_with_probabilities(this.possible_collectibles);
 	if (!collectible) return;
 	if (!collectible) return;
-	collectible = Object.create(collectible);
+	collectible = Object.create(collectible.collectible);
 	var rnd_pos = this.get_random_position();
 	var rnd_pos = this.get_random_position();
 	if (this.is_position_free(rnd_pos)) {
 	if (this.is_position_free(rnd_pos)) {
 		collectible.position = rnd_pos;
 		collectible.position = rnd_pos;