0.0.2 • Published 11 months ago

@attention1/game-elements v0.0.2

Weekly downloads
-
License
-
Repository
-
Last release
11 months ago

game-elements

This is an experiemental platform to distribute web (components) based games, and connect players as peers with WebRTC.

This project only involves frontend code running in the client's browser. WebRTCPeerConnection(s) can be establised with various methods, without the need of a predefined server; a user can decide how-to.

This project also tries to takes advantages of the Matrix.org ecosystem, as one of the signaling method (send-to-device), as well as by posting game results, and chats, into matrix public rooms (project chat in #attention1-game-elements:matrix.org).

Usage

It is possible to play online, offline, develop on the project, re-use & customize the project elsewhere.

Play games

To play games go on the website and select a game in the game selection menu.

Install game-elements in an other project

This project is written in HTML, CSS, Javascript, and distributed as a npm package.

Objectives

  • play with creating "simple web based games"
  • play with web-rtc peer connections
  • try to create multiplayer games (and game validation, no noone can cheat?!)
  • play with rtc-peer signaling without server

Development

  • npm i
  • npm run dev

Code is Javascript, HTML, CSS, web-components written with lit.

Project ideas

Games could be anything in the context of this app, when a game is selected from the project's UI <select/> element, a web-component with the same name is rendered (see #renderGame()).

The game should be an existing web-component/custom-element (otherwise it will be an undefined custom HTML element, with no feature). All known games are defined in the config file.

This is all experiemental and for research and enjoyment

Todo directions

  • be able to gather webrtc peers, and play game together
  • be able with peers, to "customize" a game room (like a matrix room), with widgets (games, video, audio)
  • connect peers in network (mesh etc.)
  • be able to create "teams of peers"
  • (lazy) import (and define) games as javascript modules (and web-components)
  • improve game management / definitions / events, so it can support "many games", and each can be added easily
  • improve concept of a "user" so they can customize their gaming experience, avaiable games; maybe even add games (matrix-rooms, rtc distribution)