diff --git a/app/engine/ecs/components/area-size.js b/app/ecs-components/area-size.js similarity index 100% rename from app/engine/ecs/components/area-size.js rename to app/ecs-components/area-size.js diff --git a/app/engine/ecs/components/camera.js b/app/ecs-components/camera.js similarity index 100% rename from app/engine/ecs/components/camera.js rename to app/ecs-components/camera.js diff --git a/app/engine/ecs/components/controlled.js b/app/ecs-components/controlled.js similarity index 100% rename from app/engine/ecs/components/controlled.js rename to app/ecs-components/controlled.js diff --git a/app/engine/ecs/components/index.js b/app/ecs-components/index.js similarity index 100% rename from app/engine/ecs/components/index.js rename to app/ecs-components/index.js diff --git a/app/engine/ecs/components/momentum.js b/app/ecs-components/momentum.js similarity index 100% rename from app/engine/ecs/components/momentum.js rename to app/ecs-components/momentum.js diff --git a/app/engine/ecs/components/position.js b/app/ecs-components/position.js similarity index 100% rename from app/engine/ecs/components/position.js rename to app/ecs-components/position.js diff --git a/app/engine/ecs/components/rendered.js b/app/ecs-components/rendered.js similarity index 100% rename from app/engine/ecs/components/rendered.js rename to app/ecs-components/rendered.js diff --git a/app/engine/ecs/components/sprite.js b/app/ecs-components/sprite.js similarity index 100% rename from app/engine/ecs/components/sprite.js rename to app/ecs-components/sprite.js diff --git a/app/engine/ecs/components/visible-aabb.js b/app/ecs-components/visible-aabb.js similarity index 100% rename from app/engine/ecs/components/visible-aabb.js rename to app/ecs-components/visible-aabb.js diff --git a/app/engine/ecs/components/wandering.js b/app/ecs-components/wandering.js similarity index 100% rename from app/engine/ecs/components/wandering.js rename to app/ecs-components/wandering.js diff --git a/app/engine/ecs/components/world.js b/app/ecs-components/world.js similarity index 100% rename from app/engine/ecs/components/world.js rename to app/ecs-components/world.js diff --git a/app/engine/ecs/systems/apply-momentum.js b/app/ecs-systems/apply-momentum.js similarity index 100% rename from app/engine/ecs/systems/apply-momentum.js rename to app/ecs-systems/apply-momentum.js diff --git a/app/engine/ecs/systems/calculate-aabbs.js b/app/ecs-systems/calculate-aabbs.js similarity index 100% rename from app/engine/ecs/systems/calculate-aabbs.js rename to app/ecs-systems/calculate-aabbs.js diff --git a/app/engine/ecs/systems/control-movement.js b/app/ecs-systems/control-movement.js similarity index 100% rename from app/engine/ecs/systems/control-movement.js rename to app/ecs-systems/control-movement.js diff --git a/app/engine/ecs/systems/update-spatial-hash.js b/app/ecs-systems/update-spatial-hash.js similarity index 100% rename from app/engine/ecs/systems/update-spatial-hash.js rename to app/ecs-systems/update-spatial-hash.js diff --git a/app/engine/ecs/index.js b/app/engine/ecs.js similarity index 55% rename from app/engine/ecs/index.js rename to app/engine/ecs.js index c4902df..89ee425 100644 --- a/app/engine/ecs/index.js +++ b/app/engine/ecs.js @@ -1,8 +1,8 @@ import Ecs from '@/ecs/ecs.js'; -import Types from './components/index.js'; +import Types from '@/ecs-components/index.js'; class EngineEcs extends Ecs { static Types = Types; } -export {EngineEcs as Ecs}; +export default EngineEcs; diff --git a/app/engine/engine.js b/app/engine/engine.js index 0a66b06..69aaa59 100644 --- a/app/engine/engine.js +++ b/app/engine/engine.js @@ -3,14 +3,12 @@ import { RESOLUTION, TPS, } from '@/constants.js'; -import {Ecs} from './ecs/index.js'; - -import ControlMovement from './ecs/systems/control-movement.js'; -import ApplyMomentum from './ecs/systems/apply-momentum.js'; -import CalculateAabbs from './ecs/systems/calculate-aabbs.js'; -import UpdateSpatialHash from './ecs/systems/update-spatial-hash.js'; - -import {decode, encode} from '@/engine/net/packets/index.js'; +import ControlMovement from '@/ecs-systems/control-movement.js'; +import ApplyMomentum from '@/ecs-systems/apply-momentum.js'; +import CalculateAabbs from '@/ecs-systems/calculate-aabbs.js'; +import UpdateSpatialHash from '@/ecs-systems/update-spatial-hash.js'; +import Ecs from '@/engine/ecs.js'; +import {decode, encode} from '@/packets/index.js'; const players = { 0: { diff --git a/app/engine/net/packets/action.js b/app/packets/action.js similarity index 100% rename from app/engine/net/packets/action.js rename to app/packets/action.js diff --git a/app/engine/net/packets/index.js b/app/packets/index.js similarity index 100% rename from app/engine/net/packets/index.js rename to app/packets/index.js diff --git a/app/engine/net/packets/tick.js b/app/packets/tick.js similarity index 100% rename from app/engine/net/packets/tick.js rename to app/packets/tick.js diff --git a/app/components/dom.jsx b/app/react-components/dom.jsx similarity index 100% rename from app/components/dom.jsx rename to app/react-components/dom.jsx diff --git a/app/components/dom.module.css b/app/react-components/dom.module.css similarity index 100% rename from app/components/dom.module.css rename to app/react-components/dom.module.css diff --git a/app/components/ecs.jsx b/app/react-components/ecs.jsx similarity index 95% rename from app/components/ecs.jsx rename to app/react-components/ecs.jsx index 929c5e3..df018fb 100644 --- a/app/components/ecs.jsx +++ b/app/react-components/ecs.jsx @@ -1,7 +1,7 @@ import {Sprite} from '@pixi/react'; import {useState} from 'react'; -import {Ecs} from '@/engine/ecs/index.js'; +import Ecs from '@/engine/ecs.js'; import usePacket from '@/hooks/use-packet'; export default function EcsComponent() { diff --git a/app/components/hotbar.jsx b/app/react-components/hotbar.jsx similarity index 100% rename from app/components/hotbar.jsx rename to app/react-components/hotbar.jsx diff --git a/app/components/hotbar.module.css b/app/react-components/hotbar.module.css similarity index 100% rename from app/components/hotbar.module.css rename to app/react-components/hotbar.module.css diff --git a/app/components/pixi.jsx b/app/react-components/pixi.jsx similarity index 100% rename from app/components/pixi.jsx rename to app/react-components/pixi.jsx diff --git a/app/components/pixi.module.css b/app/react-components/pixi.module.css similarity index 100% rename from app/components/pixi.module.css rename to app/react-components/pixi.module.css diff --git a/app/components/slot.jsx b/app/react-components/slot.jsx similarity index 100% rename from app/components/slot.jsx rename to app/react-components/slot.jsx diff --git a/app/components/slot.module.css b/app/react-components/slot.module.css similarity index 100% rename from app/components/slot.module.css rename to app/react-components/slot.module.css diff --git a/app/components/ui.jsx b/app/react-components/ui.jsx similarity index 100% rename from app/components/ui.jsx rename to app/react-components/ui.jsx diff --git a/app/components/ui.module.css b/app/react-components/ui.module.css similarity index 100% rename from app/components/ui.module.css rename to app/react-components/ui.module.css diff --git a/app/routes/_main-menu.play.$/route.jsx b/app/routes/_main-menu.play.$/route.jsx index 2073315..031c465 100644 --- a/app/routes/_main-menu.play.$/route.jsx +++ b/app/routes/_main-menu.play.$/route.jsx @@ -1,4 +1,4 @@ -import Ui from '@/components/ui.jsx'; +import Ui from '@/react-components/ui.jsx'; export default function Index() { return ( diff --git a/app/routes/_main-menu.play/route.jsx b/app/routes/_main-menu.play/route.jsx index 18d738e..56b3596 100644 --- a/app/routes/_main-menu.play/route.jsx +++ b/app/routes/_main-menu.play/route.jsx @@ -2,9 +2,9 @@ import {useEffect, useState} from 'react'; import {Outlet, useParams} from 'react-router-dom'; import ClientContext from '@/context/client.js'; -import {decode, encode} from '@/engine/net/packets/index.js'; import LocalClient from '@/net/client/local.js'; import RemoteClient from '@/net/client/remote.js'; +import {decode, encode} from '@/packets/index.js'; import styles from './play.module.css';