2/2
Continuation:
I say ugly because I think this is not what a user would have expected by clicking add
to learn more about it. Personally I would have expected some information about what is add
, how it works and so on.
This is no user-friendly information imho, anyway we can just go with the flow and click the weird link in the top without any information whatsoever on what it does, where it leads and why is there: [Phaser.GameObjects.GameObjectFactory]
something similar opens:
to the left we see that there are a bunch of terms called Members
(what are they? Why are there? We’ll never know…) scrolling down the right-side window we see that there’s also a section called Methods
(we know what methods are and we were expecting this, hurray! ), sometimes there are also other sections.
In the top of the right-side window we see a definition of what a GameObjectFactory
is. This is pretty much what would be expected if we were looking for something called GameObjectFactory
: some description a code snippet and what parameters it takes. However, we were not looking for this, but Ok.
We are looking for the .group()
method, so let’s find it in the left-side window, luckily it’s under the Methods
section (oh yes), let’s click on it and something unexpected happens:
the right-side window scrolls down to where our method is. I personally don’t like this at all, but Ok.
Here we have our method:
Finally we know that the code we saw in this.add.group()
does.
There’s a description, there are the accepted parameters that the method takes, some useful info about them, unfortunately not always is indicated what the default value is, which is bad, but Ok. Also another bad thing is that almost never there are code snippets, usually if there’s any, it’s in the top of the page.
This is just an example on how to search for this.add.group()
. Since yesterday I successfully searched for many different properties, the most important part is to make some thinking and get right the first node of this tree. In this case we started from Scene
but there are many others starting points.
What I do when I get lost is clicking on [Phaser]
link in the top of the page:
This theoretically should take us to the root node of the documentation, and from there we can restart our search.
In the last 2 days I’ve encountered some duplicates with some discrepancies between them.
E.g. searching for “Tween”:
Looking for tweens
I was trying to understand what are the properties that can be passed in the configuration object when creating a tween.
However in the docs there’s this division between TweenManager
and Tween
, again no information whatsoever on the differences.
So clicking on both of them (and branching our search tree) we end up to pages that are kind of similar but not quite. Eventually both paths lead to two pages “explaining” the configuaration object to pass to the tween:
- Phaser.Types.Tweens.TweenDataConfig - Phaser 3 API Documentation (beta)
- Phaser.Types.Tweens.TweenBuilderConfig - Phaser 3 API Documentation (beta)
Interestingly enough, nowhere is said that you can pass in the configuration object any property of the GameObject that you want to tween. Which is like the principal reason why we would use a tween. But Ok.
So apart from these situations I found myself quietly more productive using the documentation this way.
Hopefully this is helpful for some other newbie to PhaserJS like me that do not understand how the documentation of this library works.
Finally, my last opinion:
I think that if this is how PhaserJS development is going to be, I am not sure it’s going to survive that long, for the time needed for learning, understanding and debugging I have the feeling that it’s not worth it but for small side projects to share with friends, for real game development better learning something else (unity and unreal would be my guess).
There’s also an interesting trend: web games with React, I found several game experiments react-based out there in the wild and for how large the React community is and how user-friendly the documentation is, I bet sooner or later some React library for developing games is going to be successful.
Cheers,