Files
2026-07-13 12:35:44 +08:00

28 lines
649 B
Python

from flask import Flask, render_template, jsonify, request
import numpy as np
import json
app = Flask(__name__)
# Game state
WORLD_SIZE = 2000
NUM_AI_PLAYERS = 10
NUM_FOOD = 100
@app.route('/')
def index():
return render_template('game.html')
@app.route('/game_state')
def game_state():
# In a real implementation, this would update AI positions and return current game state
return jsonify({'status': 'ok'})
@app.route('/update_player', methods=['POST'])
def update_player():
# Handle player position updates
data = request.get_json()
return jsonify({'status': 'ok'})
if __name__ == '__main__':
app.run(debug=True)