@@ -11,6 +11,11 @@ let treeBufferAbove, treeBufferBelow; // Buffers for trees
1111// Cyclist Stuff
1212var cyclists = [ ] ;
1313const cyclistEmoji = "🚴" ;
14+ const cyclistEmojis = [
15+ "🚴" , "🚴♀️" , "🚴♂️" ,
16+ "🚴🏽" , "🚴🏽♀️" , "🚴🏽♂️" ,
17+ "🚴🏿" , "🚴🏿♀️" , "🚴🏿♂️"
18+ ] ;
1419var numCyclists = 5 ;
1520var cyclistWidth = 50 ;
1621var cyclistHeight = 50 ;
@@ -82,17 +87,18 @@ function windowResized() {
8287 ghosts = [ ] ;
8388}
8489
85- // Initialize cyclists with a small vertical offset
90+ // Initialize cyclists
8691function initializeCyclists ( ) {
87- cyclists = [ ] ;
92+ cyclists = [ ] ;
8893 for ( var i = 0 ; i < numCyclists ; i ++ ) {
8994 var cyclist = {
9095 position : random ( width ) ,
9196 speed : random ( 1 , 4 ) ,
9297 yOffset : random ( - 5 , 5 ) , // Random vertical offset
9398 exploded : false ,
9499 explosionTime : 0 ,
95- skullSpawned : false
100+ skullSpawned : false ,
101+ emoji : random ( cyclistEmojis ) // ✅ Assign a random emoji
96102 } ;
97103 cyclists . push ( cyclist ) ;
98104 }
@@ -195,11 +201,16 @@ function updateCyclist(cyclist) {
195201 }
196202}
197203
198- // Draw cyclist with random vertical offset
199- function drawCyclist ( cyclist ) {
204+ function drawCyclists ( ) {
200205 textSize ( 50 ) ;
201- fill ( 255 , 0 , 0 ) ;
202- text ( cyclistEmoji , cyclist . position , height / 2 + cyclist . yOffset ) ;
206+ textAlign ( CENTER , CENTER ) ;
207+
208+ for ( var i = 0 ; i < cyclists . length ; i ++ ) {
209+ if ( ! cyclists [ i ] . exploded ) {
210+ updateCyclist ( cyclists [ i ] ) ;
211+ text ( cyclists [ i ] . emoji , cyclists [ i ] . position , height / 2 + cyclists [ i ] . yOffset ) ;
212+ }
213+ }
203214}
204215
205216function drawExplosions ( ) {
0 commit comments