PASTE NAVIGATION MENU CODE

Monday 7 May 2012

Phase 6: Overview of High Score System

| | with 0 comments |
Now that the basic game functionality has been implemented, it is time to implement features which make use of PHP and MySQL. The feature chosen for this game will be a high score system, complete with Facebook integration, pokes and comments.

The following flowchart summarizes the logic of the high score system.

Figure 6.1: Flowchart

Before a user can post a score, they must have a user account. This will associate a score with user and will allow the score to be replaced if the user achieves a higher score, as well as allowing comments, pokes and other features. Bearing in mind that creating yet another user account for a simple game might seem cumbersome, it was decided to allow Facebook login.

The first step was to design a login system, including registration. Facebook logins would be integrated at a later stage.

A schema was created using MySQL on the web hosting server. The schema, called 'theballgame' includes the following relations:

  • user - holds user accounts
  • score - holds the highest score achieved by the user
  • comment - comments related to a score
  • poke - pokes related to a score.


An ERD of this is shown below.

Figure 6.2: Entity Relationship Diagram (ERD)

After having played a game, the user is asked whether or not they want to submit a score. If this is so, the user is asked to login. The user can login using either a previously created game account or Facebook. Should the user wish to create a game account, a user can use the provided register form.

After the user has logged in, the system checks to see whether the user has achieved a score previously, and if so whether this is higher or lower. If the previous score was higher, the current one is ignored, otherwise the score is sent to the system.

Scores are logged in the system. Players viewing scores can sort by day, week, month and all time and will see the user's rank, name and score, as well as an image if they login via Facebook. The players can then poke each other's scores as well as comment.

The functionality outlined in this blog post will be described in the following blogs.

Post a Comment

Please enter your comments here..

0 comments: