fractalnet

module
v0.0.0-...-adc953a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 3, 2018 License: Apache-2.0

README ¶

FractalNet

Build Status GoDoc Go Report Card

Message Examples

Location of WebSocket:

/ws

Notes:

  • The name of the field does matter.
  • The order of the fields does not matter.

Chat

{
    "EventType": "Chat",
    "EventBody": "Hello World!",
}    

Drop Bomb 💣 onto a Square (for the Game of War)

Note: The "Value" field must be either 1 or 2. It corresponds to Player 1 or Player 2. Without entering that field, the message might be ignored.

{
    "EventType": "LaBomba",
    "Value": 1,
    "Location": 
    {
        "X": 0,
        "Y": 47,
    }
}    

Update to the Next Generation (Life Update)

{
    "EventType": "LifeUpdate",
}

Directly Change a Square (Life Change)

Currently, the Grid is 48 x 48. So the Location coordinates x and y are in the range of [0, 47].

Values match with different kinds of squares (can depend on the game). For example, in "The Game of War":

  • 0: neutral (empty)
  • 1: player 1
  • 2: player 2
  • 3: fire
  • 4: fading fire / fallout zone
  • 5: '''
  • 6: '''
{
    "EventType": "LifeChange",
    "Value": 1,
    "Location": 
    {
        "X": 0,
        "Y": 47,
    }
}    

Directly Change Multiple Squares

When you want many changes to be made within the same game tick:

{
    "EventType": "ChangeMany",
    "Changes": 
    [
        {
            "Value": 1,
            "Location": 
            {
                "X": 1,
                "Y": 10
            }
        },
        {
            "Value": 2,
            "Location": 
            {
                "X": 2,
                "Y": 20
            }
        }
    ]
}   

Reset & Randomize Game Board

Fresh Game

A simple Reset of the game board, where every square becomes either player 1 or player 2.

{
    "EventType": "FreshGame"
}    
Randomize Placements

The "Integer" Field is optional. It is the number of squares to that will be placed on the board after the reset. For example, if you set the "integer" field to 1: Then 1 square will be created at a random location on the game board, and will be randomly given to either player 1 or player 2.

{
    "EventType": "LifeRandomize",
    "Integer": 500,
}    

Directories ¶

Path Synopsis
Special Test of Cellular Automata with 3 numbers.
Special Test of Cellular Automata with 3 numbers.
gameofwar
=========================================================================== > Game of Life and War ___________________________________________________________________________ Grid Square Types 0 = Neutral 1 = Player 1 2 = Player 2 3 = Red 4 = Pink [5 - 10] = Red, in different Credits - Joshua Fan - The Idea for the "Game of War" - Golang.org - Code Snippets for Implementation of Conway's Game of Life - John Horton Conway - For inventing the "Game of Life" ___________________________________________________________________________ ===========================================================================
=========================================================================== > Game of Life and War ___________________________________________________________________________ Grid Square Types 0 = Neutral 1 = Player 1 2 = Player 2 3 = Red 4 = Pink [5 - 10] = Red, in different Credits - Joshua Fan - The Idea for the "Game of War" - Golang.org - Code Snippets for Implementation of Conway's Game of Life - John Horton Conway - For inventing the "Game of Life" ___________________________________________________________________________ ===========================================================================
Special Test of Cellular Automata with 3 numbers.
Special Test of Cellular Automata with 3 numbers.
messages.go converts external and internal game messages into useful forms.
messages.go converts external and internal game messages into useful forms.
package namegen is for randomly generating usernames!
package namegen is for randomly generating usernames!

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL