Giter VIP home page Giter VIP logo

spider-chase's Introduction

Spider Chase

Project Six of Openclassrooms "Frontend" course

It is a simple game where two spiders walk on the square board consisting of empty fields, fields with weapon and fields with obstacles (they can't step on these). Game was design with only one external library - jQuery.

Spider Chase online - see how it works

Game logic

Javascript code is organizad on following layers:

  1. Game.js includes
  • Game object - handles board initialization, players, weapons and actions like moving, range checking, battle
  • Player object - stores and updates player position, weapon, range, power and health
  • Board object - stores and updates board of empty fields, weapon, and obstacles
  • Weapon object - stores and updates filed position, power
  • NextStep object - stores and updates actual player possible movement path
  1. Display.js includes
  • Display object - responsible for displaying and hiding board, players and weapons by adding or removing css classes
  • Modal object - displays and hides different type modal windows depending on game state
  1. Handle.js includes
  • Handle object - responsible for game logic and event loop as well as battle decision update
  1. App.js initialize and strats the game

Styling

Styling bases on css classes which are organized according to game objects or display functions.

  • board.css - defines all classes for board, fields, obstacles
  • weapon.css - defines classes for different weapons
  • player.css - defines classes for player and animation for player actions - movement in different directions, staying, attacking, defending
  • modal.css - defeines classes for modal window
  • title.css - defeines classes for game title
  • information.css - defines classes for information section aside the board
  • copyright.css - defeines classes for copyrioght information

Technological stack

I used small Toshiba laptop with:

  • MS Windows 10
  • Atom editor installed supported by jslint package.
  • Browsers Chrome, Opera, Firefox with inspector

All elements were designed manualy, and then tested in online services, like:

To do

  • experiment with different backgrounds
  • add social media support
  • implement websocket for online playing experience
  • make this game again with React or/and Canvas

spider-chase's People

Contributors

kristoferek avatar

Stargazers

 avatar  avatar

Watchers

 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.