Giter Site home page Giter Site logo

lovrohodak / kurve Goto Github PK

View Code? Open in Web Editor NEW

This project forked from simonalling/kurve

0.0 0.0 0.0 1.08 MB

Achtung, die Kurve! in JavaScript

Home Page: https://kurve.se

License: GNU Affero General Public License v3.0

CSS 21.66% HTML 6.51% JavaScript 71.83%

kurve's Introduction

Achtung, die Kurve! in JavaScript

The aim of this project is to create an HTML5/JS remake of the original Achtung, die Kurve! from 1995.

Play

The game will automatically scale itself up as much as possible; fullscreen is recommended for the best experience.

Contribute

Preparations

We use Webpack with Babel to transpile and pack all JS into one single file, zatacka.min.js.

To install the necessary software, first install Node and then run

npm install

in the root directory of this repo. This will install all the Node packages you need.

Build

To build, run

npm run build

in the root of this repo.

To run a development server:

npm run watch

The difference is that build will write compiled JS files to disk, and you can see your changes simply by opening ZATACKA.html or index.html.

watch, on the other hand, does not write to disk, and you must visit localhost:8080 in your browser to see your changes. The advantage is that everything (both JS and CSS) is recompiled automatically when a file is modified.

Code structure

All JavaScript source files can be found in src/js/; SASS in src/css/.

js/ (in the root) contains compiled JS.

The main JS file is Main.js. It is responsible for creating a Game and supplying a config, a Renderer and a GUIController to it. It also adds Players to the Game and forwards key events to it.

Game.js controls the game logic. It knows which Players are in the game and handles their interaction with eachother and the playing field, and it controls progress throughout the individual rounds. The Game constructor must be passed a config object, a Renderer, and a GUIController.

Player.js describes a single player. It knows whether it is alive, where it is, where and how fast it is going, its score, and what Game it is attached to.

Renderer.js does all the drawing on the actual playing field. Game.js does not draw anything; it just calls upon its Renderer to do that.

GUIController.js controls the scoreboard and additional GUI features, such as hiding the lobby and showing the results when the game ends. When a player's score is changed, the Game will tell its GUIController to update the scoreboard entry of that player.

src/js/lib/ contains general libraries and help functions.

dev/ may only contain development tools that are not needed at runtime, such as test suites or code generators.

kurve's People

Contributors

simonalling avatar dependabot[bot] 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.