@@ -107,6 +107,7 @@ const EGG_TYPES = {
107107 epic : 0.5 ,
108108 legendary : 0.2 ,
109109 } ,
110+ buyPosition : { x : - 97.73 , y : - 12.08 , z : 13.17 } ,
110111 } ,
111112 SPOTTED : {
112113 name : 'Spotted Egg' ,
@@ -120,6 +121,7 @@ const EGG_TYPES = {
120121 epic : 0.8 ,
121122 legendary : 0.5 ,
122123 } ,
124+ buyPosition : { x : - 89.87 , y : - 12.59 , z : - 2.18 } ,
123125 } ,
124126 GOLDEN : {
125127 name : 'Golden Egg' ,
@@ -133,6 +135,7 @@ const EGG_TYPES = {
133135 epic : 1.5 ,
134136 legendary : 1.0 ,
135137 } ,
138+ buyPosition : { x : - 82.12 , y : - 12.46 , z : - 17.4 } ,
136139 } ,
137140 CRYSTAL : {
138141 name : 'Crystal Egg' ,
@@ -146,6 +149,7 @@ const EGG_TYPES = {
146149 epic : 2.0 ,
147150 legendary : 3.0 ,
148151 } ,
152+ buyPosition : { x : - 73.78 , y : - 12.07 , z : - 29.45 } ,
149153 } ,
150154}
151155
@@ -172,7 +176,7 @@ const chatEntity = EntityManager.getFirstEntityWithComponent(allEntities, ChatCo
172176const playerData = new Map ( )
173177
174178// Leaderboard display
175- const leaderboardText = new FloatingText ( '👑 LEADERBOARD 🏆' , 0 , 10 , - 250 , 150 )
179+ const leaderboardText = new FloatingText ( '👑 LEADERBOARD 🏆' , 93.47 , - 12.45 , 39.26 , 150 )
176180
177181function updateLeaderboard ( ) {
178182 // Convert Map to array for sorting
@@ -499,25 +503,19 @@ function levelUpPet(playerId, petIndex) {
499503}
500504
501505// Initialize separate egg shops for each egg type
502- Object . entries ( EGG_TYPES ) . forEach ( ( [ eggType , eggData ] , index ) => {
506+ Object . entries ( EGG_TYPES ) . forEach ( ( [ eggType , eggData ] ) => {
503507 // Position each shop in a line, spaced out from each other
504- const xPos = index * 16 // Spread them out by 4 units, starting at -4
505-
506- const eggShop = new Cube ( {
507- position : { x : xPos - 50 , y : - 15 , z : 130.238 } ,
508- size : {
509- width : 2 ,
510- height : 2 ,
511- depth : 2 ,
512- } ,
508+ const eggShop = new Mesh ( {
509+ position : { x : eggData . buyPosition . x , y : eggData . buyPosition . y , z : eggData . buyPosition . z } ,
513510 colliderProperties : {
514511 isSensor : true ,
515512 } ,
516513 physicsProperties : {
517514 mass : 0 ,
518515 gravityScale : 0 ,
519516 } ,
520- // name: eggData.name,
517+ meshUrl : 'https://notbloxo.fra1.cdn.digitaloceanspaces.com/Notblox-Assets/base/Egg.glb' ,
518+ name : eggData . name ,
521519 } )
522520
523521 // Add proximity prompt for buying this specific egg type
@@ -553,14 +551,14 @@ Object.entries(EGG_TYPES).forEach(([eggType, eggData], index) => {
553551 } ,
554552 interactionCooldown : 1000 ,
555553 holdDuration : 0 ,
556- maxInteractDistance : 10 ,
554+ maxInteractDistance : 12 ,
557555 } )
558556 eggShop . entity . addNetworkComponent ( eggShopPrompt )
559557} )
560558
561559// Initialize egg hatching station
562560const eggHatchingStation = new Cube ( {
563- position : { x : - 0.027 , y : - 15.877 , z : 80.238 } ,
561+ position : { x : 90.27 , y : - 15 , z : - 57.81 } ,
564562 size : {
565563 width : 0.1 ,
566564 height : 0.1 ,
@@ -682,10 +680,12 @@ const eggHatchPrompt = new ProximityPromptComponent(eggHatchingStation.entity.id
682680
683681 // Send appropriate notifications based on rarity
684682 const rarityInfo = RARITY_DATA [ petData . rarity ]
685- const hatchMessage = `Your ${ eggData . emoji } ${ eggData . name } hatched into a ${ rarityInfo . emoji } ${ petData . name } ! ( ${ petData . bonus } coins/jump)`
686-
687- sendTargetedNotification ( `🥚 Hatched!` , hatchMessage , [ playerId ] )
683+ // Create a colored message based on pet rarity
684+ const rarityText = getRarityColoredText ( petData . name , petData . rarity )
685+ const hatchMessage = `Your ${ eggData . emoji } ${ eggData . name } hatched into a ${ rarityText } ! It gives you + ${ pet . bonus } coins per jump!`
688686
687+ sendTargetedNotification ( `🐣 New Pet!` , hatchMessage , [ playerId ] )
688+ sendTargetedChat ( '🐣' , hatchMessage , [ playerId ] )
689689 // For rare or higher pets, broadcast to everyone to create FOMO
690690 if (
691691 petData . rarity === 'rare' ||
@@ -992,6 +992,25 @@ ScriptableSystem.update = (dt, entities) => {
992992 '📊' ,
993993 `${ playerData . name } stats: 💰 ${ coins } coins | 🥚 ${ eggs } eggs | 🐾 ${ pets . length } pets${ legendaryString } | ⏱️ ${ playtimeString } `
994994 )
995+ } else if ( command === '/pos' ) {
996+ const playerData = getPlayerData ( event . entityId )
997+ if ( ! playerData ) continue
998+ const entity = EntityManager . getEntityById ( entities , event . entityId )
999+ if ( ! entity ) {
1000+ console . error ( 'Entity not found' , event . entityId )
1001+ continue
1002+ }
1003+ // Show player position
1004+ const positionComponent = entity . getComponent ( PositionComponent )
1005+ if ( ! positionComponent ) {
1006+ console . error ( 'Position component not found' , positionComponent )
1007+ continue
1008+ }
1009+ const position = positionComponent . serialize ( )
1010+ sendGlobalChatMessage (
1011+ '📍' ,
1012+ `${ playerData . name } is at ${ position . x } , ${ position . y } , ${ position . z } `
1013+ )
9951014 }
9961015 }
9971016 }
0 commit comments