Skip to content

Commit f42e736

Browse files
author
Daniel Britt
committed
Fun avoid game ChatDev created
1 parent eaff616 commit f42e736

11 files changed

+5650
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
{
2+
"chain": [
3+
{
4+
"phase": "DemandAnalysis",
5+
"phaseType": "SimplePhase",
6+
"max_turn_step": -1,
7+
"need_reflect": "True"
8+
},
9+
{
10+
"phase": "LanguageChoose",
11+
"phaseType": "SimplePhase",
12+
"max_turn_step": -1,
13+
"need_reflect": "True"
14+
},
15+
{
16+
"phase": "Coding",
17+
"phaseType": "SimplePhase",
18+
"max_turn_step": 1,
19+
"need_reflect": "False"
20+
},
21+
{
22+
"phase": "CodeCompleteAll",
23+
"phaseType": "ComposedPhase",
24+
"cycleNum": 10,
25+
"Composition": [
26+
{
27+
"phase": "CodeComplete",
28+
"phaseType": "SimplePhase",
29+
"max_turn_step": 1,
30+
"need_reflect": "False"
31+
}
32+
]
33+
},
34+
{
35+
"phase": "CodeReview",
36+
"phaseType": "ComposedPhase",
37+
"cycleNum": 3,
38+
"Composition": [
39+
{
40+
"phase": "CodeReviewComment",
41+
"phaseType": "SimplePhase",
42+
"max_turn_step": 1,
43+
"need_reflect": "False"
44+
},
45+
{
46+
"phase": "CodeReviewModification",
47+
"phaseType": "SimplePhase",
48+
"max_turn_step": 1,
49+
"need_reflect": "False"
50+
}
51+
]
52+
},
53+
{
54+
"phase": "HumanAgentInteraction",
55+
"phaseType": "ComposedPhase",
56+
"cycleNum": 5,
57+
"Composition": [
58+
{
59+
"phase": "CodeReviewHuman",
60+
"phaseType": "SimplePhase",
61+
"max_turn_step": 1,
62+
"need_reflect": "False"
63+
}
64+
]
65+
},
66+
{
67+
"phase": "Test",
68+
"phaseType": "ComposedPhase",
69+
"cycleNum": 3,
70+
"Composition": [
71+
{
72+
"phase": "TestErrorSummary",
73+
"phaseType": "SimplePhase",
74+
"max_turn_step": 1,
75+
"need_reflect": "False"
76+
},
77+
{
78+
"phase": "TestModification",
79+
"phaseType": "SimplePhase",
80+
"max_turn_step": 1,
81+
"need_reflect": "False"
82+
}
83+
]
84+
},
85+
{
86+
"phase": "EnvironmentDoc",
87+
"phaseType": "SimplePhase",
88+
"max_turn_step": 1,
89+
"need_reflect": "True"
90+
},
91+
{
92+
"phase": "Manual",
93+
"phaseType": "SimplePhase",
94+
"max_turn_step": 1,
95+
"need_reflect": "False"
96+
}
97+
],
98+
"recruitments": [
99+
"Chief Executive Officer",
100+
"Counselor",
101+
"Chief Human Resource Officer",
102+
"Chief Product Officer",
103+
"Chief Technology Officer",
104+
"Programmer",
105+
"Code Reviewer",
106+
"Software Test Engineer",
107+
"Chief Creative Officer"
108+
],
109+
"clear_structure": "True",
110+
"brainstorming": "False",
111+
"gui_design": "True",
112+
"git_management": "False",
113+
"self_improve": "False"
114+
}

WareHouse/trippy_avoid_game_DefaultOrganization_20231006224623/PhaseConfig.json

+301
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{
2+
"Chief Executive Officer": [
3+
"{chatdev_prompt}",
4+
"You are Chief Executive Officer. Now, we are both working at ChatDev and we share a common interest in collaborating to successfully complete a task assigned by a new customer.",
5+
"Your main responsibilities include being an active decision-maker on users' demands and other key policy issues, leader, manager, and executor. Your decision-making role involves high-level decisions about policy and strategy; and your communicator role can involve speaking to the organization's management and employees.",
6+
"Here is a new customer's task: {task}.",
7+
"To complete the task, I will give you one or more instructions, and you must help me to write a specific solution that appropriately solves the requested instruction based on your expertise and my needs."
8+
],
9+
"Chief Product Officer": [
10+
"{chatdev_prompt}",
11+
"You are Chief Product Officer. we are both working at ChatDev. We share a common interest in collaborating to successfully complete a task assigned by a new customer.",
12+
"You are responsible for all product-related matters in ChatDev. Usually includes product design, product strategy, product vision, product innovation, project management and product marketing.",
13+
"Here is a new customer's task: {task}.",
14+
"To complete the task, you must write a response that appropriately solves the requested instruction based on your expertise and customer's needs."
15+
],
16+
"Counselor": [
17+
"{chatdev_prompt}",
18+
"You are Counselor. Now, we share a common interest in collaborating to successfully complete a task assigned by a new customer.",
19+
"Your main responsibilities include asking what user and customer think and provide your valuable suggestions. ",
20+
"Here is a new customer's task: {task}.",
21+
"To complete the task, I will give you one or more instructions, and you must help me to write a specific solution that appropriately solves the requested instruction based on your expertise and my needs."
22+
],
23+
"Chief Technology Officer": [
24+
"{chatdev_prompt}",
25+
"You are Chief Technology Officer. we are both working at ChatDev. We share a common interest in collaborating to successfully complete a task assigned by a new customer.",
26+
"You are very familiar to information technology. You will make high-level decisions for the overarching technology infrastructure that closely align with the organization's goals, while you work alongside the organization's information technology (\"IT\") staff members to perform everyday operations.",
27+
"Here is a new customer's task: {task}.",
28+
"To complete the task, You must write a response that appropriately solves the requested instruction based on your expertise and customer's needs."
29+
],
30+
"Chief Human Resource Officer": [
31+
"{chatdev_prompt}",
32+
"You are Chief Human Resource Officer. Now, we are both working at ChatDev and we share a common interest in collaborating to successfully complete a task assigned by a new customer.",
33+
"You are a corporate officer who oversees all aspects of human resource management and industrial relations policies, practices and operations for an organization. You will be involved in board staff recruitment, member selection, executive compensation, and succession planning. Besides, You report directly to the chief executive officer (CEO) and am a member of the most senior-level committees of a company (e.g., executive committee or office of CEO).",
34+
"Here is a new customer's task: {task}.",
35+
"To complete the task, you must write a response that appropriately solves the requested instruction based on your expertise and customer's needs."
36+
],
37+
"Programmer": [
38+
"{chatdev_prompt}",
39+
"You are Programmer. we are both working at ChatDev. We share a common interest in collaborating to successfully complete a task assigned by a new customer.",
40+
"You can write/create computer software or applications by providing a specific programming language to the computer. You have extensive computing and coding experience in many varieties of programming languages and platforms, such as Python, Java, C, C++, HTML, CSS, JavaScript, XML, SQL, PHP, etc,.",
41+
"Here is a new customer's task: {task}.",
42+
"To complete the task, you must write a response that appropriately solves the requested instruction based on your expertise and customer's needs."
43+
],
44+
"Code Reviewer": [
45+
"{chatdev_prompt}",
46+
"You are Code Reviewer. we are both working at ChatDev. We share a common interest in collaborating to successfully complete a task assigned by a new customer.",
47+
"You can help programmers to assess source codes for software troubleshooting, fix bugs to increase code quality and robustness, and offer proposals to improve the source codes.",
48+
"Here is a new customer's task: {task}.",
49+
"To complete the task, you must write a response that appropriately solves the requested instruction based on your expertise and customer's needs."
50+
],
51+
"Software Test Engineer": [
52+
"{chatdev_prompt}",
53+
"You are Software Test Engineer. we are both working at ChatDev. We share a common interest in collaborating to successfully complete a task assigned by a new customer.",
54+
"You can use the software as intended to analyze its functional properties, design manual and automated test procedures to evaluate each software product, build and implement software evaluation test programs, and run test programs to ensure that testing protocols evaluate the software correctly.",
55+
"Here is a new customer's task: {task}.",
56+
"To complete the task, you must write a response that appropriately solves the requested instruction based on your expertise and customer's needs."
57+
],
58+
"Chief Creative Officer": [
59+
"{chatdev_prompt}",
60+
"You are Chief Creative Officer. we are both working at ChatDev. We share a common interest in collaborating to successfully complete a task assigned by a new customer.",
61+
"You direct ChatDev's creative software's and develop the artistic design strategy that defines the company's brand. You create the unique image or music of our produced software's and deliver this distinctive design to consumers to create a clear brand image which is a fundamental and essential work throughout the company.",
62+
"Here is a new customer's task: {task}.",
63+
"To complete the task, you must write a response that appropriately solves the requested instruction based on your expertise and customer's needs."
64+
]
65+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
'''
2+
This file defines the Character class, which represents the user-controlled character in the game.
3+
'''
4+
import pygame
5+
class Character(pygame.sprite.Sprite):
6+
def __init__(self, screen_width, screen_height):
7+
super().__init__()
8+
self.image = pygame.Surface((50, 50))
9+
self.image.fill((0, 0, 255))
10+
self.rect = self.image.get_rect()
11+
self.rect.centerx = screen_width // 2
12+
self.rect.centery = screen_height // 2
13+
def update(self, mouse_pos):
14+
self.rect.center = mouse_pos
15+
def draw(self, screen):
16+
screen.blit(self.image, self.rect)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
'''
2+
This file defines the Circle class, which represents the randomly sized circles flying around the screen.
3+
'''
4+
import pygame
5+
import random
6+
class Circle(pygame.sprite.Sprite):
7+
def __init__(self, screen_width, screen_height):
8+
super().__init__()
9+
self.radius = random.randint(10, 30)
10+
self.image = pygame.Surface((self.radius * 2, self.radius * 2), pygame.SRCALPHA)
11+
pygame.draw.circle(self.image, (255, 0, 0), (self.radius, self.radius), self.radius)
12+
self.rect = self.image.get_rect()
13+
# Determine the initial position of the circle on the outside edge
14+
side = random.randint(0, 3)
15+
if side == 0: # Top edge
16+
self.rect.centerx = random.randint(0, screen_width)
17+
self.rect.centery = -self.radius
18+
elif side == 1: # Right edge
19+
self.rect.centerx = screen_width + self.radius
20+
self.rect.centery = random.randint(0, screen_height)
21+
elif side == 2: # Bottom edge
22+
self.rect.centerx = random.randint(0, screen_width)
23+
self.rect.centery = screen_height + self.radius
24+
else: # Left edge
25+
self.rect.centerx = -self.radius
26+
self.rect.centery = random.randint(0, screen_height)
27+
# Determine the initial velocity of the circle
28+
self.velocity_x = random.randint(-5, 5)
29+
self.velocity_y = random.randint(-5, 5)
30+
def update(self, screen_width, screen_height):
31+
self.rect.centerx += self.velocity_x
32+
self.rect.centery += self.velocity_y
33+
# Check if the circle has reached the edge of the screen
34+
if self.rect.right < 0 or self.rect.left > screen_width or self.rect.bottom < 0 or self.rect.top > screen_height:
35+
self.kill()
36+
@staticmethod
37+
def spawn(circles, screen_width, screen_height):
38+
if len(circles) < 10: # Limit the number of circles on the screen
39+
circle = Circle(screen_width, screen_height)
40+
circles.add(circle)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
'''
2+
This is the main file of the game. It initializes the game window, handles user input, and updates the game state.
3+
'''
4+
import pygame
5+
import sys
6+
from character import Character
7+
from circle import Circle
8+
# Initialize pygame
9+
pygame.init()
10+
# Set up the game window
11+
screen_width = 800
12+
screen_height = 600
13+
screen = pygame.display.set_mode((screen_width, screen_height))
14+
pygame.display.set_caption("Circle Dodge Game")
15+
# Create the character
16+
character = Character(screen_width, screen_height)
17+
# Create a group to hold the circles
18+
circles = pygame.sprite.Group()
19+
# Game loop
20+
game_over = False
21+
clock = pygame.time.Clock()
22+
while not game_over:
23+
# Handle events
24+
for event in pygame.event.get():
25+
if event.type == pygame.QUIT:
26+
game_over = True
27+
# Clear the screen
28+
screen.fill((255, 255, 255))
29+
# Update the character
30+
character.update(pygame.mouse.get_pos())
31+
# Spawn new circles
32+
Circle.spawn(circles, screen_width, screen_height)
33+
# Update and draw the circles
34+
circles.update(screen_width, screen_height)
35+
circles.draw(screen)
36+
# Check for collision with character
37+
if pygame.sprite.spritecollide(character, circles, False):
38+
game_over = True
39+
# Draw the character
40+
character.draw(screen)
41+
# Update the display
42+
pygame.display.flip()
43+
# Limit the frame rate to 60 FPS
44+
clock.tick(60)
45+
# Game over screen
46+
screen.fill((255, 255, 255))
47+
font = pygame.font.Font(None, 36)
48+
text = font.render("Game Over", True, (0, 0, 0))
49+
text_rect = text.get_rect(center=(screen_width // 2, screen_height // 2))
50+
screen.blit(text, text_rect)
51+
pygame.display.flip()
52+
pygame.time.wait(2000)
53+
pygame.quit()
54+
sys.exit()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Circle Dodge Game User Manual
2+
3+
## Introduction
4+
5+
Welcome to the Circle Dodge Game! This game is a simple and fun application where you control a character using your mouse and try to avoid touching randomly sized circles flying around the screen. The objective is to survive as long as possible without colliding with any circles.
6+
7+
## Installation
8+
9+
To install and run the Circle Dodge Game, please follow the steps below:
10+
11+
1. Make sure you have Python installed on your computer. You can download Python from the official website: https://www.python.org/downloads/
12+
13+
2. Open a terminal or command prompt and navigate to the directory where you want to install the game.
14+
15+
3. Clone the game repository by running the following command:
16+
```
17+
git clone https://github.com/your-username/circle-dodge-game.git
18+
```
19+
20+
4. Navigate to the game directory:
21+
```
22+
cd circle-dodge-game
23+
```
24+
25+
5. Install the required dependencies by running the following command:
26+
```
27+
pip install -r requirements.txt
28+
```
29+
30+
## Usage
31+
32+
To play the Circle Dodge Game, follow these steps:
33+
34+
1. Open a terminal or command prompt and navigate to the game directory.
35+
36+
2. Run the game by executing the following command:
37+
```
38+
python main.py
39+
```
40+
41+
3. The game window will open, and you will see your character in the center of the screen.
42+
43+
4. Move your mouse to control the character. The character will follow the movement of your mouse cursor.
44+
45+
5. Randomly sized circles will continuously spawn and fly around the screen. Your goal is to avoid touching any of these circles.
46+
47+
6. If your character collides with a circle, the game will end, and a "Game Over" screen will be displayed for 2 seconds.
48+
49+
7. After the "Game Over" screen disappears, you can close the game window to exit the game.
50+
51+
## Customization
52+
53+
If you want to customize the game, you can modify the code in the following files:
54+
55+
- `main.py`: This file contains the main game loop and handles user input. You can change the game window size, character appearance, and other game logic.
56+
57+
- `character.py`: This file defines the `Character` class, which represents the user-controlled character in the game. You can modify the character's appearance and behavior.
58+
59+
- `circle.py`: This file defines the `Circle` class, which represents the randomly sized circles flying around the screen. You can modify the circle's appearance, spawn rate, and movement behavior.
60+
61+
## Conclusion
62+
63+
Congratulations! You have successfully installed and played the Circle Dodge Game. Enjoy the game and challenge yourself to achieve a high score by avoiding as many circles as possible. Have fun and happy dodging!
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
Task:
2+
A game where randomly sized circles are flying around the screen, that always start on the outside edge, and continuously spawn. The user moving the character with their mouse, has to avoid touching any of the random circles flying around the screen
3+
4+
Config:
5+
ChatEnvConfig.clear_structure: True
6+
ChatEnvConfig.git_management: False
7+
ChatEnvConfig.gui_design: True
8+
9+
10+
Roster:
11+
Chief Executive Officer, Counselor, Chief Human Resource Officer, Chief Product Officer, Chief Technology Officer, Programmer, Code Reviewer, Software Test Engineer, Chief Creative Officer
12+
13+
Modality:
14+
application
15+
16+
Ideas:
17+
18+
19+
Language:
20+
Python
21+
22+
Code_Version:
23+
6.0
24+
25+
Proposed_images:
26+
0
27+
28+
Incorporated_images:
29+
0
30+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pygame==2.0.1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
A game where randomly sized circles are flying around the screen, that always start on the outside edge, and continuously spawn. The user moving the character with their mouse, has to avoid touching any of the random circles flying around the screen

0 commit comments

Comments
 (0)