Giter VIP home page Giter VIP logo

connect4's Introduction

CSC309 Assignment 3 (April 4, 2014)

Instructions

  • IMPORTANT: Replace the .htaccess file in the connect4 folder with your own (to remove index.php from URLs)
  • Replace application/config/database.php with your own
  • From the main page, register an account (note the Captcha securimage)
  • If you register successfully, you will be directed to the login page
  • Enter your password and you will go to the lobby
  • If there are other others online they will be shown in the lobby. Otherwise you can log out and check back later
  • If there's another player online, click his name (shown in the lobby) to invite him to a match. Or he can invite you (you will be prompted to accept)
  • Play Connect 4 until the match is over (someone wins or there is a tie)
  • A JS alert window pops up when the match is over.
  • When a match ends, click "Back to game lobby" if you wish to play again
  • Or click "log out" to end your session completely.

Controllers that we modified

  • account.php: Added securimage captcha function and a callback validation
  • arcade.php: Players show as online in the lobby if they quit a game mid-match
  • board.php: Functions for handling gameplay using AJAX, JSON, and transactions

Views that we modified

  • newForm.php: Add securimage captcha functionality to the registration form
  • loginForm.php: Make login page aesthetically pleasing, with game instructions
  • availableUsers.php: Handle cases of players dropping mid-match
  • board.php: Core JS gameplay functions (rendering board, making moves, sync)
  • Where possible, we applied template.css to as many views as possible

Models that we modified

  • match_model.php: Added a function to update the game board state

New libraries

  • application/libraries/securimage
  • Downloaded the Securimage PHP library from their website as instructed
  • We did not write this library and do not claim ownership
  • We removed the audio part of the library to save space

New CSS files

  • css/board.css: Styling for the 7x6 game board (it is a HTML table with square cells)
  • css/template.css: Styling for overall aesthetics (provided by Professor De Lara)

New JavaScript files

  • js/detectWin.js: Called by the board.php view to see if the latest move made by a player results in a victory. Checks for 4 matches in 6 different directions (row, column, 4 diagonals)

connect4's People

Contributors

4cylinder avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.