-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
131 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// computeDelta(position: bigint, newColor: Color): {newDelta: number; newEnemymask: number} { | ||
// const {x, y} = bigIntIDToXY(position); | ||
// const data = { | ||
// newDelta: 0, | ||
// newEnemymask: 0, | ||
// }; | ||
|
||
// { | ||
// const upPosition = xyToBigIntID(x, y - 1); | ||
// const color = this.getCellInMemory(upPosition).color; | ||
// if (color != Color.None) { | ||
// const enemyOrFriend = color == newColor ? 1 : -1; | ||
// if (enemyOrFriend < 0) { | ||
// data.newEnemymask = data.newEnemymask | 1; | ||
// } | ||
// data.newDelta += enemyOrFriend; | ||
// } | ||
// } | ||
// { | ||
// const leftPosition = xyToBigIntID(x - 1, y); | ||
// const color = this.getCellInMemory(leftPosition).color; | ||
// if (color != Color.None) { | ||
// const enemyOrFriend = color == newColor ? 1 : -1; | ||
// if (enemyOrFriend < 0) { | ||
// data.newEnemymask = data.newEnemymask | 1; | ||
// } | ||
// data.newDelta += enemyOrFriend; | ||
// } | ||
// } | ||
|
||
// { | ||
// const downPosition = xyToBigIntID(x, y + 1); | ||
// const color = this.getCellInMemory(downPosition).color; | ||
// if (color != Color.None) { | ||
// const enemyOrFriend = color == newColor ? 1 : -1; | ||
// if (enemyOrFriend < 0) { | ||
// data.newEnemymask = data.newEnemymask | 1; | ||
// } | ||
// data.newDelta += enemyOrFriend; | ||
// } | ||
// } | ||
// { | ||
// const rightPosition = xyToBigIntID(x + 1, y); | ||
// const color = this.getCellInMemory(rightPosition).color; | ||
// if (color != Color.None) { | ||
// const enemyOrFriend = color == newColor ? 1 : -1; | ||
// if (enemyOrFriend < 0) { | ||
// data.newEnemymask = data.newEnemymask | 1; | ||
// } | ||
// data.newDelta += enemyOrFriend; | ||
// } | ||
// } | ||
// return data; | ||
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
$01: 2 | ||
$02: 0 | ||
$03: 0 | ||
------------------------- | ||
| | | | | | | ||
| | | | | | | ||
------------------------- | ||
| R3 | R4 | R0 | B0 | | | ||
| 02 | 02 | 03 | 03 | | | ||
------------------------- | ||
| | B0 | R0 | | | | ||
| | 02 | 02 | | | | ||
------------------------- | ||
| | | | | | | ||
| | | | | | | ||
------------------------- | ||
| | | | | | | ||
| | | | | | | ||
------------------------- | ||
+ | ||
------------------------- | ||
| | | | | | | ||
| | | | | | | ||
------------------------- | ||
| | |+B | | | | ||
| | | 01 | | | | ||
------------------------- | ||
| | |+B | | | | ||
| | | 01 | | | | ||
------------------------- | ||
| | | | | | | ||
| | | | | | | ||
------------------------- | ||
| | | | | | | ||
| | | | | | | ||
------------------------- | ||
= | ||
------------------------- | ||
| | | | | | | ||
| | | | | | | ||
------------------------- | ||
| R4 | R3 | B2 | B0 | | | ||
| 02 | 02 | 01 | 03 | | | ||
------------------------- | ||
| | B0 | B3 | | | | ||
| | 02 | 01 | | | | ||
------------------------- | ||
| | | | | | | ||
| | | | | | | ||
------------------------- | ||
| | | | | | | ||
| | | | | | | ||
------------------------- | ||
$01: 0 | ||
$02: 2 | ||
$03: 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
import {parseColorV4} from '$lib/webgl/color'; | ||
|
||
export const COLORS = [0x000000, 0xef476f, 0xffd166, 0x06d6a0, 0x118ab2, 0x118000, 0x000000]; | ||
export const COLORS = [0x000000, 0x00a4dd, 0xff6e71, 0x27d17c, 0xd3d66d, 0x9660c8, 0x3d3d3d]; | ||
|
||
export const COLORS_VEC4 = [ | ||
[0, 0, 0, 1], | ||
parseColorV4('ef476f'), | ||
parseColorV4('ffd166'), | ||
parseColorV4('06d6a0'), | ||
parseColorV4('118ab2'), | ||
parseColorV4('118000'), | ||
parseColorV4('000000'), | ||
parseColorV4('00a4dd'), | ||
parseColorV4('ff6e71'), | ||
parseColorV4('27d17c'), | ||
parseColorV4('d3d66d'), | ||
parseColorV4('9660c8'), | ||
parseColorV4('3d3d3d'), | ||
]; |