• Showing character (What are home computers??)
• Moving around
• Simple game physics
https://unsplash.com/photos/MdmcpX2ofRk
Slide 5
Slide 5 text
• 8 Bit CPU
• Clock Speed < 4MHz
• < 1 MIPS (PS4: 200000)
• RAM <= 64 KB
• Usually programmed in BASIC
Slide 6
Slide 6 text
No content
Slide 7
Slide 7 text
No content
Slide 8
Slide 8 text
No content
Slide 9
Slide 9 text
No content
Slide 10
Slide 10 text
Graphics modes
• Hi Res Graphics
• Character-based Graphics
Slide 11
Slide 11 text
Hi Res Graphics
• Usually 320 x 200 pixels or less
• Typically 2 or 4 colors
• Painting was slow
• Usually wasn‘t used for games
Later home computers were more powerful
Slide 12
Slide 12 text
Character-based Graphics
(Block Graphics)
Slide 13
Slide 13 text
https://unsplash.com/photos/qVgOxgXfPsQ
Base address + …
Slide 14
Slide 14 text
No content
Slide 15
Slide 15 text
• Showing character (What are home computers??)
• Moving around
• Simple game physics
https://unsplash.com/photos/MdmcpX2ofRk
Slide 16
Slide 16 text
No content
Slide 17
Slide 17 text
Jetpack
Compose
Mini Primer
New native
Android UI toolkit
Based on Kotlin
functions
Declarative
Define UI the way
it should be at
some point in time
No need to modify
component trees
Updates occur
when they are
needed
Slide 18
Slide 18 text
Composable
functions
• Building blocks for a Compose UI
• Annotated with @Composable
• Invoke other composables
• Can be previewed using
@Preview
Slide 19
Slide 19 text
No content
Slide 20
Slide 20 text
No content
Slide 21
Slide 21 text
Where to move around
Slide 22
Slide 22 text
State Data that changes over time
Can be used in composable functions
Changes in state trigger a recomposition
Slide 23
Slide 23 text
No content
Slide 24
Slide 24 text
No content
Slide 25
Slide 25 text
No content
Slide 26
Slide 26 text
No content
Slide 27
Slide 27 text
• Showing character (What are home computers??)
• Moving around
• Simple game physics
https://unsplash.com/photos/MdmcpX2ofRk
Slide 28
Slide 28 text
No content
Slide 29
Slide 29 text
Autonomous movements
using coroutines
• We used coroutines to
• move the player
• let rocks and gems fall
• Using launch rather simplistic
• More complex scenarios can
behandled using Flows
• Must be coupled with lifecycle
Slide 30
Slide 30 text
No content
Slide 31
Slide 31 text
No content
Slide 32
Slide 32 text
Movement and game
physics
• Based on SnapshotStateList
• Element changes trigger recompositions
• Easy conversion between index and x, y
• Coroutines for autonomous movements
Slide 33
Slide 33 text
Tips
• Recompositions can happen very often
• Composables must be fast
• No heavy computations
• No network
• No I/O
Slide 34
Slide 34 text
@tkuenneth
@tkuenneth
@tkuenneth
Thanks a lot for listening
https://github.com/tkuenneth/compose_dash
https://dev.to/tkuenneth/series/13392