patrickgalbraith / phaser-3-invaders

A boilerplate project for HTML5 games using the Phaser 3 game engine, typescript, and ECS architecture.
8 stars 1 forks source link

Trouble using Filter helpers on my entities array. #1

Open savisaar2 opened 3 years ago

savisaar2 commented 3 years ago

using hasComponentType seems to always return null, i'm not really sure how to filter through my array of entities which have a specific component.

entity.getComponentType(Collision)

also the gets underlined by my ide so not really sure if that is also the issue.

After playing around i found out that if i use the same call within the Player assemblages file the code returns the component however when using this code within the PlayerSystem file i get a return of null.

patrickgalbraith commented 3 years ago

@savisaar2 Hey this was a project I did a few years ago when phaser 3 launched. You should be able to find much better examples around these days.