Create a Scoreboard

Learn how to make a super cool zombie game

2. In game.js delete the old getCharacters() code and ad the new code in the create() function.
code/client/src/game.js

		g.getCharacters('players',
		(player) => {
			g.handleLeaderboard('players', 'Scoreboard');
			if (player.id === g.myId()) {
				g.cameraFollow(player.sprite);
			}},
		(player) => g.handleLeaderboard('players', 'Scoreboard'),
		(id, attr, value) => {
			if (attr == 'filled' && id == 'filled' &&
				value <= 1 && player.id === g.myId()) {
					location.reload();
				}
			g.handleLeaderboard('players', 'Scoreboard');
		});


3. In room.js, in the onupdate function, inside of your handleCollision method add a character with a score of 100 using the getACharacter() function.
code/server/rooms/room.js

	g.getACharacter('players', bullet.playerId).score += 100;

Now the scoreboard should be set up and our game is almost finished!


Download your zip, and upload it to blobbert.io, and you should have a background!


Add HowTo Screen
Zombie Game

Need Help?

Proofread your code, check with your team and classmates, and if you’re still stuck!

Click Here for Help