Website Games


Games that are a part of your website can be a great source of entertainment for your visitors. A large percentage of Internet users actively play games online, and providing an outlet for fun on your site is a good way to build your traffic. But to keep your traffic returning, you should find ways to make your website games unique to your site.

With PostNuke, you can log the scores of players based on their accounts. This creates a personal connection between the user and the site. Encouraging your users to participate in a game is another way you can interact with your users as a site administrator. Website visitors like to return to living, interactive sites, and including a game helps to provide that support.

pnFlashGames

This module is similar to the Multiplayer Gaming modules covered previously in that pnFlashGames is a website enhancement for games. The actual online games themselves are separate downloads, some of which are commercial products. pnFlashGames is a module that integrates games into your PostNuke site with a universal interface, management tools, and high score tracking system.

Only games that use the proper Flash MX component work, but literally hundreds of compatible games are already available, and most are free. Adding games like these to your website, besides being entertaining, adds an extra incentive for users to return. High-scoring players want to return and check the lists to see if they have been outscored, and most every player likes to better his own score with repeat plays.

The module itself can be obtained from its official website www.pnflashgames.com. Version 0.9.92 is used in the following examples, and is fully compatible with PostNuke .750. You can also download it from the online book materials. The archive includes a clean root folder, and the module installs very easily. Copy the files into your modules directory, initialize, and activate pnFlashGames.

Ten games are included with the standard download. You can review them in the /modules/pnFlashGames/games/ directory. Additional downloaded games should be unzipped and placed in that directory for them to work. Go to the pnFlashGames Administration page using the PostNuke Administration Menu. Click the View Games link at the top to view the preinstalled games (see Figure 8.8).

Figure 8.8. Configuring your installed Flash games.


Add another game using the New Game link at the top. Add the game "Racer" with the filename racer.swf. Notice the Category drop-down list box that enables you to group your installed games as Action, Arcade, Classic, Puzzle, Racing, or Space games. Submit the form. If you want more practice working with the module, you can add the additional default games or other new games you've downloaded.

The game categories are also preconfigured for your convenience. Click the Edit Categories link in the navigation list to add or remove games from a given category. You can rename or remove any category from this screen, as well as add additional new categories.

Add games to the various categories. Create new category names if you want. You can also add the same game to multiple categories to make it easy for users to find games that seem to fit into different groups.

The Games Configuration page supplies you with a large number of self-explanatory options to customize how the pnFlashGames module works with your site.

Click the Edit Contests link to create an example event. For Contest Name, enter "Be the Pac Master!" Complete the Description field with the text "Contest to find the best Pacman player. Show us what you've got!" Change the image path to the following:

 modules/pnFlashGames/games/pacman.gif 

Now submit the form to add it to the contest listing. You now have access to the Options column where you can add games to the contest. For this contest, just add the Pacman game.

You need to add a new link to the module in your Main Menu to allow users to access the games. Edit the Main Menu block from the PostNuke Blocks Administration page. Enter "Play Games" for the Title. The module's URL is simply "{pnFlashGames}," and add a description with the text "Play online Flash games." Submit the block change and click the new menu link to see the games page (see Figure 8.9).

Figure 8.9. Browsing the Flash games on your site.


Click the View Contests link to see the "Pac Master" entry you created (see Figure 8.10). Then return to the game listing with the Browse Categories link to test out your installed Flash games with a round or two, and then go to the Blocks Administration page. pnFlashGames also comes with five block types you can create:

  • Show currently active contests Displays the ongoing contests available to users.

  • Show latest high scores Lists the recent high-scoring players.

  • Show the newest game Advertises the most recently added game.

  • Show random game Displays a random game from your installed selection. This can be set to only randomize within a specific category.

  • Show top players on your site Lists the best game players.

Figure 8.10. Competing to be the Pac Master!


Add one or more of the blocks to make it easier for users to get to the Flash games on your site.

vQuiz

vQuiz is a simple online question module similar to polling systems but with added point systems and a "Hall of Fame" to rank users with high scores. Version 1.3 is available with the book materials, or you can download recent versions from the author's site: http://tecfa.unige.ch/perso/vivian/.

The module installs easily into the root modules folder. Initialize and activate it through the module administration table. Browse to the Administration Menu and click the vQuiz link.

Create a new quiz to walk through how it works. Use "Guess the World Capitals" for the Name field. Create the quiz with six questions, each having four possible answers. Submit the form to go to the question entry page. Use the data in Table 8.2 to complete the quiz.

Table 8.2. World Capital Question Data

CAPITAL

OPTIONS

Australia

Canberra, Ottawa, Amsterdam, London

Cuba

Rome, Budapest, Havana, Bogota

Austria

Vienna, La Paz, Paris, Moscow

Japan

Oslo, Bern, Tokyo, Beijing

New Zealand

Stockholm, Brussels, Athens, Wellington

Argentina

Vienna, Buenos Aires, Brasilia, Caracas


For the correct answers, use this text as feedback: "That's Correct!" and for the wrong answers, use "Sorry! The correct answer is X."where "X" is the correct capital for that question. Set each correct answer to be worth one point and all wrong answers to zero points. The correct answers are identified in italic in Table 8.2. Your fields should look similar to Figure 8.11. Now submit the form to save your entries.

Figure 8.11. Creating a fun user quiz!


You can test the quiz through the Administration screen, but instead try out the quiz using the user interface to ensure that component is working. Activate the new quiz from the Admin Interface. Browse to the Blocks Administration page and edit the Main Menu. On a new row, enter "Take a Quiz!" for the Title, {vquiz} as the URL, and add a description with the text "Exercise your brain."

Now, it's time to try it out. Submit your block changes and click the new Menu link. Select the link labeled Run the Quiz to test the system. An example of the completed quiz with both right and wrong answers is shown in Figure 8.12.

Figure 8.12. Seeing how you did on the quiz.


An optional block is also included with the vQuiz module that displays the Hall of Fame. Browse to your site's Blocks Administration page and add the vQuiz block near the bottom of the select listing. You can choose how many users to display in the block, and each name is displayed with a little trophy icon placed next to it.



    PostNuke Content Management
    PostNuke Content Management
    ISBN: 0672326868
    EAN: 2147483647
    Year: 2003
    Pages: 207
    Authors: Kevin Hatch

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net