Considering Leaving Phaser Development

Hi, I experimented with phaser a few years ago and left because it just didn’t work for me.

I was excited to come back to it thinking that it would be better, but I have just encountered bugs in the framework nonstop since starting to use it.

In particular is this issue where starting a scene completely screws up the mouse listeners…

Am I pushing it too hard? Am I doing crazy things here because it just seems super buggy to me…

Looking for everyone to tell me I’m an idiot and that it’s just me coding it wrong, not the framework.

thanks!

1 Like

That issue isn’t with phaser. I’ll keep working with you, I am just in the middle of something now.

Phaser is the best (imo) JS game engine.

2 Likes

Thanks @UltimateProGrammer!

I do like the APIs in phaser, but it’s super frustrating that they don’t seem to actually work properly. :confused:

I also really dislike the way the examples are organized and that the docs is just regurgitating the source code of the library rather than actually showing how a game dev would use it.

4 Likes

I’ve never encountered issues like you have. I’m sure this community can solve all of them

Thanks. The community is really great, but I am seriously losing my confidence in the framework itself.

1 Like

The fact that starting a scene a second time doesn’t work properly is a huge issue for me. My sprites aren’t being added to the screen the second time either.

I randomly get this weird error from the framework as well:

Uncaught TypeError: Cannot read property 'cut' of null
at Frame.setSize (Frame.js:377)
at Text.updateText (Text.js:1169)
at Text.setText (Text.js:609)
at HudScene.ts:29
at Object.dispatch (redux.js:222)
at Object.e [as dispatch] (<anonymous>:1:40553)
at PlayScene.<anonymous> (PlayScene.ts:140)
at World.collideSpriteVsSprite (World.js:1893)
at World.collideHandler (World.js:1822)
at World.collideObjects (World.js:1767)

Weird errors normally mean that something is wrong and we just don’t know it. You might have to rewrite some of the underlying code, although it won’t be difficult, and you shouldn’t leave Phaser just because you need to change a few lines.

If I only had to change a few lines it would be fine, but when there is nothing you can change it to to make it work as it should… then what? :cry:

There is something that will make it work as it should.

2 Likes

But creating and destroying scenes is such a critical thing. How can you ever come back from a “game over” if you can’t go back to the play scene a second time?

You can both create and destroy scenes.

Hmm when I create a scene the first time it works as expected, but when creating it a second time there are lots of bugs and errors.

I tried using “scene.remove” and “scene.stop” but neither of them seem to fix the issues. What’s the correct way tor really destroy the scene? :thinking:

How are you creating and removing scenes? Here are my preferred docs for scenes:

I am creating the scene using “scene.start”

The docs say calling “scene.remove” should delete it which is very incorrect. I think “scene.remove” is like the opposite of “scene.add”, and when it does remove it then it doesn’t seem to be fully deleted since, if it was, then starting the scene again would be the same as starting it the first time. :confused:

1 Like

Looks like

this.cameras.resetAll()

is working for me.

I will keep fighting this to see if I can get it to restart a seen without errors. I do think phaser is super fragile, but maybe it is actually possible!

Thanks @UltimateProGrammer :+1:

Hey Jim,

I too had to learn the hard way that you need to clean up changes to the main camera. :grin:

I would recommend keep trying things as there probably is a way- very rare that you found something that is truly non-workaroundable. :wink:

Try not to get so frustrated as game development can be often hard, possibly the most hard development there is! (And definitely harder than making a boring dashboard in React. hehe) :laughing:

Take more breaks and don’t be afraid to think about things a different way. The first times using different APIs is that hardest, and once you figure these things it’ll be much easier for every time after that.

Like you said, starting the game scene after getting game over is a very common thing to do, and there are many other games that do it without problems so I think you just need to pinpoint what exactly is screwing up your scene when it restarts.

3 Likes

Thanks everyone, I think you are right. I don’t know why I expect everything to be super easy, maybe I just have high expectations from so much development on super heavily worked on frameworks liek React and Angular. :sweat_smile:

Anyway, I was able to fix the issues so I will continue with phaser, and I’ll try to keep in mind that when things aren’t working it’s most likely either typos / coding logic bugs causing crazy things to happen or I’m just not using the right functions from the library. Thanks :+1:

You’re not quoting official PHASER DOC … you’re supporting his point

He was simply asking whether or not it was possible.

I mean this site when I say the “official phaser docs” which seem like just a website generated from the jsdoc comments in the code. In theory it’s a good idea but is often very unhelpful to a gamedev using the framework.

This lack of good official documentation leads to all these scattered 3rd party docs which can be hit or miss.

Compare this to, say, the Angular docs, where everything is thoroughly explained along with the API.