Skip to content
This repository has been archived by the owner on Apr 25, 2022. It is now read-only.

Some inconsistence in the small tutorial. #29

Closed
jobarbo opened this issue Apr 27, 2018 · 3 comments
Closed

Some inconsistence in the small tutorial. #29

jobarbo opened this issue Apr 27, 2018 · 3 comments

Comments

@jobarbo
Copy link

jobarbo commented Apr 27, 2018

Hi to you, I hope you have a great day and i would like to let you know that this generator is amasing! Good job really.

I found a small issue in your tutorial tough.

In the ''declaring game assets section'', you say we need to find the preload() method in the new title.js to load our assets. There is none since by default the generator create only the create and update method, maybe add a notice to use the --customize suffix?

PS: The assets seems to be handled in some way by the assets.js files. (maybe its for objects assets more than small assets inside scene classes). It would be nice to know how to take advantage of that with spritesheet and more complex type of assets.

@rblopes
Copy link
Owner

rblopes commented Apr 29, 2018

Hi, @jobarbo. Sorry for taking a little longer to reply your question.

Actually, I did some changes recently on the project, so hopefully nobody will trip on those issues any more. I've updated the documentation in a few parts, but perhaps a more thorough review is necessary. I plan to work on those this week.

From the next beta release, the scene generator will be updated to create more than one scene module at once, to speed up things. The trade off is that I will be removing the --customize option of the scene generator and modules will have all those methods declared instead. I did this because allowing users to choose which methods to go on each module would make the implementation overly complicated for such a trivial task.

I'm also removing the assets.js module from the sample project permanently. That brings us to the inconsistency you're reporting and an issue I regret for taking too long to address. Issue #28 has a few details on this, but I'll elaborate a little more here.

Up until now, the splash screen was coded following an obscure pattern: it relied on a parallel scene, created at run-time, to handle loading the actual game assets, while displaying the cover art and a custom progress bar. That was accomplished using the assets module and some "hacks", to compensate for some missing features (or so I thought) in comparison with Phaser 2/CE. All that to build a fancy looking splash screen!

I knew something was wrong, not only because I'm the only one promoting that pattern, but because I haven't been updating the sample project properly for quite some time, especially considering some recent changes in Phaser.

It was when Phaser 3.5.0 was released, though, that the issue became evident. Because the Phaser Scene Manager code was refactored to accommodate for future extensions, beginning with the addition of transition effects, the behavior for adding and starting up scenes has been changed, breaking other things, and by consequence the sample game, as it was, stopped working. I got into terms with the Phaser head developer and some of the previous behavior was restored (3.5.1).

However, when issue #28 was posted, I was sure that pattern couldn't fit anymore in the project, so I had to remove it.

I think users are more familiar with the Phaser Loader API anyway, so instead of demanding them to follow a poorly documented pattern ─ because I have failed to provide one and there's little about its existence on the current Phaser documentation, besides very few examples in the Labs ─, favoring the more generally established pattern is better. That departs from a model present since GP+2 (though documentation for it is provided here).

I recommend that you read through the sample project (in the templates/default/ folder) a little bit to review those changes and apply them to your project. Remember that you're free to apply the patterns you feel more adequate to your project as the ones presented in the sample project are just suggestions.

I won't be able to publish a new version of the generator yet because I'm waiting Phaser 3.7.0 to be released. I'll keep this issue open for reference for other users until I deliver the needed updates.

@jobarbo
Copy link
Author

jobarbo commented May 2, 2018

Thanks a lot for your feedback !

@rblopes
Copy link
Owner

rblopes commented May 9, 2018

Just published Beta 3 of the generator with the new sample project, including some changes for the latest Phaser release. I've updated the tutorial in a few parts too.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants