Quantcast
Channel: Wiihacks - Nintendo Wii Hacks Community - Blogs - DiscMurderer
Viewing all articles
Browse latest Browse all 4

More PHP Fun : Star Fox 64 Route Randomizer

0
0
Hello everyone ! Over this past Summer I had a huge N64 kick, and played a ton of Star Fox 64, and just for the heck of it I wrote a small web application using PHP that spits out a random route for you to take. When you load/refresh the page, you will get a new route. All the visuals in this are taken from the actual game, doubled in size to make it easier to see.

Example Image



As for how this all works, I randomly generate a number between 2 and 102, and then check whether that number is even or odd, that determines which area is next on the route.

Code:
$pathVal = mt_rand(2,102);
  
  if ($pathVal % 2 == 0)
  {
    $missionTwo = "Sector Y Combat Zone";

    // Huge branch of nested if/else statements following the same process, setting the $missionThree - $missionSix variables
  }
  else
  {
    $missionTwo = "Meteo";

    // Same as above, nested if/else statements    
  }
This is the entire source, for those who are interested. I'm fairly certain that there was a better way to do this than to generate a new random number per statement.

Spoiler



If you want the entire thing for download, which includes the images and the source, you can get it here

Viewing all articles
Browse latest Browse all 4

Latest Images

Trending Articles





Latest Images