Skip to content

Commit

Permalink
fix sync of IDs
Browse files Browse the repository at this point in the history
  • Loading branch information
nearnshaw committed Jan 6, 2024
1 parent c063516 commit 7844406
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 20 deletions.
14 changes: 7 additions & 7 deletions assets/scene/main.composite
Original file line number Diff line number Diff line change
Expand Up @@ -261,21 +261,21 @@
"521": {
"json": {
"position": {
"x": 16.390798568725586,
"x": 16.46424102783203,
"y": 0.7099999785423279,
"z": 14.05458927154541
},
"scale": {
"x": 1,
"y": 1,
"z": 1
},
"rotation": {
"x": -0.5,
"y": -0.5,
"z": 0.5,
"w": 0.5
},
"scale": {
"x": 1,
"y": 1,
"z": 1
},
"parent": 0
}
},
Expand Down Expand Up @@ -1758,7 +1758,7 @@
"serializationType": "map"
},
"data": {
"541": {
"538": {
"json": {
"gizmo": 0
}
Expand Down
13 changes: 10 additions & 3 deletions bin/game.js

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions bin/game.js.map

Large diffs are not rendered by default.

Binary file modified main.crdt
Binary file not shown.
5 changes: 4 additions & 1 deletion scene.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"ecs7": true,
"runtimeVersion": "7",
"display": {
"title": "beer-dispenser",
"title": "Mika's Kitchen",
"favicon": "favicon_asset"
},
"contact": {
Expand Down Expand Up @@ -38,5 +38,8 @@
}
}
],
"worldConfiguration": {
"name": "MaximoCossetti.dcl.eth"
},
"name": "beer-dispenser"
}
18 changes: 16 additions & 2 deletions src/modules/customers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -427,8 +427,8 @@ export function deliverOrder(dishType: number, customer: Entity, dish?: Entity)

updateSpeechBubble(customerData.speechBubble, message, SpeechBubbleType.Good)

// const speechBubble = createSpeechBubble(customer, message, 2.3, SpeechBubbleType.Good)
// customerData.speechBubble = speechBubble
//playSound("sounds/error.mp3", false, getPlayerPosition())


} else {
// Wrong dish
Expand All @@ -439,6 +439,18 @@ export function deliverOrder(dishType: number, customer: Entity, dish?: Entity)

updateSpeechBubble(customerData.speechBubble, message, SpeechBubbleType.Bad)

playSound("sounds/error.mp3", false, getPlayerPosition())

if (gameData.playerMisses <= 3) {

utils.timers.setTimeout(() => {
restartGame()

}, 1000)


}

// const speechBubble = createSpeechBubble(customer, message, 2.3, SpeechBubbleType.Bad)
// customerData.speechBubble = speechBubble
}
Expand Down Expand Up @@ -519,6 +531,8 @@ export function restartGame() {
hideCustomer(customer)
}

playSound("sounds/error.mp3", false, getPlayerPosition())

updateScore()
updateMisses()
}
4 changes: 2 additions & 2 deletions src/modules/factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
EasingFunction
} from '@dcl/sdk/ecs'
import { Vector3, Quaternion } from '@dcl/sdk/math'
import { BeerGlass, BeerType, CuttingBoard, getTapData, GrabableObjectComponent, IngredientType, SyncEntityIDs, TapBase, TapComponent } from '../definitions'
import { BeerGlass, BeerType, CuttingBoard, DynamicSyncId, getTapData, GrabableObjectComponent, IngredientType, SyncEntityIDs, TapBase, TapComponent } from '../definitions'
import { syncEntity, parentEntity } from '@dcl/sdk/network'
import { cutSushi } from './cuttingBoard'
import { getSyncId } from './helpers'
Expand Down Expand Up @@ -119,7 +119,7 @@ export function createIngredient(ingredient: IngredientType, position: Vector3,

syncEntity(
entity,
[AudioSource.componentId, Transform.componentId, GrabableObjectComponent.componentId, Tween.componentId, GltfContainer.componentId], id
[AudioSource.componentId, Transform.componentId, GrabableObjectComponent.componentId, Tween.componentId, GltfContainer.componentId, DynamicSyncId.componentId], id
)

return ingredient
Expand Down

0 comments on commit 7844406

Please sign in to comment.