项目文件夹

文件
Christina Pan af5af0c445 Add score decay over time feature
Implemented score decay mechanics where cells gradually lose score over time.
Larger cells decay faster based on their size, adding a strategic element to gameplay.
Added comprehensive unit tests for the feature.
2025-05-27 14:43:37 -07:00

28 行
660 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, port=5001)