@@ -13,11 +13,11 @@ media/
1313├── kubito.css # Webview styles
1414├── kubito.js # Compiled JavaScript from TypeScript
1515├── kubito.js.map # Source map for debugging
16- ├── kubito_walking .gif # Walking animation
17- ├── kubito_jumping .gif # Jumping animation
18- ├── kubito_idle.png # Idle sprite
19- ├── kubit_logo .png # Custom message icon
20- └── kubit_love .png # Custom message icon
16+ ├── kubito-walking .gif # Walking animation
17+ ├── kubito-jumping .gif # Jumping animation
18+ ├── kubito-idle.gif # Idle animation
19+ ├── kubit-logo .png # Custom message icon
20+ └── kubit-love .png # Custom message icon
2121
2222out/ # Compiled extension files
2323└── extension.js # Compiled backend
@@ -44,46 +44,73 @@ out/ # Compiled extension files
4444
4545### ** 3. Message System**
4646
47- - ** Auto-generation** : Messages appear every 5-10 seconds
47+ - ** Auto-generation** : Messages appear every 3-7 seconds
4848- ** Dynamic Following** : Speech bubbles follow Kubito as he moves
4949- ** Smart Positioning** : Messages trigger direction changes to avoid edge
5050 collisions
5151- ** Priority Handling** : Jump interactions cancel active messages
5252- ** Content Types** : Emojis, text, and custom Kubit team images
5353
54- ## 🎨 Animation States
54+ ## 🎨 Animation States & Movement System
5555
56- ### ** State Machine**
56+ ### ** Enhanced State Machine**
5757
5858```
59- Walking ──click──→ Jumping ──1s──→ Idle ──300ms──→ Walking
60- ↑ ↓
61- └─────────── Message Display (follows) ←──────────┘
59+ WANDERING ──timer(3-5s)──→ PAUSED ──timer(1-2.5s)──→ WANDERING
60+ ↑ ↓ ↑
61+ └── Message Display ──────┼── TALKING ──timer(3s)────┘
62+ ↓
63+ Jump(20% chance)
64+ ↓
65+ JUMPING ──800ms── → back to appropriate state
6266```
6367
68+ ### ** Kubito States (KubitoState enum)**
69+
70+ - ** WANDERING** : Active movement at 0.15px/frame with boundary detection
71+ - ** PAUSED** : Stationary state lasting 1-2.5 seconds, safe zone for messages
72+ - ** JUMPING** : 800ms autonomous jump animation with cooldown system
73+ - ** TALKING** : Message display state with Kubito paused and speech bubble following
74+
6475### ** Sprite Management**
6576
66- - ** Walking State** : ` kubito_walking .gif` - Continuous movement
67- - ** Jumping State** : ` kubito_jumping .gif` - 1-second jump animation
68- - ** Idle State** : ` kubito_idle.png ` - 300ms static sprite after landing
77+ - ** Walking State** : ` kubito-walking .gif` - Smooth continuous movement animation
78+ - ** Jumping State** : ` kubito-jumping .gif` - 800ms jump sequence with landing
79+ - ** Idle State** : ` kubito-idle.gif ` - Idle animation
6980- ** Direction Classes** : ` walking-right ` / ` walking-left ` for CSS transforms
7081
82+ ### ** Smart Timing System**
83+
84+ - ** Wandering Duration** : 3-5 seconds of active movement
85+ - ** Pause Duration** : 1-2.5 seconds
86+ - ** Jump Probability** : 20% chance when entering pause state
87+ - ** Message Safe Zone** : 90% center area for optimal visibility
88+ - ** Jump Cooldown** : 1-second buffer prevents message conflicts
89+
7190## 🔄 Event Flow
7291
73- ### ** User Interaction **
92+ ### ** Autonomous Movement **
7493
75- 1 . User clicks Kubito → Cancel any active message
76- 2 . Switch to jumping sprite → Set jumping state
77- 3 . After 1s → Switch to idle sprite for 300ms
78- 4 . Return to walking sprite → Resume movement
94+ 1 . ** Wandering Phase** : Kubito moves at 0.15px/frame for 3-5 seconds
95+ 2 . ** Transition to Pause** : Natural deceleration to stationary state
96+ 3 . ** Pause Phase** : 1-2.5 seconds of idle animation in safe zone
97+ 4 . ** Optional Jump** : 20% probability of autonomous jump with 800ms animation
98+ 5 . ** Message Opportunity** : Messages only appear during pause in safe zone
99+ 6 . ** Return to Wandering** : Cycle continues with potential direction changes
79100
80- ### ** Message Lifecycle **
101+ ### ** Smart Message System **
81102
82- 1 . Timer triggers (5-10s random) → Check if not jumping
83- 2 . Show speech bubble → Set showing message state
84- 3 . Follow Kubito's movement → Update bubble position each frame
85- 4 . Check edge collision → Change Kubito direction if needed
86- 5 . After 3s → Fade out bubble → Reset message state
103+ 1 . Timer triggers (3-7s random) → Validate conditions (paused + safe zone + no jump cooldown)
104+ 2 . Show speech bubble → Transition to TALKING state
105+ 3 . Follow Kubito's position → Maintain bubble alignment during pause
106+ 4 . Smart positioning → Prevent edge collisions with expanded safe zone
107+ 5 . After 3s → Fade out bubble → Brief pause before returning to wandering
108+
109+ ### ** Performance Optimizations**
110+
111+ 1 . ** Efficient DOM Updates** : State tracking prevents unnecessary image changes
112+ 2 . ** Frame-perfect Timing** : RequestAnimationFrame ensures 60fps smoothness
113+ 3 . ** Memory Management** : Proper event cleanup and state management
87114
88115## 🔧 Build Process
89116
@@ -104,10 +131,9 @@ vsce package # Creates .vsix file
104131
105132## 🎯 Performance Optimizations
106133
107- - ** 60fps Animation Loop** : RequestAnimationFrame for smooth movement
108- - ** Efficient Updates** : Only update bubble position when message is active
109- - ** State Guards** : Prevent redundant operations with state checks
110- - ** Relaxed Speed** : 0.3px/frame for comfortable interaction
134+ - ** 60fps Animation Loop** : RequestAnimationFrame for smooth movement with intelligent state transitions
135+ - ** Efficient State Updates** : KubitoState enum eliminates redundant DOM operations
136+ - ** Optimized Movement Speed** : 0.15px/frame for natural, comfortable interaction
111137- ** Minimal DOM Manipulation** : Reuse elements when possible
112138
113139## 🔒 Security Considerations
@@ -117,22 +143,9 @@ vsce package # Creates .vsix file
117143- ** CSP Compliance** : Content Security Policy for web resources
118144- ** No External Dependencies** : All resources bundled locally
119145
120- ## 🆕 v1.0.0 Features
121-
122- - ** Professional Structure** : Follows Microsoft VS Code extension standards
123- - ** Comprehensive Testing** : 16 test cases covering all functionality
124- - ** Interactive Jumping** : Click-to-jump with priority over messages
125- - ** Smart Message Following** : Bubbles track Kubito's movement
126- - ** Collision Intelligence** : Direction changes to prevent edge collisions
127- - ** Multi-sprite System** : Walking, jumping, and idle animations
128- - ** Optimized Timing** : Improved animation speeds and durations
129- - ** Enhanced UX** : Hover effects and visual feedback
130- - ** Open Source Ready** : Clean code structure and documentation
131-
132146## 📝 Development Notes
133147
134148- ** TypeScript First** : Both backend and frontend use TypeScript
135- - ** Modular Design** : Clear separation between animation, messaging, and
136149 interaction
137150- ** Extensible** : Easy to add new sprites, messages, or behaviors
138151- ** VS Code Standards** : Follows VS Code extension development best practices
0 commit comments