Implement Score API Client and User Profile Integration
- Added ScoreAPIClient for communication with the Mice Game Score API, including methods for user signup, score submission, and leaderboard retrieval. - Developed a simple profile manager demo to showcase user profile management and API integration. - Created a test script for the Score API to validate all endpoints and functionality. - Introduced UserProfileIntegration to manage user profiles, including local storage and API synchronization. - Added a JSON file for user profiles with sample data for testing and demonstration purposes.
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
{
|
||||
"profiles": {
|
||||
"Player1": {
|
||||
"name": "Player1",
|
||||
"created_date": "2024-01-15T10:30:00",
|
||||
"last_played": "2024-01-20T14:45:00",
|
||||
"games_played": 25,
|
||||
"total_score": 15420,
|
||||
"best_score": 980,
|
||||
"settings": {
|
||||
"difficulty": "normal",
|
||||
"sound_volume": 75,
|
||||
"music_volume": 60,
|
||||
"screen_shake": true,
|
||||
"auto_save": true
|
||||
},
|
||||
"achievements": [
|
||||
"first_win",
|
||||
"score_500",
|
||||
"games_played_10"
|
||||
]
|
||||
},
|
||||
"Alice": {
|
||||
"name": "Alice",
|
||||
"created_date": "2024-01-10T09:15:00",
|
||||
"last_played": "2025-08-21T13:00:29.825909",
|
||||
"games_played": 43,
|
||||
"total_score": 33000,
|
||||
"best_score": 1250,
|
||||
"settings": {
|
||||
"difficulty": "hard",
|
||||
"sound_volume": 50,
|
||||
"music_volume": 80,
|
||||
"screen_shake": false,
|
||||
"auto_save": true
|
||||
},
|
||||
"achievements": [
|
||||
"first_win",
|
||||
"score_500",
|
||||
"score_1000",
|
||||
"games_played_10",
|
||||
"games_played_25",
|
||||
"hard_mode_master"
|
||||
]
|
||||
},
|
||||
"MAT": {
|
||||
"name": "MAT",
|
||||
"created_date": "2025-08-21T13:24:53.489189",
|
||||
"last_played": "2025-08-21T16:43:50.615171",
|
||||
"games_played": 2,
|
||||
"total_score": 1234,
|
||||
"best_score": 1234,
|
||||
"settings": {
|
||||
"difficulty": "normal",
|
||||
"sound_volume": 50,
|
||||
"music_volume": 50,
|
||||
"screen_shake": true,
|
||||
"auto_save": true
|
||||
},
|
||||
"achievements": []
|
||||
}
|
||||
},
|
||||
"active_profile": "MAT"
|
||||
}
|
||||
Reference in New Issue
Block a user