diff --git a/app/react-components/entities.jsx b/app/react-components/entities.jsx index 0a6104d..23a5b51 100644 --- a/app/react-components/entities.jsx +++ b/app/react-components/entities.jsx @@ -1,24 +1,44 @@ -import {Container} from '@pixi/react'; +import {Container, Graphics} from '@pixi/react'; +import {useCallback} from 'react'; import Sprite from './sprite.jsx'; +function Crosshair({x, y}) { + const draw = useCallback((g) => { + g.clear(); + g.lineStyle(1, 0xffff00); + g.moveTo(-5, 0); + g.lineTo(5, 0); + g.moveTo(0, -5); + g.lineTo(0, 5); + g.lineStyle(1, 0xffffff); + g.drawCircle(0, 0, 3); + }, []); + return ( + + ); +} + export default function Entities({entities, x, y}) { - const sprites = []; + const renderables = []; for (const id in entities) { const entity = entities[id]; if (!entity.Position || !entity.Sprite) { continue; } - sprites.push( - + renderables.push( + <> + + + ); } return ( - {sprites} + {renderables} ) } \ No newline at end of file