PHP Classes

PHP Darts Counter Game: Manage darts games with multiple players

Recommend this page to a friend!
  Info   View files Example   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog (1)    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 56 All time: 10,563 This week: 57Up
Version License PHP version Categories
ycr_task7 1.0The PHP License5PHP 5, Games


This package can manage darts games with multiple players.

It provides a game class that can join several players passing their names.

The game class can also process player shots by accounting for the points they earned in each dart shot.

It can also return the current standing of all players and determine if the game ended.

Innovation Award
PHP Programming Innovation award winner
April 2022
Darts is a popular game that allows several people to play by throwing dart arrows at a target board. Each player can earn points depending on how close the hands stick to the center of the board.

This package can help manage each player's score until each game ends to determine who won.

This way, the package can help keep track of the game's progress accurately, so the players do not have to remember how many points each player is scoring.

Manuel Lemos
Picture of Alex McArrow
  Performance   Level  
Name: Alex McArrow <contact>
Classes: 3 packages by
Country: Russian Federation Russian Federation
Age: 40
All time rank: 4095115 in Russian Federation Russian Federation
Week rank: 284 Up11 in Russian Federation Russian Federation Up
Innovation award
Innovation award
Nominee: 2x

Winner: 1x



require './loader.php';


$drop_limit = 5;
$player_list = [
$radiuses = [
1 => 10,
5 => 5,
10 => 1
$max_radius = max(array_keys($radiuses));

$pointcounter = new PointCounter();
$game = new Game($pointcounter);

foreach (
$player_list as $value) {

foreach (
$player_list as $value) {
    for (
$i = 0; $i < $drop_limit; $i++) {
$x = mt_rand(0, $max_radius * 100) / 100;
$y = mt_rand(0, $max_radius * 100) / 100;
$game->drop_dart($value, $x, $y);


  Files folder image Files  
File Role Description
Files folder imageDarts (2 files)
Accessible without login Plain text file dev.php Example Example script
Accessible without login Plain text file loader.php Aux. Auxiliary script

  Files folder image Files  /  Darts  
File Role Description
  Plain text file Game.php Class Class source
  Plain text file Player.php Class Class source

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:10,563
This week:57Up