-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathexample_enhanced_chain_of_thought_pipeline.yaml
129 lines (106 loc) · 5.24 KB
/
example_enhanced_chain_of_thought_pipeline.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: frogger_clone_builder
steps:
- !ShellCommand
name: generate_game_mechanics
command: |
fluent openai '' --parse-code > game_mechanics.py <<EOT
Write Python code for the core game mechanics of a Frogger clone, including:
- Player movement (up, down, left, right)
- Frog collision detection with cars, water, and logs
- Level progression with increasing difficulty (more cars, faster speeds)
- Basic game logic (scoring, lives, win conditions)
Ensure the game is solvable with proper level design.
Use clear and concise variable names and comments to improve readability.
EOT
- !ShellCommand
name: generate_car_movement
command: |
fluent openai '' --parse-code > car_movement.py <<EOT
Write Python code to generate different types of moving cars (left to right, right to left) on separate lanes within the game.
Ensure cars have varying speeds and patterns to create challenges but allow for safe passage.
Include comments to explain the logic behind car movement.
EOT
- !ShellCommand
name: generate_log_movement
command: |
fluent openai '' --parse-code > log_movement.py <<EOT
Write Python code to generate different types of moving logs (left to right, right to left) on separate lanes within the river.
Ensure logs have varying speeds and patterns to create challenges but allow for safe crossing.
Include comments to explain the logic behind log movement.
EOT
- !ShellCommand
name: generate_environment
command: |
fluent openai '' --parse-code > environment.py <<EOT
Write Python code to define the game environment for Frogger, including:
- A road with multiple lanes
- A wide river at the top 1/4 of the screen with lily pads (safe zones)
- A safe zone on the opposite side of the river
Ensure the environment layout allows the player to reach the safe zone while avoiding obstacles.
Use appropriate data structures to represent the game environment.
EOT
- !ShellCommand
name: generate_game_loop
command: |
fluent openai '' --parse-code > game_loop.py <<EOT
Write Python code for the main game loop of Frogger. The loop should handle:
- User input for player movement
- Updating car, water, and log positions
- Checking for collisions between the player and cars, water, and logs
- Managing player interactions with logs (landing, jumping off)
- Game over conditions (collision with water or car, exceeding time limit, reaching safe zone)
- Updating the game state (environment, player, cars, logs, score, lives) after each update
Ensure the game loop consistently checks for win conditions.
Incorporate comments to explain the game loop logic.
EOT
- !ShellCommand
name: generate_ui_spec
command: |
fluent openai '' --parse-code > ui_spec.json <<EOT
Write a JSON specification for the user interface (UI) of the Frogger clone.
The UI should include:
- Game window dimensions
- Background image for the road, river, and safe zone
- Sprites for player, cars, logs, lily pads, and game elements
- Text elements for score, lives, time remaining, and win/lose messages
Define the layout and positioning of these elements for a clear and user-friendly experience.
EOT
- !ShellCommand
name: generate_ui_code
command: |
python generate_ui.py ${PWD}/ui_spec.json > ui_main.py <<EOT
Write Python code using the Pygame library to implement the UI based on the provided UI specification (ui_spec.json).
Handle user input for game controls (movement, pausing).
Display the game state (environment, player, cars, logs, score, time) using appropriate visuals.
EOT
- !ShellCommand
name: combine_code
command: |
cat game_mechanics.py car_movement.py log_movement.py environment.py game_loop.py ui_main.py > frogger_game.py
echo "# Additional Notes" >> frogger_game.py
echo "# This combined file includes all core game logic and UI implementation." >> frogger_game.py
> combined_code.py
- !ShellCommand
name: summarize_pipeline
command: |
fluent openai '' > pipeline_summary.txt <<EOT
Summarize the steps taken in this pipeline to build a Frogger clone in Python.
Mention the generated functionalities and the importance of ensuring game solvability.
EOT
- !PrintOutput
name: print_completion
value: |
======= Frogger Clone Builder Pipeline Complete =======
The core game logic, car movement, environment, and game loop code have been generated in Python files:
- game_mechanics.py
- car_movement.py
- log_movement.py
- environment.py
- game_loop.py
- ui_main.py
- combined_code.py
A mockup UI image (ui_mockup.png) has also been created for reference.
Remember to implement additional features like levels, power-ups, and sound effects to enhance gameplay.
You can find all the generated code files in the working directory.
Thank you for using the Frogger Clone Builder Pipeline!
=======================================================================