Skip to content
Snippets Groups Projects
Commit 7da96cb4 authored by Lester's avatar Lester
Browse files

i added score but needs to be updated per room

parent 9666a5c4
No related branches found
No related tags found
No related merge requests found
......@@ -50,6 +50,14 @@ let mobList = [];
let bounds;
let playerCollided;
let score = 0;
let something = "Score:" + score;
let txt = new PIXI.Text(something,{fontFamily: "Arial",fontSize: 15, fill: "#FFFFFF"});
txt.x = app.view.width / 10;
txt.y = app.view.height / 4;
txt.anchor.set = 0.5;
app.stage.addChild(txt);
let nextX;
let nextY;
......@@ -429,6 +437,8 @@ function bulletCollider(delta){
app.stage.removeChild(map.currentRoom.enemies[j].sprite);
map.currentRoom.numOfEnemies--;
map.currentRoom.enemies.splice(j, 1);
score += 100;
txt.text ="Score:" + score;
}
}
}
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment