https://kotlinlang.org logo
Join the conversationJoin Slack
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by Linen
korge
  • d

    Derek Berner

    12/20/2019, 4:59 PM
    I suppose with Mobile and browser being targets it's not possible to do that and be cross-platform
    d
    • 2
    • 3
  • d

    dector

    05/31/2020, 8:05 PM
    Hi! Jam web-page says that
    The genre and theme of the game will be made public once the JAM starts.
    Just wondering if there are some specific goals to limit games to some genre? Usually game jams make limitations about theme only.
    n
    • 2
    • 1
  • d

    Dima Avdeev

    06/01/2020, 2:55 AM
    How to pack the game? HTML+JS .zip, JVM .jar, Android .apk, or something else?
    n
    • 2
    • 1
  • d

    dector

    06/01/2020, 5:34 AM
    Just an idea. What do you think about preparing webinar/live-code session about basic KorGE: environment setup and working on simple game. Maybe it'll help to bring more attention. BTW, are there ways do to some kind of hot-reload while development? Or reloading classes in IDEA debug mode is the only option for now?
    n
    r
    d
    • 4
    • 3
  • d

    dector

    06/01/2020, 5:23 PM
    I have white screen when using
    runJvm
    on 2048 sample. Nothing in logs, however. Are there some things I can do to get quick debug info? I will be able to do full debug session, but later.
    d
    • 2
    • 4
  • n

    Nico

    06/01/2020, 6:06 PM
    I like the headless mode 👍🏻🙈
    👌 1
    🤯 1
    d
    • 2
    • 2
  • r

    Rishav Sharan

    06/01/2020, 6:21 PM
    Hi folks
    👋 2
    d
    • 2
    • 1
  • r

    Rishav Sharan

    06/01/2020, 7:59 PM
    is the Container.sceneMain function a call back which is called every tick?
    d
    • 2
    • 5
  • d

    Dima Avdeev

    06/02/2020, 5:49 AM
    I trying to add filter to entire stage:
    suspend fun main() = Korge(...) {
      this.filter = BlurFilter()
      this.invalidate()
      ...
    but after that screen is black. Is it possible to add custom filter to the Stage, or another Container ?
    d
    • 2
    • 3
  • r

    Rishav Sharan

    06/02/2020, 9:37 AM
    what is the correct way to exit the game? I want to add an exit button in my menu;
    var exitButton = textButton(256.0, 32.0) {
                text = "Exit Game"
                position(100, 400 + 32)
                onClick {
                      sceneContainer.changeToAsync<PlayScene>()
                }
                enable()
            }
    ✅ 1
    n
    d
    • 3
    • 6
  • p

    Prasanth

    06/02/2020, 2:51 PM
    Hello everyone. I tried to add an onclick listener to an image
    image.onClick {
    	print("mouse clicked")
    }
    but nothing is getting printed. I am running korge with runJs.
    ✅ 1
    ✔️ 1
    d
    • 2
    • 4
  • r

    RezMike

    06/02/2020, 8:54 PM
    Hey, guys! I've decided to write a step-by-step tutorial about creating a 2048 game in korge. Here's the first article. It contains information about setting up a project and configuring a game. https://blog.korge.org/2020/06/korge-tutorial-writing-2048-game-step-0.html
    ❤️ 8
    r
    • 2
    • 3
  • d

    Deactivated User

    06/02/2020, 11:47 PM
    🎉 Released KorGE
    1.12.12.0
    👋 1
    👍 1
    • 1
    • 1
  • r

    Rishav Sharan

    06/03/2020, 4:13 AM
    Baby steps :D
    2020-06-03-09-41-54.mp4
    👍 1
    n
    r
    • 3
    • 6
  • r

    Rishav Sharan

    06/03/2020, 4:37 AM
    a couple of very basic questions: 1. some samples add views to the stage explicitly using the addchild functions while others do not. in my own code, i just create the view objects directly in the sceneInit function and that seems to work. is that the recommended way to add objects in the game?
    class PlayScene(val myDependency: MyDependency) : Scene() {
        suspend override fun Container.sceneInit() {
            text("Play Scene: ${myDependency.value}") {
                filtering = false
                position(10, 10)
            }
    2. In my sceneInit, i have added multiple game objects and want to be able to refer to one object from within the addupdater code of the other object
    class PlayScene(val myDependency: MyDependency) : Scene() {
        suspend override fun Container.sceneInit() {
            var ball = circle (....
            var paddle = SolidRect(....
    For example, I want to add a check in the add updater for ball object that gets the position and dimensions of the paddle object every tick, so I can do simple bound checking. However, I am not able to call one objects from within another. WHat would be the way to go about it?
    n
    d
    r
    • 4
    • 17
  • r

    r4zzz4k

    06/03/2020, 9:45 AM
    It seems that during dynamic loading of IDEA plugin it doesn't always register its stuff. I've launched IDEA, installed the plugin, became glad it doesn't require IDE restart, then tried to create the project and didn't found corresponding Korge option. Then restarted IDE and Korge appeared in New Project wizard. Disabled the plugin, restarted IDEA, then enabled it and checked New Project again to see no Korge there. Restarted once again, Korge was there. Am I missing something obvious or should I report this to Github? This is of course minor issue which doesn't prevent one getting started with Korge in any way :)
    r
    d
    • 3
    • 6
  • r

    Rishav Sharan

    06/03/2020, 12:20 PM
    I want to add a simple timer. Something like this
    var breakTime = 3
            var breakTimeText = text("Starting game in $breakTime seconds") {
                position(10, 500)
                addUpdater {
                    Count down to 0 in 1 sec intervals
                    update breakTime on each interval
                    if 0, then call function breakOver
    
                }
            }
    i want the counter to go down to zero and then call a function. any tips on how I can achieve that?
    r
    n
    • 3
    • 6
  • r

    Rishav Sharan

    06/03/2020, 3:01 PM
    Is there a top scope variable
    paused
    or something similar in Korge, which stops the game ticks? Currently, I am trying to implement Paused with a simple flag and adding a check in every single game object but was wondering if there is a better way to do the same
    d
    • 2
    • 3
  • k

    kirillrakhman

    06/03/2020, 8:35 PM
    Are click handlers on text supported? I've tried
    class MenuScene : Scene() {
        override suspend fun Container.sceneInit() {
            text("Play") {
                onClick {
                    println("Changing to Game scene")
                    sceneContainer.changeTo<GameScene>()
                }
            }
        }
    }
    but the event never triggers.
    👀 1
    d
    • 2
    • 21
  • r

    Rishav Sharan

    06/03/2020, 8:55 PM
    does the Text type have a textSize member? I can see that in the view/text.kt file. But when I try to use it in my code, I am getting an error;
    d
    • 2
    • 6
  • d

    Deactivated User

    06/03/2020, 8:58 PM
    Hey guys, I’m trying to create a #korge tag at stackoverflow si I can subscribe to it. But it seems that you need much more reputation to do that than the one I have right now. Can someone with 1500+ reputation put a question there with the #korge tag so we can subscribe and other people can ask about korge there? Thanks in advance!
    k
    r
    • 3
    • 11
  • r

    Rishav Sharan

    06/03/2020, 9:11 PM
    Done with pong. Will now add it to the samples repo
    2020-06-04-02-39-06.mp4
    🆒 2
    👍 3
    r
    • 2
    • 3
  • d

    Dima Avdeev

    06/04/2020, 10:16 AM
    I found bug with sample-tic-tac-toe-swf in korge-samples I run "./gradlew clean sample-tic-tac-toe-swf:runJs" It work's on korgePluginVersion=1.11.3.0 But don't work on korgePluginVersion=1.12.8.0 and 1.12.12.0
    d
    • 2
    • 4
  • m

    Marcin Wisniowski

    06/04/2020, 11:28 AM
    Hello, I've just learned about KorGE. The website says:
    You can also use KorGE as a library and for example integrated it in your android-only project.
    But I don't see that anywhere in the documentation. How can I use KorGE as a library for an Android app? I.e. I have an existing Android app project, and I want to add a new screen where I use KorGE (imagine an easter egg game screen in a normal non-game app). So I'd need to put KorGE in an Android
    View
    or
    Fragment
    .
    👋 1
    d
    p
    • 3
    • 20
  • r

    Rishav Sharan

    06/04/2020, 2:53 PM
    how do I update Korge in intelliJ. I want to start on a new project and use the latest version. But the new project creation shows 1.12.8
    n
    d
    r
    • 4
    • 14
  • k

    kirillrakhman

    06/04/2020, 3:07 PM
    Is this warning in the log expected?
    17:07	Unknown Module Type
    			Cannot determine module type ("korge") for the following module:"three-in-a-row"
    			The module will be treated as a Unknown module.
    d
    r
    • 3
    • 9
  • d

    Deactivated User

    06/04/2020, 3:18 PM
    Just released KorGE
    1.12.14.0
    🎉 1
    🚀 1
    p
    • 2
    • 12
  • n

    Nico

    06/04/2020, 7:15 PM
    Btw is there a property which holds the mouse coordinates or can I "only" get them through MouseVents?
    d
    • 2
    • 2
  • d

    dector

    06/05/2020, 1:58 AM
    [SOLVED] Is it possible to distinguish right click from left click in
    onClick {}
    ?
    d
    • 2
    • 2
  • k

    kirillrakhman

    06/05/2020, 8:20 AM
    how do I set the window size when using a module?
    n
    r
    d
    • 4
    • 12
Powered by Linen
Title
k

kirillrakhman

06/05/2020, 8:20 AM
how do I set the window size when using a module?
n

Nico

06/05/2020, 8:23 AM
I think you can override the values from
Module
https://github.com/korlibs/korge/blob/b5f22c96a2478441de5cdea995ffb8876b7cdcee/korge/src/commonMain/kotlin/com/soywiz/korge/scene/Module.kt#L27
r

RezMike

06/05/2020, 8:24 AM
yep, you should override
size
property in Module
k

kirillrakhman

06/05/2020, 8:24 AM
thx
👍 1
what happens when I deploy the game to an android device where the screen has a different aspect ratio? do I get black bars?
on JVM that appears to be the case when I resize the window
d

Deactivated User

06/05/2020, 10:06 AM
Thats the default behaviour. But you can change it. There is the concept of: windows size, virtual size, and extended virtual size You define a virtual size with a specific aspect ratio, but when adapting to the window the aspect ratio might change. The default behaviour is to put black bars, but you can disable them and use the dockedTo component (or manually register to resize events) to place stuff in the corners
Nico, do you think you could make a videotutorial showing this? I think this is something better shown than explained
n

Nico

06/05/2020, 10:08 AM
Yep. But not in the next hours :(
d

Deactivated User

06/05/2020, 10:09 AM
No rush at all! It is just a topic we should cover. I will try to create a page explaining how to deal with different resolutions and aspect ratios so you can explain it at some point in a way that makes sense
👍 2
The minesweeper sample is already not showing blackbars but a background cover + some glowing lights moving
https://korlibs.soywiz.com/korge/resolutions/ In the meantime before Nico creates a video showing this (I will update the page adding the video once available)
n

Nico

06/07/2020, 8:58 AM
That’ll be tonight then
👍 1
View count: 15