Skip to content

CrymeFTW/1v1_games

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Versus - 1v1 LAN Games

Two-player LAN games with GUI lobby selection. After both players connect, choose from multiple games together.

  • Python 3.9+
  • Pygame for GUI interface

Games available

  • Battleship (classic 10x10)
  • Snake (two-player, simultaneous turns)

If both players choose the same game in the lobby, that game starts. If they choose differently, a random choice decides.

Install

Recommended (ensures pygame is installed and CLI entrypoints are available):

python3 --version
python3 -m venv .venv
source .venv/bin/activate
pip install -e .
pip install -e .

This installs console commands: battleship, battleship-host, and battleship-join.

Run

One player hosts, the other joins.

Host

  1. Find your local IP (e.g., 192.168.1.23). On macOS/Linux: ipconfig getifaddr en0 or ifconfig.
  2. Start hosting:
versus host --bind 192.168.1.23 --port 5000
  1. Wait for your friend to connect, then both pick a game in the lobby.

Join

versus join --address 192.168.1.23 --port 5000
  • If your firewall prompts, allow incoming connections for Python.

Controls

Battleship

  • During placement: type coordinates like A1, J10 and R for rotate (horizontal/vertical)
  • During attack: type target tile B7, E10
  • Use q to quit at any prompt

Snake

  • Use WASD to steer. Press Enter to keep your previous direction. q to quit.

Notes

  • Must be on the same LAN/Wi‑Fi. Internet play would require port forwarding or a relay server.
  • Battleship ends when all ships of a player are sunk. Snake ends on collision; higher score wins, head-to-head or simultaneous crash is a draw.

About

CLI LAN Games

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages