-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GH-40 Create canvasTexture to track fog changes
- Creates a `CanvasTexture` that contains the updates to the fog of war, based on both gameObject logic & cached old positions
- Loading branch information
Showing
19 changed files
with
707 additions
and
47 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,9 @@ | ||
nvmrc=~/.nvm/nvm.sh | ||
if [ -e $nvmrc ]; then | ||
source $nvmrc | ||
nvm install | ||
fi | ||
|
||
PATH_add node_modules/.bin | ||
|
||
export NODE_ENV=dev |
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,5 @@ | ||
.idea | ||
node_modules | ||
coverage | ||
dist | ||
yarn-error.log |
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,4 @@ | ||
src/ | ||
webpack/ | ||
public/ | ||
.idea/ |
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 @@ | ||
v13.6.0 |
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,8 @@ | ||
{ | ||
"useTabs": false, | ||
"printWidth": 160, | ||
"tabWidth": 2, | ||
"singleQuote": true, | ||
"trailingComma": "es5", | ||
"jsxBracketSameLine": true | ||
} |
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 |
---|---|---|
|
@@ -58,5 +58,6 @@ | |
"webpack-cli": "^3.3.10", | ||
"webpack-dev-server": "^3.10.1", | ||
"webpack-merge": "^4.2.2" | ||
} | ||
}, | ||
"dependencies": {} | ||
} |
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
23 changes: 23 additions & 0 deletions
23
packages/phaser3-fog-of-war/src/demo/sprite/demo-sprite.js
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,23 @@ | ||
import Phaser from 'phaser'; | ||
import { v4 } from 'uuid'; | ||
|
||
const TEMP_SPEED = 250; | ||
|
||
export default class DemoSprite extends Phaser.GameObjects.Sprite { | ||
viewDistance = 200; | ||
|
||
constructor(scene, x, y) { | ||
super(scene, x, y, 'enabled-sprite'); | ||
this.id = v4(); | ||
|
||
scene.gameObjectEnginePlugin.addEngineToGameObject(this, { | ||
rotateOnMove: false, | ||
rotateSpeed: 10, | ||
speed: TEMP_SPEED, | ||
gameObjectStoppingDistance: 128, | ||
}); | ||
scene.add.existing(this); | ||
scene.physics.world.enable(this); | ||
this.setInteractive(); | ||
} | ||
} |
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,5 @@ | ||
export const DEBUG_PREVIEW_COLOR = 0x00ff00; | ||
export const DEBUG_SELECTION_COLOR = 0xff00ff; | ||
export const IMAGE_DEPTH = 9999; | ||
export const BYTE_LENGTH = 255; | ||
export const VIEW_DISTANCE_BUFFER = 10; |
Oops, something went wrong.