Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
cnlnpjhsy committed Jul 27, 2024
1 parent eb61c08 commit 7da0e5d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 4 additions & 2 deletions frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ We created a simple video-game like frontend for better interaction with the IBS
2. Set your OpenAI API key in `api_key.py`.
3. From root directory of this repository run
```
python mzgame_frontend.py --backend_port <backend_port> --frontend_port <frontend_port>
python mzgame_frontend.py --frontend_port <frontend_port>
```
If no arguments provided, by default, this python backend serves on port 8080, and the HTTP frontend serves on port 8081.
If no arguments provided, by default, the HTTP frontend serves on port 8081.
4. The game frontend will be served on `http://localhost:<frontend_port>`. Use your browser to start the game!
**NOTE:** The game frontend uses http://localhost:8080 to communicate with the `mzgame_frontend.py` Flask program. Make sure the port is not occupied.
## Guidance
### Basic control
- **Move around:** Arrow keys or mouse clicking
Expand Down
3 changes: 1 addition & 2 deletions mzgame_frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,8 @@ def agent(agent_name: str):

if __name__ == "__main__":
args = argparse.ArgumentParser()
args.add_argument("--backend_port", type=int, default=8080)
args.add_argument("--frontend_port", type=int, default=8081)
args = args.parse_args()

threading.Thread(target=run_frontend_server, args=(args.frontend_port,)).start()
socketio.run(app, "localhost", args.backend_port, debug=False)
socketio.run(app, "localhost", 8080, debug=False)

0 comments on commit 7da0e5d

Please sign in to comment.