Giter VIP home page Giter VIP logo

cattle-bity's Introduction

Build status

Note: mobile not supported

Screenshots

Description

Clone of Battle City by Namco (1985) written from scratch in TypeScript.

Project is not commercial and was created for learning purposes only.

Features

  • Single player mode
  • Multi player mode (2 players on one PC)
  • Original 35 maps
  • Level editor
    • Save to JSON
    • Load from JSON to continue editing
  • Modes
    • Custom maps - load your own maps created in editor
  • Keyboard and gamepad support
  • Settings
    • Customize keybindings
    • Mute audio

License

MIT

See LICENSE.md and docs/legal/MIT

cattle-bity's People

Contributors

aailyin avatar mradionov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

cattle-bity's Issues

[Fire] Core

  • Shoot shells when 'Space' is pressed in the direction the tank is facing
  • Shell object should be available in global game state to calculate intersections with walls and other tanks
  • Shell should be disposed from memory when it goes of screen

feat(collision): Implement collision detector

  • Check collisions between all objects on the scene in game loop
for i in children
  for j in children
  • Notify collided objects about the collision, both objects should react on collision. Alternative approach is to have an abstraction to handle collisions for a couple of objects
new CollisionHandler(Tank, EnemyTank) {
  handle(a, b) {
    ...
  }
}

new CollisionHandler(Bullet, BrickWall) {
  handle(a, b) {
    ...
  }
}

refactor(render): Improve event loop to use one requestAnimationFrame for entire app

https://stackoverflow.com/questions/17103785/multiple-requestanimationframe-performance

The requestAnimationFrame binds a function call and returns the frameID. Requesting multiple frames is NOT the same like adding multiple event listeners to an event- each of your functions is called in another frame. So if you continuously (each function recalls itself recursively) request several frames you're loosing the benefit that all updates are rendered within one frame. So even if there is a high framerate animations may not look that smooth.

https://jsperf.com/single-raf-draw-calls-vs-multiple-raf-draw-calls

feat(spawn): Add spawn logic for tanks

  • Attach spawn animation to tanks
  • Bind input listeners only after tank has spawned
  • Block any sort of movements or interactions with an object which has not spawned yet

chore(*): Add TypeScript

  • Add to project
  • Make sure we have 'watch' mode
  • Don't publish transpiled JS to repo
  • Integrate with gh-pages

refactor(renderer): Add Material

Add abstraction called Material which will help extract condition from a renderer, which has different logic for Shape and DisplayObject.

refactor(render): Move all sprites to config

Image source and sprite positions are hardcoded in models.
Move sprite fragments positions to separate config so it can be easily replaced via config with another sprite or image.

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.