1.0.2 • Published 6 months ago

@yantra-core/server v1.0.2

Weekly downloads
-
License
Copyright Yantra ...
Repository
-
Last release
6 months ago

@yantra-core/server

Mantra Server

see: ./server.js file Additional Documentation can be found here: https://github.com/yantra-core/mantra

// Import Mantra
import { Game } from '@yantra-core/mantra'

// Initializing the Game
const game = new Game({});

// Use Plugins to customize the Game
game
  .use(new MatterPhysics())
  .use(new CollisionPlugin())
  .use(new EntityFactory())
  .use(new EntityInputPlugin())
  .use(new EntityMovementPlugin(new AsteroidsMovement()))
  .use(new BulletPlugin())
  .use(new WebSocketServer());

game.listen(8888);
console.log('WebSocket server started on port 8888');

Docker

docker build . -t mantra && docker run -p 80:80 mantra