Skip to content

Commit bcf4f0d

Browse files
committed
sync session event in flower garden occurs
1 parent d4159fd commit bcf4f0d

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

watch/app/src/main/java/com/imsproject/watch/Properties.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import org.w3c.dom.Text
1212

1313
const val PACKAGE_PREFIX = "com.imsproject.watch"
1414

15-
const val ACTIVITY_DEBUG_MODE = false // set true to be able run the activity directly from the IDE
15+
const val ACTIVITY_DEBUG_MODE = true // set true to be able run the activity directly from the IDE
1616

1717
// ============== Screen size related =============== |
1818

watch/app/src/main/java/com/imsproject/watch/viewmodel/FlowerGardenViewModel.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ class FlowerGardenViewModel : GameViewModel(GameType.FLOWER_GARDEN) {
245245
if(waterDropletSets.isEmpty()) 0 else waterDropletSets.last().timestamp
246246
}
247247

248-
// add new flower if synced click
248+
// synced click
249249
if((opponentsLatestTimestamp - timestamp)
250250
.absoluteValue <= FLOWER_GARDEN_SYNC_TIME_THRESHOLD) {
251251
_currFlowerIndex.value = (_currFlowerIndex.value + 1) % amountOfFlowers
@@ -268,6 +268,7 @@ class FlowerGardenViewModel : GameViewModel(GameType.FLOWER_GARDEN) {
268268
delay(100)
269269
vibrator.vibrate(clickVibration)
270270
}
271+
addEvent(SessionEvent.syncedAtTime(playerId, timestamp))
271272
}
272273
_counter.value++ // used to trigger recomposition
273274
}

0 commit comments

Comments
 (0)