Flask-based Python web-game, hosted with Google App Engine, called Connect-k:
a 2-player game where players take turns placing pieces onto the bottom row of
an infinite grid. The game ends if a player's pieces form a contiguous line
(horizontal or vertical) of length k.
Try it out here.
Supported gameplay options:
- Value of
k: length of the line required to win - Player color: red or blue
- Player to go first: red or blue
- Opponent: computer (easy), computer (hard), human
- If multiple web browser tabs are open and identified as belonging to the same user, be aware that it modifies the same game data; opening, for example, another tab in the same web browser could be identified as belonging to the same user. On the other hand, accessing another game session from a new 'incognito' window could be identified as belonging to a separate user and would generate separate game data.
This application is hosted using Google App Engine (there are great tutorials
for how to deploy a Flask app using App Engine, e.g.
this tutorial).
When working with the App Engine platform, the following are some useful
gcloud commands:
- Deploy changes to the Google App Engine server:
gcloud app deploy. - Open the most recent app version in a web browser:
gcloud app browse. - List all versions deployed to App Engine server:
gcloud app versions list. - There's a limit to how many versions of the app you can store on App Engine;
if you have too many you will not be able to upload more unless deleting some
old ones. There is a useful script here
that can remove all but the
nmost recent versions. Withn=2, it could be called like this to delete all but the 2 most recent versions:sh delete-older-gcloud-app-versions.sh default 2. After doing this, you can deploy the most recent version of the app.
Michael E. Rowan — mrowan137 — michael@mrowan137.dev.
- Flask
- WTForms
- Google Cloud Secret Manager
- Google Cloud App Engine
- Google Cloud App Engine: how to remove older versions?
- Google Cloud App Engine: useful script for removing older versions
- Tutorial: deploying a Flask app to Google App Engine
- easyAI TicTacToe
- CSS glowing border
- CSS button bigger on hover
- Press Start 2P font