Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Mainloop.js | 480 | 26 | 6 | 4 months ago | 5 | May 30, 2017 | 4 | mit | JavaScript | |
Provides a well-constructed main loop useful for JavaScript games and other animated or time-dependent applications. | ||||||||||
Nx Activity Log | 325 | 12 days ago | 17 | mit | C++ | |||||
Homebrew application for the Nintendo Switch which displays play activity with more accuracy | ||||||||||
Acnh Bcats | 186 | a year ago | ||||||||
Animal Crossing New Horizons BCAT Events | ||||||||||
Gbm | 173 | 4 days ago | 1 | gpl-3.0 | Visual Basic .NET | |||||
Game Backup Monitor - Automatically backup your saved games! | ||||||||||
Redux Time | 105 | 1 | 3 | 8 months ago | 27 | December 04, 2018 | 16 | mit | JavaScript | |
∞ High-performance declarative JS animation library for building games, data-viz experiences, and more w/ React, ThreeJS, Inferno, SnabbDOM and others... | ||||||||||
Realtime | 88 | 6 months ago | 45 | mit | C# | |||||
A mod for the Cities: Skylines game. Adjusts the time flow and the citizens behavior to make them more real. | ||||||||||
Sandcastle Builder | 76 | 3 months ago | 144 | other | JavaScript | |||||
xkcd: 1190: Time: The Game | ||||||||||
Gaming In Python | 55 | 2 years ago | Python | |||||||
Code to all the Games I made using Python Programming Language | ||||||||||
Game Manager | 53 | a month ago | 1 | SourcePawn | ||||||
Game Manager ( Block Radio , Radio Start Round Hide Radar , Money , Messages , Blood , Ping , Map Rotaion With Maplist , Restart Server Last Player Disconnect , And More ) | ||||||||||
Jitternator | 53 | 5 years ago | mit | C++ | ||||||
Lessons learnt from hunting jitter issues |
ColorFight is a game where you try to occupy as many cells as possible on the map.
When you join the game, you will be given a random cell as a start.
You can only attack the cell that's adjacent to your occupied cells.
You can only attack one cell at a time. During that time, you are not able to attack other cells.
The time you need to occupy a cell is based on the last time when the cell is occupied. The longer the time is, the easier it would be to be attacked. The minimum time to occupy a cell is 2s. (The equation of the time to occupy is 2 + 20 * (2 ^ (-x/20))
. So when it's just occupied, it takes 22s to attack it. After 20s, it becomes 12s. After around 55s, it becomes 5s)
You can attack your own cell to refresh the occupy time, but it would take the same amount of time as other players attacking it.
First clone the git repository. git clone https://github.com/gaogaotiantian/ColorFightAI.git
Then you can run the exampleAI by python exampleAI.py
If your computer complains about requests
module, try pip install requests[security]
or sudo pip install requests[security]
if it complains about privilege.
Or you can use python3 by python3 exampleAI.py
. The library and the exampleAI support both python2 and python3.
You can watch the result here https://colorfight.herokuapp.com/
The module provided some API for the game. You are welcome to add your own API, even directly talk to the server with HTTP requests if you want.
Game
is the main class for the API. You should instantiate an object for it like g = Game()
.
JoinGame(name)
will let you join the game with a name. ex. g.JoinGame('MyAI')
. Notice the API is already optimized so when you try to join the game with the same name on the same computer(with the generated token file), it will not generate a user. You can continue to play the game as the user before. name
has to be a str
.
Refresh()
will get the current game data from the server. ex. g.Refresh()
. This function will store the raw data into self.data
which you can access if you want. Also this function will fill in self.width
and self.height
for the game, as well as self.currTime
for the time of this information. For game that has a end time, self.endTime
will be updated, otherwise it will be 0
.
GetCell(x,y)
is a easy way to access the data of one cell. ex. g.GetCell(1,2)
. The function will return a Cell
object which has all the data of a single cell at (x,y). If the pair (x,y) given is invalid, it will return None
. x and y starts with 0
, and the maximum value is g.width-1
, g.height-1
, respectively.
AttackCell(x,y)
is the only action you need to play the game. ex. g.AttackCell(2,2)
. It will try to attack the cell you specified. The return value will be a tuple with 3 items. Returning (True, None, None)
means the action is successful. Otherwise it will return a tuple (False, err_code, err_msg)
where err_code
will contain the error code from the server and err_msg
will contain the reason it failed.
Game
:uid
contains your user id. That's the unique identification for you.
endTime
is the time when the current game will end. If it's 0
, it's unlimited time game. This is a timestamp from the server.
width
and height
contains the width and height of the current game.
currTime
is the current time of the current data from the server. This is a timestamp from the server.
users
is a list of User
object which has all the user info.
owner
: who owns this cell now. It's a user id.
attacker
: who is attacking this cell now. Invalid if isTaking
is False
.
isTaking
: is this cell being attacked. If it's True
then you can't attack it.
x
: x coordinate.
y
: y coordinate.
occupyTime
: when is this cell occupied. Server side time in seconds. This is a timestamp from the server.
attackTime
: when is this cell attacked. Invalid if isTaking
is False
. This is a timestamp from the server.
takeTime
: how long it would take if you attack this cell. This is a number of seconds.
finishTime
: when will the attack finish. Invalid if isTaking
is False
. This is a timestamp from the server.
id
: unique user identification.
name
: user name.
cdTime
: when can this user attack again. This is a timestamp from the server.
cellNum
: how many cells does this user occupy.
0: Success.
1: The cell you attack is invalid. It could be that your input is out of the map, or the cell you attack is not adjacent to your occupied cells.
2: The cell you attack is being taken by another player.
3: You are in CD time. You can't attack any cell now.