diff --git a/app/react-components/ecs.jsx b/app/react-components/ecs.jsx index e96cc5e..72c5554 100644 --- a/app/react-components/ecs.jsx +++ b/app/react-components/ecs.jsx @@ -60,23 +60,16 @@ export default function EcsComponent() { Math.round(Camera.y - RESOLUTION.y / 2), ]; return ( - - - + + + {isTool && ( )} diff --git a/app/react-components/entities.jsx b/app/react-components/entities.jsx index 14c1838..a839724 100644 --- a/app/react-components/entities.jsx +++ b/app/react-components/entities.jsx @@ -26,7 +26,7 @@ function Crosshair({x, y}) { ); } -export default function Entities({entities, x, y}) { +export default function Entities({entities}) { const renderables = []; for (const id in entities) { const entity = entities[id]; @@ -45,8 +45,8 @@ export default function Entities({entities, x, y}) { ); } return ( - + <> {renderables} - + ) } \ No newline at end of file diff --git a/app/react-components/targeting-ghost.jsx b/app/react-components/targeting-ghost.jsx index 7b9a9e5..7e207ac 100644 --- a/app/react-components/targeting-ghost.jsx +++ b/app/react-components/targeting-ghost.jsx @@ -61,17 +61,17 @@ const TargetingGhostInternal = PixiComponent('TargetingGhost', { container.addChild(fade, grid, innerGrid); return container; }, - applyProps: (container, oldProps, {cx, cy, px, py, tint}) => { - container.x = px - (px % tileSize.x) - cx + (tileSize.x / 2) - (tileSize.x * (radius / 2)); - container.y = py - (py % tileSize.y) - cy + (tileSize.y / 2) - (tileSize.y * (radius / 2)); - container.children[0].x = px % tileSize.x - (tileSize.x / 2) ; - container.children[0].y = py % tileSize.y - (tileSize.y / 2) ; + applyProps: (container, oldProps, {x, y, tint}) => { + container.x = x - (x % tileSize.x) + (tileSize.x / 2) - (tileSize.x * (radius / 2)); + container.y = y - (y % tileSize.y) + (tileSize.y / 2) - (tileSize.y * (radius / 2)); + container.children[0].x = x % tileSize.x - (tileSize.x / 2) ; + container.children[0].y = y % tileSize.y - (tileSize.y / 2) ; const color = Math.round(255 - (tint * 255)); container.children[2].tint = `rgb(${color}, ${color}, ${color})`; }, }) -export default function TargetingGhost({cx, cy, px, py}) { +export default function TargetingGhost({x, y}) { const app = useApp(); const [radians, setRadians] = useState(0); useEffect(() => { @@ -85,10 +85,8 @@ export default function TargetingGhost({cx, cy, px, py}) { return ( ); diff --git a/app/react-components/tile-layer.jsx b/app/react-components/tile-layer.jsx index 17a257c..87db0c7 100644 --- a/app/react-components/tile-layer.jsx +++ b/app/react-components/tile-layer.jsx @@ -7,11 +7,9 @@ import useAsset from '@/hooks/use-asset.js'; const TileLayerInternal = PixiComponent('TileLayer', { create: () => new CompositeTilemap(), applyProps: (tilemap, {tileLayer: oldTileLayer}, props) => { - const {asset, tileLayer, x, y} = props; + const {asset, tileLayer} = props; const extless = tileLayer.source.slice('/assets/'.length, -'.json'.length); const {textures} = asset; - tilemap.position.x = x; - tilemap.position.y = y; if (tileLayer === oldTileLayer) { return; }