-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathactions_req.txt
90 lines (79 loc) · 4.35 KB
/
actions_req.txt
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
# Demo Requirements Comparison
## 1. Window Setup
- [x] Create a window using Arcade 3.0
- [x] Set the window dimensions to 800x600 pixels
- [x] Set the window title to "Action System Demo"
- [x] Set a white background color
- [x] Define a text margin at the top of the screen to prevent sprite overlap with text
## 2. Sprite Creation and Management
- [x] Create an ActionSprite class that inherits from arcade.Sprite
- [x] Define a constant for the sprite image path
- [x] Load a character sprite from Arcade's built-in resources
- [x] Initialize the sprite at the center of the screen
- [x] Use arcade.SpriteList to manage and efficiently render sprites
- [x] Implement a method to reset the sprite to its initial state
- [x] Ensure sprites stay within screen bounds and below the text margin
## 3. Action Demonstration
- [x] MoveTo
- [x] MoveBy (specifically to upper left)
- [x] RotateBy
- [x] FadeOut
- [x] FadeIn
- [x] ScaleTo
- [x] ScaleBy
- [x] Blink
- [x] Accelerate
- [x] AccelDecel
- [x] Bezier
- [x] JumpBy
- [x] JumpTo
- [x] Spawn (with 16 sprites following Bezier paths)
## 4. User Interface
- [x] Display the name of the current action being demonstrated
- [x] Show instructions for restarting the demo (SPACE key) or exiting (ESC key) when the demo is complete
- [x] Use arcade.Text objects for efficient text rendering
- [x] Position text elements to avoid overlap with sprites
## 5. Interaction and Flow
- [x] Implement key press handling for SPACE (restart demo) and ESC (exit demo)
- [x] Create a smooth transition between action demonstrations
- [x] Implement a proper restart mechanism that resets sprite states and recreates actions
## 6. Performance and Compatibility
- [x] Ensure smooth animation at 60 FPS (assumed based on Arcade's default behavior)
- [x] Optimize action processing for efficiency
- [x] Ensure full compatibility with Arcade 3.0
- [ ] Test the demo on multiple platforms (Windows, macOS, Linux) - Not verifiable from the code
## 7. Code Structure and Documentation
- [x] Organize the demo code in a clear, readable structure
- [x] Use proper Python naming conventions and style guidelines
- [x] Include necessary imports from the action system modules
- [x] Use constants for frequently used values
- [x] Group related constants together at the top of the file
- [x] Use meaningful and descriptive names for constants
## 8. Error Handling and Recovery
- [x] Implement proper error handling for resource loading and action execution
- [x] Gracefully handle any potential runtime errors
- [x] Ensure the demo can continue or gracefully terminate if an action fails
- [x] Implement an error handling decorator to centralize error handling logic
- [x] Apply the error handling decorator to all relevant methods and functions
- [x] Ensure different error handling behavior for game loop methods vs. other methods
- [x] Print error messages and tracebacks for debugging purposes
## 9. Extensibility
- [x] Structure the demo to allow easy addition of new actions or sprites
- [x] Make it simple to modify the action sequence or add new actions to the demonstration
## 10. Spawn Action with Multiple Sprites
- [x] Implement a Spawn action as the last action in the demo
- [x] Create 16 sprites emanating from the same spot where the JumpTo action stops
- [x] Create unique Bezier paths for each sprite
- [x] Ensure paths start from the center point, move outward in a curved path, circle around at a distance, and return to the center point
- [x] Keep the maximum radius of the movement within screen boundaries and below the text margin
- [x] Make each sprite follow its unique path simultaneously
- [x] Remove the original single sprite when the 16 sprites are spawned
- [x] Ensure spawned sprites have the same scale factor as the sprite in the prior action
- [x] Remove extra sprites created by the Spawn action when the demo is restarted
## 11. Error Handling Decorator
- [x] Create an error_handler decorator to wrap functions and methods
- [x] Ensure the decorator catches and handles exceptions consistently
- [x] Print error messages and tracebacks for debugging purposes
- [x] Allow game loop methods (update, draw) to continue execution even if an error occurs
- [x] Re-raise exceptions for non-game loop methods after logging
- [x] Implement a logging system instead of using print statements for errors