Files
lasertag/README.md

2.8 KiB

Laser Tag

This uses a programmer to setup the game. In addition is supports adding bases, health/ammo packs, etc.

Overview of gameplay

Use programmer to setup each gun. The programmer will send a IR signal containing the game variables to each of the guns.

Guns then send a IR signal to other guns to indicate shooting. Each guns stores its own health and ammo in addition to game constants (eg. Game Mode, Team, Auto reload, etc).

Each team can have a base which will be sending out a constant signal. Any player of the same team that is within range of the base will be able to respawn and/or heal.

Optional packs act similar to bases but are not team specific. They can be used to heal or reload ammo.

Signals

I'm thinking of using a 4 byte signal to send any data. The first byte will be the sender's ID, the second byte will be the command, and the last two bytes will be any other data.

Sender IDs

Reserved Sender Description ID Notes
Programmer Programmer 0x00
Team Base Team Base for respawns (2nd digit is team ID) 0x10-1F This allows for up to 16 teams
Packs Health/ammo packs (2nd digit is pack type) 0x20-0x2F This allows for up to 16 pack types
Gun Gun ID's can be the same for teams 0xE0-0xFF Might need to allocate more if we want more than 32 players

Commands that guns receive

Command 1st byte 2nd byte 3rd byte 4th byte
Set Gun option Sender ID (should be programmer) 0x00 Option Type Option Value
Shot Sender ID (gun or optionally other weapons such as grenades) 0x10 Damage Gun type (for optional statuses)
Respawn Sender ID (should be team base) 0x11 Optional data such as delay 0x00
Pack Sender ID (should be pack) 0x12 Pack Type Pack Value

Commands that guns send

Command 1st byte 2nd byte 3rd byte 4th byte
Shot Sender ID (gun) 0x10 Damage Gun type (for optional statuses)

Gun options

Option ID Description Values Notes
ID 0x00 Gun ID 0x00-0x1F This corresponds to Gun IDs 0xE0-0xFF
Ammo Capacity 0x01 Max ammo 0x00-0xFF
Health Capacity 0x02 Max health 0x00-0xFF
Auto Reload 0x03 Auto reload 0x00-0x01
Auto Respawn 0x04 Auto respawn 0x00-0x01
Gun Type 0x05 Gun type 0x00-0xFF This is used to identify the gun type for optional statuses
Starting Health 0x10 Starting health 0x00-0xFF To be used when the game starts or gun respawns
Starting Ammo 0x10 Starting ammo 0x00-0xFF As above