PhaserEditor2D / PhaserEditor

A friendly IDE to develop HTML5 games based on the Phaser framework.
https://phasereditor2d.com
Eclipse Public License 1.0
330 stars 45 forks source link

Scene editor: generates invalid variable's name. #153

Open Marchiuzzz opened 3 years ago

Marchiuzzz commented 3 years ago

Version

Description

I've added a large image to the scene, when I launch the game it works fine image

But once I set the scale of this image to 0.3 (both, X and Y) and then launch the game again I get a grey screen and nothing happens. image

I'm new to this tool and Phaser overall so getting stuck at the first step (a simple image addition) is very frustrating. How can I see if there are any compilation errors in the editor? I've opened up a developer console inside Phaser editor and this is what I get each time I save my scene: image

Thanks

Possible solution

Perhaps it doesn't run properly because it's running in the built-in game player, how could I run this project in browser?

Marchiuzzz commented 3 years ago

Found the problem...it's quite funny actually. The name of the image is 1218 and so in generated code I get image Since 1218 is an integer it's trying to declare that integer as object

PhaserEditor2D commented 3 years ago

Hi @Marchiuzzz

Those errors shown on the console are fixed for the next version of the editor.

I'm glad you found the problem with the image. I will re-open this issue and rename it to "Scene Editor compiler: generate invalid JS idenfifiers".

michaelgundlach commented 2 years ago

@PhaserEditor2D I was bitten by this when I added my first test image as well (from my Photos dir, the first place I could think of to find an image to import as a test, so it was a numeric name)!