PHP Classes

Find the Weird Duck PHP Game: Implements a Web version of the Find the Duck game

Recommend this page to a friend!
  Info   View files Example   Screenshots Screenshots   View files View files (7)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog (1)    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 55 This week: 1All time: 10,546 This week: 560Up
Version License PHP version Categories
findtheduckgame 1.0Freeware5PHP 5, Graphics, Games, Global
Description 

Author

This package implements a Web version of the Find the Duck game.

The game challenges the player to find the 'strange' duck on the board.

The player starts with only one duck on the game board (the strange duck).

The page refreshes when the player clicks on the duck, and four ducks appear. Only one duck is the 'strange duck.' The player has to find that duck.

When the player clicks on the correct strange duck, more ducks appear, and the game gets harder to find this duck.

If the player clicks on the wrong duck (a regular duck), fewer ducks will be visible, and it will be easier to find the 'strange duck.'

The game has no real ending. It will balance once the player can no longer find the 'strange duck.' The player score will be the level that was reached.

This package can make the game board appear on a Web page and handle user interactions.

Innovation Award
PHP Programming Innovation award nominee
February 2023
Number 2
Games help train people to solve challenging problems.

The Find the Duck game presents a challenging problem which is to find something that looks wrong in certain situations.

In the case of this game, what is wrong is what looks different from the average.

Sometimes what is different not wrong, but it can be what is more valuable. This is how people spot new opportunities to solve problems in a better way for other people.

This package implements a PHP version of the Find the Duck Game.

This simple game can help managers find people who are good at paying attention to details in projects that may be causing significant problems that need to be solved.

Manuel Lemos
Picture of Martijn Waeyenbergh
  Performance   Level  
Name: Martijn Waeyenbergh <contact>
Classes: 7 packages by
Country: Belgium Belgium
Age: 44
All time rank: 312217 in Belgium Belgium
Week rank: 106 Up1 in Belgium Belgium Up
Innovation award
Innovation award
Nominee: 3x

Winner: 1x

Example

<?php
   
// index.php
   
if(isset($_GET['level']) && !empty($_GET['level'])){
       
$level = $_GET['level'];
    }else{
           
$level = 1;
    }

?>

<style>
.pool{
    width: 500px;
    height: 500px;
    border: 1px solid black;
    margin: 0 auto;
}
.pool img{
    width: <?=(500/$level)?>px;
    height: <?=(500/$level)?>px;
    float: left;
}
</style>


Current Level: <?=$level?><br>
<div class='pool'>
    <?php

        $numberOfDucks
= $level * $level;
       
$positionStrangeDuck = mt_rand(0,$numberOfDucks-1);
       
$ducks = array("blauw","groen","rood","geel");
        for(
$i=0;$i<$numberOfDucks;$i++){
            if(
$i == $positionStrangeDuck){
               
$newLevel = $level + 1;
             echo
"<a href='?level=$newLevel'>
                     <img src='./eend_vreemd.jpg'>
                    </a>"
;
            }else{
               
$newLevel = $level - 1 ;
            
$randomDuck = $ducks[mt_rand(0,3)];
             echo
"<a href='?level=$newLevel'>
                     <img src='./eend_"
.$randomDuck.".jpg'>
                    </a>"
;
            }

           
        }

   
?>
</div>


Screenshots  
  • screenshot.png
  • screenshot1.png
  • screenshot2.png
  Files folder image Files  
File Role Description
Plain text file class.duck.php Class basic class
Accessible without login Image file eend_blauw.jpg Data image
Accessible without login Image file eend_geel.jpg Data image
Accessible without login Image file eend_groen.jpg Data image
Accessible without login Image file eend_rood.jpg Data image
Accessible without login Image file eend_vreemd.jpg Data image
Accessible without login Plain text file index.php Example main script file

 Version Control Unique User Downloads Download Rankings  
 0%
Total:55
This week:1
All time:10,546
This week:560Up