April 2015
Beginner
320 pages
7h 43m
English
In this chapter you’re going to create a player-versus-player mini-game called Snowball Fight (see FIGURE 19.1). The aim of the game is to hit your opponents with snowballs as many times as possible while avoiding being hit yourself or hitting players on your own team. In the game players can form opposing teams.

FIGURE 19.1 Snowball Fight
The game will be kept simple for the sake of providing example code, which you might want to adapt and extend to create your own mini-game.
The game will be started using a JavaScript function, and its duration and team structure will be passed as parameters. If no parameters are ...
Read now
Unlock full access