Skip to content

Instantly share code, notes, and snippets.

@RezMike
RezMike / main.kt
Last active June 18, 2022 12:46
Code for "KorGE Tutorial - Writing 2048 game. Step 1 - Views"
import com.soywiz.korge.*
import com.soywiz.korge.html.*
import com.soywiz.korge.view.*
import com.soywiz.korim.color.*
import com.soywiz.korim.font.*
import com.soywiz.korim.format.*
import com.soywiz.korio.file.std.*
import com.soywiz.korma.geom.*
import com.soywiz.korma.geom.vector.*
@RezMike
RezMike / Block.kt
Last active March 29, 2021 23:05
Code for "KorGE Tutorial - Writing 2048 game. Step 2 - State and interaction"
import Number.*
import com.soywiz.korge.view.*
import com.soywiz.korim.color.*
fun Container.block(number: Number) = Block(number).addTo(this)
class Block(val number: Number) : Container() {
init {
roundRect(cellSize, cellSize, 5.0, fill = number.color)
@RezMike
RezMike / Block.kt
Last active March 29, 2021 23:23
Code for "KorGE Tutorial - Writing 2048 game. Step 3 - Animation"
import Number.*
import com.soywiz.korge.view.*
import com.soywiz.korim.color.*
fun Container.block(number: Number) = Block(number).addTo(this)
class Block(val number: Number) : Container() {
init {
roundRect(cellSize, cellSize, 5.0, fill = number.color)
@RezMike
RezMike / Block.kt
Last active March 29, 2021 23:44
Code for "KorGE Tutorial - Writing 2048 game. Step 4 - Data saving"
import Number.*
import com.soywiz.korge.view.*
import com.soywiz.korim.color.*
fun Container.block(number: Number) = Block(number).addTo(this)
class Block(val number: Number) : Container() {
init {
roundRect(cellSize, cellSize, 5.0, fill = number.color)