Compare commits

...

2 Commits

Author SHA1 Message Date
46afe9c7ba
make the instructions like, really bold
All checks were successful
continuous-integration/drone/push Build is passing
2024-03-24 22:54:25 -06:00
c568a8e49a
filter only colliding and pushable entities in collision test
All checks were successful
continuous-integration/drone/push Build is passing
2024-03-24 22:40:51 -06:00
2 changed files with 11 additions and 5 deletions

View File

@ -17,10 +17,10 @@ export const Title = ({ setReady }: TitleProps) => {
</a>
</p>
<br />
<p>
WASD/arrow keys to move, space/enter to interact after highlighting with
the mouse
</p>
<h3 className="warning">
WASD/arrow keys to move. SPACE/ENTER to interact after highlighting
with the mouse.
</h3>
<br />
<hr />

View File

@ -139,11 +139,17 @@ export class Grid extends System {
);
if (collidingEntities.length > 0) {
// i.e. key going into a door or function going into an application
// ensure everything that is a "pushable" or "colliding" which will collide with the entity
// can actually continue moving in the direction
const allEntitiesInPreviousCellCanCollide = Array.from(
this.grid[currentPosition.y][currentPosition.x],
)
.map((id) => game.getEntity(id)!)
.filter(
(entity) =>
entity.hasComponent(ComponentNames.Colliding) ||
entity.hasComponent(ComponentNames.Pushable),
)
.every((entity) =>
collidingEntities.every((collidingEntity) =>
Collision.canCollide(entity.name, collidingEntity.name),