-
Install npm (https://nodejs.org/)
npm install -
Fork or clone this repository
git clone git@github.com:codyfight/codyfighter-node.js.git -
Setup your Operator CKey(s) by creating a
.envfile using our.env.template.Only a limited amount CKeys are available for early access players. Stay tuned to our website to not miss opportunities to get exclusive early game access!!
-
Run a server via command line
npm run start -
Develop your advanced algorithm and play against others online!
Read API documentation
Check for open source codes at Discord channel discord.gg/codyfight
Look for Github repos, like this one, to get inspiration: https://github.com/Vinimart/codyfight-hunter-bot-js
-
Deploy an instance on a local computer or any server you like
e.g. Heroku
-
Scale Codyfighters farm!
-
Create your algorithm by modifying the
CBotclass atsrc/bots/CBot.js. -
The
CBotclass contains the basic logic for your bot. -
The game logic is implemented in the
playGame()method. -
The
playGame()method is called every time a new game starts.
-
In order to change the default bot game flow you can modify the
CBotConfigclass atsrc/bots/modules/CBotConfig.js. -
The
CBotConfigclass contains basic game flow configuration, initialization, and termination. -
The default recursive game flow is as follows:
-
initGame()- Initialize the game. -
waitForOpponent()- Wait for the opponent to join the game. -
playGame()- Default entry point for custom bot algorithm inCBotclass atsrc/bots/CBot.js. -
endGame()- End the game.
-
-
No bot gameplay logic is implemented in this class.
-
In order to change or upgrade the default bot basic helpers you can modify the
GameUtilsclass atsrc/bots/modules/GameUtils.js. -
This class contains all the basic game logic that can be reused by all bots.
-
Also contains some helper functions that can be used by the bots.
- Game API is a external package that provides all game HTTP requests.
- Documentation can be found at https://github.com/codyfight/codyfight-game-client#readme.