Skip to content

Commit

Permalink
Add more puzzles and update images
Browse files Browse the repository at this point in the history
  • Loading branch information
KovalevAndrey committed Oct 24, 2023
1 parent 4b03ffa commit 3e7ed72
Show file tree
Hide file tree
Showing 681 changed files with 38 additions and 26 deletions.
Binary file removed bumble_logo.png
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,28 +1,19 @@
package com.bumble.puzzyx.composable

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import com.bumble.puzzyx.ui.appyx_dark
import com.bumble.puzzyx.ui.appyx_yellow1
import androidx.compose.ui.layout.ContentScale
import com.bumble.puzzyx.imageloader.EmbeddableResourceImage

@Composable
fun CallToActionScreen(
modifier: Modifier = Modifier,
) {
Box(
EmbeddableResourceImage(
path = "bumble_droidcon.jpg",
contentScale = ContentScale.FillBounds,
modifier = modifier
.fillMaxSize()
.background(appyx_dark)
) {
Text(
text = "Join the challenge",
color = appyx_yellow1,
modifier = Modifier.align(Alignment.Center)
)
}
)
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
package com.bumble.puzzyx.model

enum class Puzzle(
val imagesDir: String,
val frontImagesDir: String,
val backImagesDir: String,
val columns: Int,
val rows: Int
) {

PUZZLE1("bumble_logo", 19, 9);
PUZZLE1("1_front", "1_back",12, 7),
PUZZLE2("2_front", "2_back", 12, 7),
PUZZLE3("3_front", "3_back",12, 7);


val maxEntryCount: Int = columns * rows
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,13 @@ import com.bumble.puzzyx.appyx.component.backstackclipper.BackStackClipper
import com.bumble.puzzyx.composable.AutoPlayScript
import com.bumble.puzzyx.composable.CallToActionScreen
import com.bumble.puzzyx.model.Puzzle.PUZZLE1
import com.bumble.puzzyx.model.Puzzle.PUZZLE2
import com.bumble.puzzyx.model.Puzzle.PUZZLE3
import com.bumble.puzzyx.node.app.PuzzyxAppNode.NavTarget
import com.bumble.puzzyx.node.app.PuzzyxAppNode.NavTarget.CallToAction
import com.bumble.puzzyx.node.app.PuzzyxAppNode.NavTarget.Puzzle1
import com.bumble.puzzyx.node.app.PuzzyxAppNode.NavTarget.Puzzle2
import com.bumble.puzzyx.node.app.PuzzyxAppNode.NavTarget.Puzzle3
import com.bumble.puzzyx.node.app.PuzzyxAppNode.NavTarget.StackedMessages
import com.bumble.puzzyx.node.app.PuzzyxAppNode.NavTarget.StarField
import com.bumble.puzzyx.node.messages.StackedMessagesNode
Expand All @@ -53,6 +57,8 @@ import kotlinx.coroutines.flow.update

private val screens = listOf(
Puzzle1,
Puzzle2,
Puzzle3,
CallToAction,
StarField,
StackedMessages,
Expand All @@ -77,6 +83,12 @@ class PuzzyxAppNode(
@Parcelize
object Puzzle1 : NavTarget()

@Parcelize
object Puzzle2 : NavTarget()

@Parcelize
object Puzzle3 : NavTarget()

@Parcelize
object StackedMessages : NavTarget()

Expand All @@ -95,6 +107,16 @@ class PuzzyxAppNode(
buildContext = buildContext
)

is Puzzle2 -> Puzzle1Node(
puzzle = PUZZLE2,
buildContext = buildContext
)

is Puzzle3 -> Puzzle1Node(
puzzle = PUZZLE3,
buildContext = buildContext
)

is CallToAction -> node(buildContext) { modifier ->
AutoPlayScript(initialDelayMs = 5000) { nextScreen() }
CallToActionScreen(modifier)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,8 @@ import com.bumble.puzzyx.appyx.component.gridpuzzle.operation.carousel
import com.bumble.puzzyx.appyx.component.gridpuzzle.operation.flip
import com.bumble.puzzyx.appyx.component.gridpuzzle.operation.scatter
import com.bumble.puzzyx.composable.AutoPlayScript
import com.bumble.puzzyx.composable.EntryCardSmall
import com.bumble.puzzyx.composable.FlashCard
import com.bumble.puzzyx.imageloader.EmbeddableResourceImage
import com.bumble.puzzyx.model.Entry
import com.bumble.puzzyx.model.Puzzle
import com.bumble.puzzyx.model.PuzzlePiece
import com.bumble.puzzyx.model.puzzle1Entries
Expand Down Expand Up @@ -80,7 +78,6 @@ class Puzzle1Node(
override fun resolve(puzzlePiece: PuzzlePiece, buildContext: BuildContext): Node =
node(buildContext) { modifier ->
val colorIdx = rememberSaveable(puzzlePiece) { Random.nextInt(colors.size) }
val color = colors[colorIdx]

Box(
modifier = modifier
Expand All @@ -91,20 +88,18 @@ class Puzzle1Node(
flash = Color.White,
front = { modifier ->
EmbeddableResourceImage(
path = "${puzzle.imagesDir}/slice_${puzzlePiece.j}_${puzzlePiece.i}.png",
path = "${puzzle.frontImagesDir}/slice_${puzzlePiece.j}_${puzzlePiece.i}.png",
contentScale = ContentScale.FillBounds,
modifier = modifier
.fillMaxSize()
)
},
back = { modifier ->
EntryCardSmall(
EmbeddableResourceImage(
path = "${puzzle.backImagesDir}/slice_${puzzlePiece.j}_${puzzlePiece.i}.png",
contentScale = ContentScale.FillBounds,
modifier = modifier
.fillMaxSize()
.background(color),
// TODO decide on the fate of this
entry = puzzle1Entries[puzzlePiece.entryId] as? Entry.Text
?: Entry.Text(Puzzle.PUZZLE1, "n/a")
)
}
)
Expand Down
Binary file added shared/src/commonMain/resources/1_back/slice_0_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added shared/src/commonMain/resources/1_back/slice_0_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added shared/src/commonMain/resources/1_back/slice_0_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added shared/src/commonMain/resources/1_back/slice_0_4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added shared/src/commonMain/resources/1_back/slice_0_5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added shared/src/commonMain/resources/1_back/slice_0_6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added shared/src/commonMain/resources/1_back/slice_0_7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added shared/src/commonMain/resources/1_back/slice_1_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added shared/src/commonMain/resources/1_back/slice_1_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added shared/src/commonMain/resources/1_back/slice_1_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added shared/src/commonMain/resources/1_back/slice_3_0.png
Binary file added shared/src/commonMain/resources/1_back/slice_4_0.png
Binary file added shared/src/commonMain/resources/1_back/slice_6_1.png
Binary file added shared/src/commonMain/resources/1_back/slice_6_2.png
Binary file added shared/src/commonMain/resources/1_back/slice_6_3.png
Binary file added shared/src/commonMain/resources/1_back/slice_6_4.png
Binary file added shared/src/commonMain/resources/2_back/slice_2_5.png
Binary file added shared/src/commonMain/resources/2_back/slice_2_6.png
Binary file added shared/src/commonMain/resources/2_back/slice_2_7.png
Binary file added shared/src/commonMain/resources/2_back/slice_2_8.png
Binary file added shared/src/commonMain/resources/2_back/slice_3_3.png
Binary file added shared/src/commonMain/resources/2_back/slice_3_8.png
Binary file added shared/src/commonMain/resources/2_back/slice_4_4.png
Binary file added shared/src/commonMain/resources/2_back/slice_4_5.png
Binary file added shared/src/commonMain/resources/2_back/slice_4_6.png
Binary file added shared/src/commonMain/resources/2_back/slice_6_0.png
Loading

0 comments on commit 3e7ed72

Please sign in to comment.