fvfvfvfv / codyfight-php
A PHP client for Codyfight
dev-main
2024-06-20 12:31 UTC
Requires
- php: ^8.1
- guzzlehttp/guzzle: ^7.0
This package is auto-updated.
Last update: 2025-04-20 14:08:29 UTC
README
Installation
composer install fvfvfvfv/codyfight-php
Usage
Before being able to interact with the Codyfight API, you need to generate a CKey
Creating a Codyfight instance
$codyfight = new \Fvfvfvfv\CodyfightClient\Codyfight($cKey);
Starting a game
$game = $codyfight->init(\Fvfvfvfv\CodyfightClient\Enums\GameMode::FRIENDLY, 'foo')
Every interaction with the Codyfight API returns a Game
class instance
This instance contains all data returned from the API.
In the future this client will be extended to cast returned data into their relevant classes
Available methods
$codyfight->init(\Fvfvfvfv\CodyfightClient\Enums\GameMode::FRIENDLY, 'foo'); // Initializes a new game $codyfight->check(); // Returns a Game instance without performing any action $codyfight->cast($skillId, $x, $y); // Cast a skill onto the specified tile $dodyfight->move($x, $y); // Moves the player to the specified tile $codyFight->surrender(); // Surrenders the game