1.0.5 • Published 3 years ago

@sem_5_pi_grupo100/sgrai-game v1.0.5

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

SGRAI - Representacao gráfica da rede social

  • 1161360 - Alexandre Ametller
  • 1141270 - Álvaro Franco
  • 1180005 - Breno Leonhardt Pacheco
  • 1020507 - Bruno Resende

Install

npm install @sem_5_pi_grupo100/sgrai-game

Import

import * as Game from '@sem_5_pi_grupo100/sgrai-game';
Game.start(data);

Embed

<html lang="en">
  <head>
    <title></title>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <link href="./build/style.css" rel="stylesheet" />
    <style>
      #canvas {
        background-color: #ccccff;
        width: 90vw;
        height: 90vh;
        margin: auto;
        margin-top: 5vh;
      }
    </style>
  </head>
  <body>
    <div id="canvas" />
    <script type="module">
      import * as Game from "/node_modules/@sem_5_pi_grupo100/sgrai-game/build/bundle.min.js";
      Game.start();
    </script>
  </body>
</html>

Develop

    # install local server
    npm install
    npm start

    # build module
    npm run build

    # publish package
    npm publish --access public

API

// Game.start(data = DEFAULT_DATA)
//   inicia o jogo em um div com id="canvas" 
//
// Exemplo de data:
const data = {
  "jogador": 0,
  "rede": [
    {
      "id": 1,
      "name": "Anna",
      "email": "anna@gmail.com",
      "tags": ["musica", "video"],
      "connections": [
        { "id": 2, "force": 20 },
        { "id": 4, "force": 20 },
        { "id": 6, "force": 20 },
        { "id": 7, "force": 20 },
      ]
    },
    {
      "id": 2,
      "name": "João",
      "tags": ["cinema", "video", "musica"],
      "email": "joao@gmail.com",
      "connections": [
        { "id": 1, "force": 20 },
        { "id": 3, "force": 20 },
      ]
    }
    // ...
}
1.0.5

3 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago