Giter VIP home page Giter VIP logo

zepp's Introduction

zepp ๐Ÿ‘ฝ

to make an .io game

note: this is not nearly finished, and not nearly tested either: view at your own risk

๐ŸŒด ๐ŸŒด ๐ŸŒด ๐ŸŒด ๐ŸŒด ๐ŸŒด ๐ŸŒด ๐ŸŒด

todos

  • leaderboard -
  • death screen
  • test everything properly
  • e2e
  • update readme with descriptions of major features etc
  • webpack for node
  • error checking
  • catch websocket connection failures
  • update loops with map/filter/reduce
  • refactor & rewrite server
  • setup game rooms properly
  • multiple servers / CoreOS & Docker
  • Jenkins & Docker / other CI
  • Server setup automation
  • select best server based on geo location
  • better state management
  • react menu / setup for menu expansion
  • select skins
  • remove players client & from gridSize
  • canvas optimisations

logic issues

  • missing square when player joins

  • find safe area to start at

  • check collisions -

  • second player capture area bug? -

  • Socket lag in firefox when run on droplet

  • fix performance hit with flood fill

  • double speed

  • setup grid & server

  • start ticking

  • clients connect and are setup, basic info is pushed back to them

  • push ticking updates to all sockets in open game rooms

  • clients respond with movements, players & grid kept updated

  • when dead, a player is moved out of the active game room into stasis


notes

var cssColours = [ '#f5a3a3', '#ed5e5e',

'#15a7e4', '#62d1ff',

'#7d62ff', '#9985f9',

'#d156ff', '#e6a2ff',

'#ff61a7', '#ff9ac7',

'#ff7257', '#ff9f8c',

'#efa158', '#ffc793',

'#c4ff5a', '#daff97',

'#8fff76', '#b4ffa3',

'#57ffcc', '#8dffdc',

'#53f5e9', '#96fff7' ]

// var req = express.connection // var ip = req.headers['x-forwarded-for'] || // req.connection.remoteAddress || // req.socket.remoteAddress || // req.connection.socket.remoteAddress;

--drawing tiled images (skins?)

preload png images

// var images = [] // function loadImages (image) { // var img = new Image(40) // img.src = 'img/40x50head.png' // images.push(img) // img = new Image() // img.src = 'img/tile1.png' // images.push(img) // }

draw tiles

// context.drawImage(img,sx,sy,swidth,sheight,x,y,width,height); // img is 70x70 // square is 35x35 // var img = images[1] // var clipX = (col % Math.floor(img.width / squareSize)) * squareSize // var clipY = (row % Math.floor(img.height / squareSize)) * squareSize // canvas2d.drawImage(img,clipX, clipY, squareSize, squareSize, col * squareSize, row * squareSize, squareSize, squareSize)

not clearing rect anymore, just drawing a grey one on top

// canvas2d.clearRect(0, 0, canvas.width, canvas.height)

floating K.O text on death

// var player = getPlayerByID(userID) // var pos = playerHeadPosition(player) // canvas2d.font = '30px sans-serif' // var x = pos[0] * squareSize // var y = pos[1] * squareSize // canvas2d.fillStyle = '#1b1a1d' // canvas2d.fillText('K.O.', x + 5, y + 5) // canvas2d.fillStyle = cssColours[player.colourPrimary] // canvas2d.fillText('K.O', x, y)

function preRenderBackground () { // backgroundCanvas = document.createElement('canvas') // backgroundCanvas.width = canvas.width // backgroundCanvas.height = canvas.height // var ctx2 = backgroundCanvas.getContext('2d') // ctx2.fillStyle = 'grey' // var x = gridSize * squareSize // ctx2.fillRect(-10, -10, x + 20, x + 20) // ctx2.clearRect(0, 0, x, x) }

zepp's People

Contributors

null-operator 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.