Jump to content

Help with simple code with ES6 and phaser 3


cpu_sam
 Share

Recommended Posts

Hello,

so, I was here reading and reading and reading and studying codes a lot and I can't resolve a simple problem: how to make a little example with Phaser 3.
when I try to import Phaser as a module with the command: import * as Phaser from "./phaser3.8.0.js"; It gives me the follow error:

Quote

SyntaxError: import declarations may only appear at top level of a module

But the import is already on top level of main module. Or even if I try to import my Player classe with the following:

import Player from "./myPlayer.js";

Where myPlayer.js is the class file with a extends of Player with Phaser.GameObjects.Sprite.

 

Link to comment
Share on other sites

  • 5 months later...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...