TinkerStorm / interaction-prototypes

A Discord interaction prototype preparing to lay the foundations of a game service.
https://discord.gg/z5DPVHNBuw
GNU General Public License v3.0
2 stars 0 forks source link

Patch index calculation for field wrap #36

Open sudojunior opened 1 year ago

sudojunior commented 1 year ago

https://github.com/TinkerStorm/interaction-prototypes/blob/83102eb62bbdadc02021189a9cc16c2bf8291106/src/util/game.ts#L60-L61

floor((index / 15) * 3) floor((index / game.players.length) * 3) floor((index / game.totalSlots) * 3) - or maxPlayers