Making a Phaser Power Tools, a basic toolkit for simple games?

Hello,

I am new to Phaser and I really enjoy it.

Many years ago, when Flash was still a thing, I was using Flixel engine and the awesome Flixel Power Tools, made by Richard Davey, long before he created Phaser. Here how he presented FTP:

Quite frankly flixel is awesome. It allows for very rapid game development. And while it does a lot for you, it is lacking in a few areas. After all it’s just a framework, and frameworks are meant to be built-upon. That is where the Flixel Power Tools come in. They are a set of classes, all neatly arranged in a single package […]. They push flixel just that bit further and cover a lot of fundamental ground for you.

I feel a bit the same about Phaser. It is awesome, but as a framework, it is made to be as lightweight as possible and to be built-upon. I totally understand and support Richard position about keeping Phaser as generic as possible. Phaser includes features that most games need, but won’t go more into details and avoid becoming a monster with so many features that most games won’t need.

But that can make game development a bit painful since you have to start so many things from scratch. There are many tutorials about how to make a platformer but they only show you the first steps. If you want to make something nice, you will have to spend days developping basic features: a character that walk right or left, jump, crawl, hang, climb ladder or whatever, enemies that walk back and forth and that you have to avoid, coin to collect, level entrances and exits, etc. Instead of working on actual game mechanics, you will have to spend so much time reinventing the wheel over and over, even so those basic features are shared by most plateformers.

That’s where a Phaser Power Tools could become handy, a layer that we could add on top of Phaser to have this common features. There are already many available plugins but it takes time to find which one to use and how. Are there already project like this? If not, does it interested some other developers? I definitely don’t have time, the experience and the shoulders to carry such a project by myself, but I can definitely participate.

For instance, I’ve been working on the last days on a small action adventure try-out and I plan to work next on a very simple plaformer. It is still early stage, mostly for research purpose but I will gladely share the source if my work, past and future could be useful to others.

Thanks for reading that looooong message!

1 Like

Before you get too far along, have you seen https://rexrainbow.github.io/phaser3-rex-notes/docs/site/ ??
Love the demo, may I use it in my upcoming book???

Rex Plugins are indeed great and I already planned to use some of them later, for popup, bbcode and text typing. It does part of the job, but that is not exactely what I had in mind. Most of them are specialized in really specific task and they are made for already confirmed developers. And to be honest, you often find the right plugin long after you did the job by yourself. There are so many plugins, it is hard to find the right one at the right time.

Maybe such a project could start by proposing templates for common game type, like plateformer, action adventure, car race or whatever… Something generic enough to be a good starting point, but specific enough to include all the basic features. For now, you can only find really simple tutorial that only gives you a tiny head start or complete open source games that are too specific to be reusable. We could make something between, something made to be a template. And by doing so, we would have to develop different plugins, or simply dig out the right one. That could be an option, but many others are possible. I hope I’m clear enough, it is not 100% clear in my head anyway.

For starter, I could open source my demo. Maybe others have better templates to start from. Would that interest other developers to work on such project? My demo is an action adventure, but I won’t mind working on another type of game if enough people are interestedy by it. If this is the right direction, I will change the name of the discussion to better reflect it.

BTW, thank you for making me look at Rex plugins once again, I missed before the amazingly usefull moveTo plugin. I am going to use it for the pathfinder instead of tweens, in order to make all character movements consistent, based on body velocity. EDIT: what a deception, the moveTo plugin also use tweens, not body velocity. Using it only make my code shorter, but dependant of another plugin. Not sure which one is better.

About the demo, you can surely use it. I’m planning to keep improving it and to make it more generic, because now, the dialog system is linked to my own server engine. Tell me when you need it, I will send you the last version.

1 Like

I have 2 moveTo plugin

1 Like

I have a series of plugins for board game (chess move on board, or match3 like Bejeweled).
I also interesting in implementing such plugins for plaformer, but I am not familiar with what kinds of function that the platformer should include.

1 Like

Thanks a lot for all this informations.

I have three different kind of character, that all use the same type of spritesheet: the player, the NPCs and the enemies. There are three different controlers (mouse and keyboard for the player, IA for the rest), and each of them change the player position and the sprite animation so the character always looks in the right direction. That’s too many different way to select the correct animation and I would find it more consistent if all movement were managed with velocity. I could then listen to velocity change and modify the animation accordingly. So I might code a MoveTo function that is using velocitym if I do’t find any.

About platformers, I haven’t done one yet so I am not sure what it should include. I was kind of hoping that some developers familiar with platformers will step in. Maybe the idea doesn´t appel to people, or maybe the thread is not correctly named.

About displaying animation according to current velocity issue:

Since there are more then 1 way to change the motion of that sprite, you can add game’s poststep event (game’s poststep is the last event before rendering):

scene.game.events.on('poststep', function(){
    // Set animation according the moving direction
});

(Assume that any behavior of this sprite is done in scene’s update(), or game’s step event.)
Events in game-loop are shown here.

Thanks, that is a really good advice and it is such a useful schematic!!!

That actually helps also with another problem I had with character shadows: I was moving shadows at the same location than the characters on each update loop. Since I use velocity, I guess characters coordinates are changed after the character update loop. So the shadows where always one frame behind. By using poststep event in this kind of thing, I can stop worrying about updates order.

Plugin takes care of this :slight_smile:

That’s great, thank you so much :slight_smile:

Love the Match 3 demo … but it is slightly “prejudice” for right-handed gamers. It took me a couple of tries to figure out how your “swopping” works.

Chess move on board is an answer to my prayer! Thank you!!!

I also interesting in implementing such plugins for plaformer, but I am not familiar with what kinds of function that the platformer should include.

@rexrainbow you already did a set of controler for the player, with Ship and Eight direction. It could be have a controler for sidescroller with left-right and jump. To be extensive, there are also numerous other possible movement in a platformer as double jumping, mid-air dashing, wall climbing/jumping, flying etc.

I am also thinking.about proposing to make a collaborative weapon plugin, to deal all kind of weapons you can see in topdown and sidescrolling games: There are already a weapon plugin but it only deals with bullet while there is much more diversity: short range, projectiles, boomerang, missiles, grenades, laser, timed bomb, defrag… That could be fun to make and really usefull for many games. I should start a thread about that soon.