Menu

1 / 5

Game Feel in Jetpack Compose Without a Game Engine

DEV Community: kotlin·Nesim Razon·2 days ago
#QNVmD1Oq
#devtokotlin#devto#dev#game#frame
Reading 0:00
15s threshold

Cubbles is a block-placing puzzle with cute faces on the blocks, and almost all of its charm is feedback: a piece that settles with a bounce, a row that melts away in a wave, a sound and a buzz that grow with your streak. None of it needs a game engine. This post walks through how it is done in plain Jetpack Compose, what the numbers are, where the shortcuts are, and how two other games of ours solve the same problem differently.

Why a puzzle does not need an engine

An 8 by 8 board, three pieces in a tray and a drag gesture do not need physics, a scene graph or a game loop framework. What they need is a clock and a way to draw. Compose gives you both: a Canvas to paint on, and a frame callback to read time from. Everything below sits on those two things.

One Canvas, one clock

The game screen draws the board, the tray, the effects and the floating text in a single Canvas.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.