Page 1 of 1

BGA CLI

Posted: 13 July 2020, 12:55
by Tisaac
Hi!

In the last games I've implemented here, I was always trying to DRY my code and to keep it readable, and I was actually wondering if any of you already made some kind of command line tool to make developpement faster ?
I really don't like the monolithic basic structure and tends to use a lot of modules files, but maybe this could be pushed one step further :
- have a states/ dir in which you could create a new state, give all its info, transition, arg and st functions, and also frontend notif and onEnteringState (I'm already doing something generic like : this["onEnteringState" + stateName"], but would be nice to have this along the backend code)
- have a command "new state active/game/multiactive" that will create the base structure of the file
- have a command "compile" or whatever that would filled up the corresponding game.php and game.js and states.php

The command line could also help to add some generic features I'm already using in most of my projects :
- Player class and PlayerManager to manipulate the players with objects (and therefore puting some player action inside the Player class instead of having it in the game.php)
- Custom logger that log everything that could be useful for stats and for canceling turn, and almost completely make the global state variable useless.

What do you think about these kind of feature ? Would you use them ?

Re: BGA CLI

Posted: 13 July 2020, 14:22
by joezg
I'm thinking about CLI for some time, for almost the same reasons you mentioned!

There is a lot of repetition involved in doing an action/notification cycle that would benefit, among other things, from CLI.

I plan to do it, but cannot promise on deadlines... :)