Annoraaq / grid-engine

A grid based movement engine compatible with Phaser3.
https://annoraaq.github.io/grid-engine/
Apache License 2.0
235 stars 20 forks source link

Got IDE error message #473

Closed orrest closed 5 months ago

orrest commented 5 months ago

I'm new to Phaser and grid-engine, and it seems I ran the demo sucessfully:

image

but, I've got the error message in the IDE (I've tried both VS Code and WebStorm, got the same error message):

image

The grid-engine import:

image

How can I remove these error messages?

Appreciate for any help.

Annoraaq commented 5 months ago

Hey @orrest, this is a recurring issue. See https://github.com/Annoraaq/grid-engine/discussions/47 and https://discord.com/channels/1033320723105730611/1033320723105730614/1070409708755759214.

orrest commented 5 months ago

For anyone else who encounters with this problem, just declear the GridEngine in the scene class, and it will be fullfilled automatically:

// source: https://discord.com/channels/1033320723105730611/1033320723105730614/1070409708755759214

export class GameScene extends Phaser.Scene {

  gridEngine: GridEngine;

// use `this.gridEngine` ...