Giter Club home page Giter Club logo

korge's Introduction

korlibs

This repository hosts the libraries used by KorGE (Kotlin Game Engine). It contains all the modules but KorGE itself.

For the old korlibs repo: https://github.com/korlibs/korlibs-all

Usage

Modules are published to Maven Central under the com.soywiz group.

For example, you can use korlibs-crypto as follows (replacing X.X.X with the latest release):

implementation("com.soywiz:korlibs-crypto:X.X.X")

korge's People

Contributors

avdim avatar bioryajenka avatar bognari avatar caps-looking avatar dependabot[bot] avatar dhakehurst avatar emign avatar fsaurenbach avatar gsteckman avatar holloszaboakos avatar inego avatar insanusmokrassar avatar itboy87 avatar jfbilodeau avatar jobe-m avatar kietyo avatar lehaine avatar lmvortex4k avatar mikesmitheu avatar obsidianx avatar pablocaviglia-uy avatar rafi0 avatar rezmike avatar sahilbajaj avatar servb avatar soywiz avatar soywiz-invideo avatar stechmuck avatar tradfursten avatar ygdrasil-io avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

korge's Issues

Different click areas on scaled desktop with `View.onClick()` on JS backend

If you create a view and add an onClick() listener this doesn't work as excpeted on JavaScript build.

suspend fun main() = Korge(width = 256, height = 256, bgcolor = Colors.LIGHTGREY) {

    solidRect(256,256, Colors.WHITE){
        onClick { colorMul = Colors.BLUE }
    }

    solidRect(100,100, color = Colors.RED){
        onClick { colorMul = Colors.GREEN }
    }
    
}

graphics

On the JS build, it makes a difference where you click the green rect. The upper right part of the rect triggers the listener in the background. But the green one is in front of the white. Clicking on the green should never trigger the white rect. On the JVM all works, regardless which green part is clicked.

And we can see that the rect in front of the blue one has a rendering error. You can see, that it's drawn by two rectangles.

Can't compile :packageJvmFatJarProguard

This errors out. My project is effectively the default project.

PS C:\Users\mccra\Documents\Programming\KorGE\TheButton> ./gradlew packageJvmFatJarProguard
Starting a Gradle Daemon, 15 stopped Daemons could not be reused, use --status for details

> Configure project :
Kotlin Multiplatform Projects are an experimental feature.

> Task :compileKotlinJvm
w: C:\Users\mccra\Documents\Programming\KorGE\TheButton\src\commonMain\kotlin\main.kt: (11, 6): Variable 'image' is never used

> Task :packageJvmFatJarProguard
Note: there were 106 duplicate class definitions.
      (http://proguard.sourceforge.net/manual/troubleshooting.html#duplicateclass)
Warning: can't write resource [META-INF/korge.kotlin_module] (Duplicate jar entry [META-INF/korge.kotlin_module])
Warning: can't write resource [META-INF/korgw.kotlin_module] (Duplicate jar entry [META-INF/korgw.kotlin_module])
Warning: can't write resource [META-INF/korag-opengl.kotlin_module] (Duplicate jar entry [META-INF/korag-opengl.kotlin_module])
Warning: can't write resource [META-INF/kgl.kotlin_module] (Duplicate jar entry [META-INF/kgl.kotlin_module])
Warning: can't write resource [META-INF/korag.kotlin_module] (Duplicate jar entry [META-INF/korag.kotlin_module])
Warning: can't write resource [META-INF/korev.kotlin_module] (Duplicate jar entry [META-INF/korev.kotlin_module])
Warning: can't write resource [META-INF/korim.kotlin_module] (Duplicate jar entry [META-INF/korim.kotlin_module])
Warning: can't write resource [META-INF/korau.kotlin_module] (Duplicate jar entry [META-INF/korau.kotlin_module])
Warning: can't write resource [META-INF/korio.kotlin_module] (Duplicate jar entry [META-INF/korio.kotlin_module])
Warning: can't write resource [META-INF/klock.kotlin_module] (Duplicate jar entry [META-INF/klock.kotlin_module])
Warning: can't write resource [META-INF/kmem.kotlin_module] (Duplicate jar entry [META-INF/kmem.kotlin_module])
Warning: can't write resource [META-INF/korma.kotlin_module] (Duplicate jar entry [META-INF/korma.kotlin_module])
Warning: can't write resource [META-INF/kds.kotlin_module] (Duplicate jar entry [META-INF/kds.kotlin_module])
Warning: can't write resource [META-INF/korinject.kotlin_module] (Duplicate jar entry [META-INF/korinject.kotlin_module])
Warning: can't write resource [META-INF/klogger.kotlin_module] (Duplicate jar entry [META-INF/klogger.kotlin_module])

> Task :packageJvmFatJarProguard FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':packageJvmFatJarProguard'.
> java.io.IOException: Can't write [C:\Users\mccra\Documents\Programming\KorGE\TheButton\build\libs\TheButton-all-proguard.jar] (Can't read [C:\Users\mccra\Documents\Programming\KorGE\TheButton\build\libs\TheButton-all-4.10.1.jar] (Duplicate jar entry [jogamp/nativetag/common/linux/amd64/TAG.class]))

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.2.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 2m 16s
5 actionable tasks: 5 executed

WARNING: An illegal reflective access operation has occurred

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.jogamp.common.os.NativeLibrary$3 (file:/Users/username/.gradle/caches/modules-2/files-2.1/org.jogamp.gluegen/gluegen-rt/2.3.2/edc35ccfc13d4a4ad02c50d580874c18bf48bbef/gluegen-rt-2.3.2.jar) to method java.lang.ClassLoader.findLibrary(java.lang.String)
WARNING: Please consider reporting this to the maintainers of com.jogamp.common.os.NativeLibrary$3
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

Happens on gradle Task runJvm

SWF features

Implement swf features

  • SWF build resource cache (not updating)
  • SWF Blending mode
  • SWF serializing Sounds
  • SWF: Slice9 (9-patch)
  • SWF small gotoAndPlay before bug
  • SWF optimize runtime size ( #6 )
  • SWF optimize reading time ( #6 )
  • SWF: Morph Shapes
  • SWF color transforms
  • SWF masks
  • SWF radial gradients
  • SWF artifacts on shapes with common edges

Rect right and bottom sides not displayed

stage.graphics { stroke(Colors.BLACK, Context2d.StrokeInfo(thickness=2.0)) { rect(x, y, w, h) //roundRect(x, y, w, h, 5,5) } }

The right and bottom sides are not visible.

which gradle versions is korge up to date with?

running either hello world or one of the samples from https://github.com/korlibs/korge-samples i keep getting errors referencing gradle version

> Task :sample-box2d:runJvm FAILED
configureLoggerFromProperties:
Couldn't load Klogger configuration LocalVfs[/home/kuba/Desktop/kotlin/korge-samples/klogger.properties] : /home/kuba/Desktop/kotlin/korge-samples/klogger.properties (No such file or directory)
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.jogamp.common.os.NativeLibrary$3 (file:/home/kuba/.gradle/caches/modules-2/files-2.1/org.jogamp.gluegen/gluegen-rt/2.3.2/edc35ccfc13d4a4ad02c50d580874c18bf48bbef/gluegen-rt-2.3.2.jar) to method java.lang.ClassLoader.findLibrary(java.lang.String)
WARNING: Please consider reporting this to the maintainers of com.jogamp.common.os.NativeLibrary$3
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007ff969fae72f, pid=26373, tid=26376
#
# JRE version: OpenJDK Runtime Environment (11.0.4+11) (build 11.0.4+11)
# Java VM: OpenJDK 64-Bit Server VM (11.0.4+11, mixed mode, tiered, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# C  [ld-linux-x86-64.so.2+0xa72f]
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport %p %s %c %d %P" (or dumping to /home/kuba/Desktop/kotlin/korge-samples/sample-box2d/core.26373)
#
# An error report file with more information is saved as:
# /home/kuba/Desktop/kotlin/korge-samples/sample-box2d/hs_err_pid26373.log
#
# If you would like to submit a bug report, please visit:
#   https://github.com/AdoptOpenJDK/openjdk-build/issues
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':sample-box2d:runJvm'.
> Process 'command '/home/kuba/.sdkman/candidates/java/11.0.4.hs-adpt/bin/java'' finished with non-zero exit value 134

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.1.1/userguide/command_line_interface.html#sec:command_line_warnings

i tried opening /home/kuba/Desktop/kotlin/korge-samples/sample-box2d/hs_err_pid26373.log but i dont have any java experience and its all basically chinese to me, how do i debug it?

EDIT
gradle -v gives me

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/usr/share/java/groovy-all.jar) to method java.lang.Object.finalize()
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

------------------------------------------------------------
Gradle 4.4.1
------------------------------------------------------------

Build time:   2012-12-21 00:00:00 UTC
Revision:     none

Groovy:       2.4.16
Ant:          Apache Ant(TM) version 1.10.5 compiled on March 28 2019
JVM:          11.0.4 (AdoptOpenJDK 11.0.4+11)
OS:           Linux 5.0.0-25-generic amd64

so i dont even know where this 6.0 message is coming from

View solid rect has clipping errors on JS build

A solid rect isn't completely filled on JS buid.
System: Korge 1.1.3 with latest KoreUI. Browser Chrome or Firefox.

To repoduce:

suspend fun main() = Korge(debug = true , width = 256, height = 256, bgcolor = Colors.LIGHTGREY) {
    solidRect(256,256, Colors.BLUE)
    solidRect(100,100, color = Colors.GREEN)
}

2019-03-05_20h48_14

For me it's not a big problem, because don't have this situation where it's visible in my game.

ConcurrentModificationException in Graphics.renderInternal

I don't know how to reproduce it, but this happen "sometimes" when I run my current HitKlackOnKorGE project.

Start: runJVM, System: Win 10 x64

Have you tried turning it off and on again?

Yes, and it solves the problem without any changes on the code! So maybe it's the time the window gets the focus.

Full Stacktrace:

	at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:909)
	at java.util.ArrayList$Itr.next(ArrayList.java:859)
	at com.soywiz.korge.view.Graphics.renderInternal(Graphics.kt:248)
	at com.soywiz.korge.view.View.render(View.kt:431)
	at com.soywiz.korge.view.Container.renderInternal(Container.kt:90)
	at com.soywiz.korge.view.Stage.renderInternal(Views.kt:287)
	at com.soywiz.korge.view.View.render(View.kt:431)
	at com.soywiz.korge.view.Views.render(Views.kt:175)
	at com.soywiz.korge.view.Views.frameUpdateAndRender-_rozLdE(Views.kt:204)
	at com.soywiz.korge.Korge$prepareViews$17.invoke(Korge.kt:355)
	at com.soywiz.korge.Korge$prepareViews$17.invoke(Korge.kt:31)
	at com.soywiz.korev.EventDispatcher$Mixin.dispatch(EventDispatcher.kt:46)
	at com.soywiz.korgw.DefaultGameWindowJvmKt$DefaultGameWindow$1$loop$2.invoke(DefaultGameWindowJvm.kt:388)
	at com.soywiz.korgw.DefaultGameWindowJvmKt$DefaultGameWindow$1$loop$2.invoke(DefaultGameWindowJvm.kt:18)
	at com.soywiz.korio.async.Signal.invoke(Signal.kt:110)
	at com.soywiz.korag.AGAwt$glEventListener$1.display(GLExt.kt:121)
	at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:692)
	at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:674)
	at com.jogamp.opengl.awt.GLCanvas$11.run(GLCanvas.java:1424)
	at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1293)
	at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:1147)
	at com.jogamp.opengl.awt.GLCanvas$12.run(GLCanvas.java:1438)
	at com.jogamp.opengl.Threading.invoke(Threading.java:223)
	at com.jogamp.opengl.awt.GLCanvas.display(GLCanvas.java:505)
	at com.jogamp.opengl.awt.GLCanvas.paint(GLCanvas.java:559)
	at com.jogamp.opengl.awt.GLCanvas.update(GLCanvas.java:866)
	at sun.awt.RepaintArea.updateComponent(RepaintArea.java:255)
	at sun.awt.RepaintArea.paint(RepaintArea.java:232)
	at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:358)
	at java.awt.Component.dispatchEventImpl(Component.java:4965)
	at java.awt.Component.dispatchEvent(Component.java:4711)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:760)
	at java.awt.EventQueue.access$500(EventQueue.java:97)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.awt.EventQueue$3.run(EventQueue.java:703)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:84)
	at java.awt.EventQueue$4.run(EventQueue.java:733)
	at java.awt.EventQueue$4.run(EventQueue.java:731)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:730)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)```

Simplify Resource Loading

Instead of using a ResourceRef class, let's create a @LoaderInfo annotation or something like that references a loader class to directly using the Resource class.

Is there a suspend free way of playing a sound?

I noticed that i need to load all assets inside a suspend function (eg. suspend fun VfsFile.readAudioData). But is this also necessary for playing a sound (.toNativeSound().play())? If I want to play a sound deep in my game logic, I have to make all functions on this way to a suspend function. But this seems to be even impossible if I want to trigger a sound during a KeyEvent, because the fun onKeyEvent(views: Views, event: KeyEvent) has no suspend.

So did I missed something in coroutines, korge or the KorAU API or is this the recommend way to only write suspend methods?

Btw.: The https://forum.soywiz.com seems to be down, which would be a better place for my question.
If I get it out, I could also help to improper the documentation.

Project template outputs warning: " NSWindow drag regions should only be invalidated on the Main Thread"

I've followed the hello world directions and ran Main.kt. (./gradlew runJvm)

The window pops up and everything is fine, but there is a warning that shows up in the console.

Is there a way to get rid of this warning?

Thanks.

2019-06-16 14:29:45.101 java[26626:1568582] WARNING: NSWindow drag regions should only be invalidated on the Main Thread! This will throw an exception in the future. Called from (
	0   AppKit                              0x00007fff341807eb -[NSWindow(NSWindow_Theme) _postWindowNeedsToResetDragMarginsUnlessPostingDisabled] + 378
	1   AppKit                              0x00007fff3417dbdb -[NSWindow _initContent:styleMask:backing:defer:contentView:] + 1479
	2   AppKit                              0x00007fff3417d60e -[NSWindow initWithContentRect:styleMask:backing:defer:] + 45
	3   libnativewindow_macosx.jnilib       0x000000012b8983fe Java_jogamp_nativewindow_macosx_OSXUtil_CreateNSWindow0 + 398
	4   ???                                 0x000000010ed6e9f4 0x0 + 4543932916
)

docs: incorrect syntax highlighting

image
As you can see, on the screenshot, incorrect syntax highlighting, red and bright red on a dark background looks very bad, other colors are good, it would not be bad if the color was replaced with a calmer :), if you need help choosing colors, I will try to help 😉

IndexOutOfBoundsException on start of native win x64 window

The runNativeMingwX64Release works but logs a kotlin.ArrayIndexOutOfBoundsException during start. My game works fine and all graphics are painted correct. But this happens also with the empty korge hallo world (without any image). System: Windows 10 x64.

Stacktrace:

wglSwapIntervalEXT: CPointer(raw=0x6d071eb0)
GL_CONTEXT: CPointer(raw=0x10000)
ERROR: 0
Korui[0]
SetWindowPos: 1024, 1024
CanvasApplicationEx.IN[0]
CanvasApplicationEx.IN[1]
Korui[1]
kotlin.ArrayIndexOutOfBoundsException
        at ThrowArrayIndexOutOfBoundsException (00000000004bf3a0)
        at Kotlin_Arrays_getIntArrayAddressOfElement (00000000004ca3b0)
        at kfun:com.soywiz.kgl.KmlGlNative.texImage2D(kotlin.Int;kotlin.Int;kotlin.Int;kotlin.Int;kotlin.Int;com.soywiz.korim.bitmap.NativeImage) (00000000006823a0)
        at kfun:com.soywiz.korag.AGOpengl.GlTexture.actualSyncUpload(com.soywiz.korag.AG.BitmapSourceBase;com.soywiz.korim.bitmap.Bitmap?;kotlin.Boolean) (00000000006c79a0)
        at kfun:com.soywiz.korag.AGOpengl.draw(com.soywiz.korag.AG.Buffer;com.soywiz.korag.shader.Program;com.soywiz.korag.AG.DrawType;com.soywiz.korag.shader.VertexLayout;kotlin.Int;com.soywiz.korag.AG.Buffer?;kotlin.Int;com.soywiz.korag.AG.Blending;com.soywiz.korag.AG.UniformValues;com.soywiz.korag.AG.StencilState;com.soywiz.korag.AG.ColorMaskState;com.soywiz.korag.AG.RenderState;com.soywiz.korag.AG.Scissor?) (00000000006cadb0)
        at kfun:com.soywiz.korge.render.BatchBuilder2D.flush() (00000000007551d0)
        at kfun:com.soywiz.korge.view.Stage.renderInternal(com.soywiz.korge.render.RenderContext) (000000000075de80)
        at kfun:com.soywiz.korge.view.View.render(com.soywiz.korge.render.RenderContext) (00000000007534a0)
        at kfun:com.soywiz.korge.Korge.$<anonymous>$FUNCTION_REFERENCE$7.invoke#internal (000000000076ed70)
        at kfun:com.soywiz.korev.EventDispatcher.Mixin.dispatch(kotlin.reflect.KClass<#GENERIC_com.soywiz.korev.Event>;#GENERIC_com.soywiz.korev.Event)Generic (00000000006d7570)
        at kfun:com.soywiz.korgw.WindowsGameWindow.tryRender() (00000000006f3ea0)
        at kfun:com.soywiz.korgw.WindowsGameWindow.$loop$lambda-2$COROUTINE$5.invokeSuspend(kotlin.Result<kotlin.Any?>)kotlin.Any? (00000000006f32d0)
        at kfun:kotlin.coroutines.native.internal.BaseContinuationImpl.resumeWith(kotlin.Result<kotlin.Any?>) (0000000000446780)
        at kfun:kotlinx.coroutines.DispatchedTask.run() (000000000051b160)
        at kfun:kotlinx.coroutines.EventLoopImpl.processNextEvent()ValueType (000000000051c260)
        at kfun:kotlinx.coroutines.runBlocking$default(kotlin.coroutines.CoroutineContext;kotlin.coroutines.SuspendFunction1<kotlinx.coroutines.CoroutineScope,#GENERIC>;kotlin.Int)Generic (00000000005444b0)
        at kfun:com.soywiz.korgw.WindowsGameWindow.loop(kotlin.coroutines.SuspendFunction1<com.soywiz.korgw.GameWindow,kotlin.Unit>) (00000000006f43a0)
        at kfun:com.soywiz.korge.Korge.$KoruiWithLogger$COROUTINE$7.invokeSuspend(kotlin.Result<kotlin.Any?>)kotlin.Any? (000000000077a8c0)
        at kfun:kotlin.coroutines.native.internal.BaseContinuationImpl.resumeWith(kotlin.Result<kotlin.Any?>) (0000000000446780)
        at kfun:kotlinx.coroutines.resume$kotlinx-coroutines-core-native@kotlinx.coroutines.DispatchedTask<#GENERIC>.(kotlin.coroutines.Continuation<#GENERIC>;kotlin.Int)Generic (0000000000525820)
        at kfun:kotlinx.coroutines.CancellableContinuationImpl.dispatchResume#internal (00000000005250d0)
        at kfun:kotlinx.coroutines.CancellableContinuationImpl.resumeImpl#internal (0000000000524b00)
        at kfun:kotlinx.coroutines.CancellableContinuationImpl.resumeUndispatched@kotlinx.coroutines.CoroutineDispatcher.(#GENERIC) (0000000000522ed0)
        at kfun:kotlinx.coroutines.EventLoopImpl.DelayedResumeTask.run#internal (0000000000528070)
        at kfun:kotlinx.coroutines.EventLoopImpl.processNextEvent()ValueType (000000000051c260)
        at kfun:kotlinx.coroutines.runBlocking$default(kotlin.coroutines.CoroutineContext;kotlin.coroutines.SuspendFunction1<kotlinx.coroutines.CoroutineScope,#GENERIC>;kotlin.Int)Generic (00000000005444b0)
        at Konan_start (0000000000403180)
        at Konan_run_start (0000000000403090)
        at Konan_main (0000000000403060)
        at __tmainCRTStartup (0000000000401180)
        at mainCRTStartup (00000000004014e0)
        at  (00007ffe5ae781e0)
        at  (00007ffe5c90a230)

lock and hide cursor

I add lock and hide cursor in my fork for 3d game(like minecraft), but I meet something problem, look at code:

    override fun setPointerLockable(isLockable:Boolean) {
        val robot = Robot()
        val mot = object:MouseMotionListener{
            override fun mouseMoved(e: MouseEvent?) {
                robot.mouseMove(nativeComponent.width/2+nativeComponent.locationOnScreen.x,nativeComponent.height/2+nativeComponent.locationOnScreen.y)
            }
            override fun mouseDragged(e: MouseEvent?) {
                robot.mouseMove(nativeComponent.width/2+nativeComponent.locationOnScreen.x,nativeComponent.height/2+nativeComponent.locationOnScreen.y)
            }
        }
        if(isLockable){
            nativeComponent.addMouseMotionListener(mot)
            return 
        }
        nativeComponent.removeMouseMotionListener(mot)
    }

But when I move mouse quickly, I may see the cursor,because the windows is small, cursor move out of windows.

  • Are there someway to disable the cursor?

No clicking with JS

(Using Firefox)
I made a test program to help me get a little KorGE, and failed. The program works 100% on the JVM, but not on JS. You can't click the button.
image
What happens on the JVM:
image
Nothing on JS. The button screen stays.
I also noticed, In the examples on the website, I could only click on buttons/mouse input with my touchscreen... No idea why.

My Code:

import com.soywiz.korge.*
import com.soywiz.korge.input.*
import com.soywiz.korge.view.*
import com.soywiz.korim.color.*
import com.soywiz.korim.format.*
import com.soywiz.korio.file.std.*

suspend fun main() = Korge(width = 512, height = 512, bgcolor = Colors["#2b2b2b"]) {
	//val minDegrees = (-16).degrees
	//val maxDegrees = (+16).degrees
	val image = image(resourcesVfs["button.png"].readBitmap()) {
		//rotation = maxDegrees
		anchor(.5, .5)
		scale(.8)
		position(256, 256)
		val bmp2 = resourcesVfs["korge.png"].readBitmap()
		onClick {
			this.parent?.image(bmp2) {
				//rotation = maxDegrees
				anchor(.5, .5)
				scale(.8)
				position(256, 256)
			}
			this.removeFromParent()
		}
	}
}

keys input don't work

Any function about keys don't work. High-Level and Low-Level APIs.
I use Kotlin 1.13.202,Korge 1.0.3 and its template on Fedora 29 with linux 4.20.5.
Does it work for you?

klock-js package name

Hi,
I use klock a lot. Great library. Thanks.
Currently used in an angular.io project.
small issue, but it would be nice if the JS package/module names were different.
To integrate this into angular.io I need to do,

  1. in angular.json:
"scripts": [
    ./node_modules/klock-js/klock-root-klock.js
]
  1. in an angular .ts file
import * as com_soywiz_klock from 'klock-js/klock-root-klock.js';
const com_soywiz_klock: any = window['klock-root-klock'];
import klk = com_soywiz_klock.com.soywiz.klock;

both of these refer to the 'klock-root-klock.js' file.
It is a slightly odd name.
It would be nicer if the module name was something more like,

'com.soywiz.klock'
or was the same as the 'jar' file name,
i.e. just 'klock'
(the kotlin-multiplatform libs I publish use the jar name automatically,
so I am not sure what you do to change the names.)

just a thought/small request.

SWF reduce reading time + memory size

Instead of decoding the whole timeline, just read bytes and decode them when used (so reading should be hiper fast)

Also split the timeline per components to avoid creating objects.

runJvm fails with "klogger.properties (No such file or directory)

Trying runJvm, which fails in a similar way to what's described at https://forum.soywiz.com/topic/19/compilation-error-in-project-template/2

runJs and packageJvmFatJar run fine, can see it in browser and can run the fat jar.


> Configure project :
Kotlin Multiplatform Projects are an experimental feature.

> Task :runJvm FAILED
configureLoggerFromProperties:
Couldn't load Klogger configuration LocalVfs[/home/etsvigun/devenv/kotlin/korge-hello-world-master/klogger.properties] : /home/etsvigun/devenv/kotlin/korge-hello-world-master/klogger.properties (No such file or directory)
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007fe774c2683a, pid=10681, tid=0x00007fe773b4f700
#
# JRE version: OpenJDK Runtime Environment (8.0_212-b01) (build 1.8.0_212-b01)
# Java VM: OpenJDK 64-Bit Server VM (25.212-b01 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C  [ld-linux-x86-64.so.2+0xa83a]  check_match+0xa
#
# Core dump written. Default location: /home/etsvigun/devenv/kotlin/korge-hello-world-master/core or core.10681
#
# An error report file with more information is saved as:
# /home/etsvigun/devenv/kotlin/korge-hello-world-master/hs_err_pid10681.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.sun.com/bugreport/
#

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':runJvm'.
> Process 'command '/usr/lib/jvm/java-8-openjdk/bin/java'' finished with non-zero exit value 134```

See the stacktraces attached: `./gradlew runJvm --stacktrace &> runJvm.stacktrace`

[runJvm.stacktrace.gz](https://github.com/korlibs/korge/files/3027288/runJvm.stacktrace.gz)

The `onKeyUp` is not triggered on JS - Because of Evernote Chrome Extension

Add a keyUp and keyDown event to a view. The keyDown won't be triggered on JS run in Chrome. On jvm or on Firefox it works like expected.

suspend fun main() = Korge(debug = true, width = 256, height = 256, bgcolor = Colors.LIGHTGREY) {
    
    solidRect(100,100, color = Colors.RED){
        onKeyUp { colorMul = Colors.RED }  //Not triggered on JS
        onKeyDown { colorMul = Colors.GREEN }
    }
}

Is it possible to run it on a canvas object on Android?

May it could sound a stupid question but I want to know if its possible to run Korge within the Android SDK classes like inside a "canvas" object instead of being Korge the main entrance to the game.

Something like I have a menu using the android sdk components like Activities and Fragments and I want to create an instance of Korge inside one of them or open a new screen after a button click.

Many thanks in advance!

Can't load library nativewindow_win32.dll

  • When I run the the game with ./gradlew runJvm or press the green ▶️ icon , it sometime crash and tell me could't load library.
  • I use WIn10 , IDEA , jdk 8/11 and korge-gradle-plugin:1.2.1.
Exception in thread "main" java.lang.UnsatisfiedLinkError: Can't load library: G:\kotlin\korge-hello-world\natives\windows-amd64\\nativewindow_win32.dll
	at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2620)
	at java.base/java.lang.Runtime.load0(Runtime.java:767)
	at java.base/java.lang.System.load(System.java:1831)
	at com.jogamp.common.jvm.JNILibLoaderBase.loadLibraryInternal(JNILibLoaderBase.java:624)
	at com.jogamp.common.jvm.JNILibLoaderBase.access$000(JNILibLoaderBase.java:63)
	at com.jogamp.common.jvm.JNILibLoaderBase$DefaultAction.loadLibrary(JNILibLoaderBase.java:106)
	at com.jogamp.common.jvm.JNILibLoaderBase.loadLibrary(JNILibLoaderBase.java:487)
	at jogamp.nativewindow.NWJNILibLoader.access$000(NWJNILibLoader.java:39)
	at jogamp.nativewindow.NWJNILibLoader$1.run(NWJNILibLoader.java:49)
	at jogamp.nativewindow.NWJNILibLoader$1.run(NWJNILibLoader.java:41)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at jogamp.nativewindow.NWJNILibLoader.loadNativeWindow(NWJNILibLoader.java:41)
	at jogamp.nativewindow.windows.GDIUtil.initSingleton(GDIUtil.java:60)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at com.jogamp.common.util.ReflectionUtil.callMethod(ReflectionUtil.java:416)
	at com.jogamp.common.util.ReflectionUtil.callStaticMethod(ReflectionUtil.java:438)
	at com.jogamp.nativewindow.NativeWindowFactory.initSingletonNativeImpl(NativeWindowFactory.java:224)
	at com.jogamp.nativewindow.NativeWindowFactory.initSingleton(NativeWindowFactory.java:388)
	at com.jogamp.opengl.GLProfile.initProfilesForDefaultDevices(GLProfile.java:1721)
	at com.jogamp.opengl.GLProfile.access$000(GLProfile.java:80)
	at com.jogamp.opengl.GLProfile$1.run(GLProfile.java:230)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at com.jogamp.opengl.GLProfile.initSingleton(GLProfile.java:216)
	at com.jogamp.opengl.GLProfile.getProfileMap(GLProfile.java:2297)
	at com.jogamp.opengl.GLProfile.get(GLProfile.java:988)
	at com.jogamp.opengl.GLProfile.getDefault(GLProfile.java:722)
	at com.jogamp.opengl.GLProfile.getDefault(GLProfile.java:733)
	at com.soywiz.korag.AGAwtBase.<init>(GLExt.kt:35)
	at com.soywiz.korag.AGAwt.<init>(GLExt.kt:67)
	at com.soywiz.korag.AGAwt.<init>(GLExt.kt:67)
	at com.soywiz.korgw.DefaultGameWindowJvmKt$CreateDefaultGameWindow$1$ag$2.invoke(DefaultGameWindowJvm.kt:30)
	at com.soywiz.korgw.DefaultGameWindowJvmKt$CreateDefaultGameWindow$1$ag$2.invoke(DefaultGameWindowJvm.kt:18)
	at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
	at com.soywiz.korgw.DefaultGameWindowJvmKt$CreateDefaultGameWindow$1.getAg(DefaultGameWindowJvm.kt)
	at com.soywiz.korgw.DefaultGameWindowJvmKt$CreateDefaultGameWindow$1.<init>(DefaultGameWindowJvm.kt:37)
	at com.soywiz.korgw.DefaultGameWindowJvmKt.CreateDefaultGameWindow(DefaultGameWindowJvm.kt:18)
	at com.soywiz.korge.Korge.KoruiWithLogger(Korge.kt:403)
	at com.soywiz.korge.Korge.invoke(Korge.kt:464)
	at MainKt.main(main.kt:20)
	at MainKt$$$main.invoke(Unknown Source)
	at kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsJvmKt$createCoroutineUnintercepted$$inlined$createCoroutineFromSuspendFunction$IntrinsicsKt__IntrinsicsJvmKt$1.invokeSuspend(IntrinsicsJvm.kt:199)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:32)
	at kotlin.coroutines.ContinuationKt.startCoroutine(Continuation.kt:114)
	at kotlin.coroutines.jvm.internal.RunSuspendKt.runSuspend(RunSuspend.kt:19)
	at MainKt.main(main.kt)

No audio after packing `packageJvmFatJar`

After packing the app as JVM fat jar by the packageJvmFatJar task, mp3 audio files won't play anymore. No error are thrown. The fat jar includes the com.soywiz.korau.format.mp3.MP3Decoder. So I can't figure out what's going wrong. Is there any thing else, I have to configure for fat jar, when including korau?

Setup: korge-hello-world

build.gradle.kts

korge {
    dependencyMulti("com.soywiz:korau-mp3:$korauVersion")
}

main.kt

suspend fun main() = Korge(debug = true, width = 512, height = 512, bgcolor = Colors.LIGHTGREY) {
    val sound = resourcesVfs["sounds/ok.mp3"].readNativeSound()
    solidRect(100, 100, Colors.RED) {
        onClick {
            sound.play()
        }
    }
}

System: Win 10, x64

Good vibrations -where to add?

As I can see, there is no built in support for device vibration. For Android and web it would be very easy to add:

JS

window.navigator.vibrate(200);

Android

Vibrator v = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
v.vibrate(400);

If its not planned in the near future, I would add it by my own.

But where is the best place? For me it seems something controller specific, because on a Computer you need a game-pad. Also in LibGDX we have a Gdx.input.vibrate(2000);.
Sou I would add some Vibrator in the korge.input package. Or better GamepadComponent.vibrate()?

Then the Android specific Implementation goes to the KorgwActivity in the koreui, right?

An we have to add a android.permission.VIBRATE to the build script:
korge: gradle/targets/android/Android.kt
Or should this only be added with a compiler flag? So wee can add it only if needed?

The reason for me is the Android target. A small and short vibration is a good button-pressed feedback.

Visual Editor

Now days to compete on game engine market is essential to have visual editor for 3d and 2d game scenes (ideally for game graphics as well), similarly what has been done by GODOT. So the gameplay can be visualised and edited in realtime.

Any plans of Korge team to develop such a useful and essential tooling?

kbox2d : adding many bodies at once throws exception

As described in this (closed due to migration to Korge) comment:
korlibs-archive/korio#34

Also, it should be just a single thread or at least just one thread executing at a time, so shouldn't be a concurrency problem related to threads, maybe the World is in an inconsistent state just before doing a suspension for I/O then it is suspending and a frame occurs that updates the World?

-> Maybe add a initialize block for box2d which creates the bodies in a suspendible manner. At the moment, we just call the Objects in the worldview lambda which causes these problems.

Game fails to start when a second LWJGL App is running

I can't start my HitKlackOnKorGE as runJVM when another LWJGL app is running. Then the korge game fails during start. It's not a big deal for me. And maybe it's a know limitation.

To reproduce you can start HitKlack as LWJGL Desktop and then, try to run HitKlackOnKorGE for the jvm.

Stacktrace:

kotlin.UninitializedPropertyAccessException: lateinit property gl has not been initialized
	at com.soywiz.korag.AGAwtBase.getGl(GLExt.kt:42)
	at com.soywiz.korag.AGOpengl$GlBuffer.<init>(OpenglAG.kt:468)
	at com.soywiz.korag.AGOpengl.createBuffer(OpenglAG.kt:24)
	at com.soywiz.korag.AG.createVertexBuffer(AG.kt:403)
	at com.soywiz.korge.render.BatchBuilder2D.<init>(BatchBuilder2D.kt:42)
	at com.soywiz.korge.render.BatchBuilder2D.<init>(BatchBuilder2D.kt:15)
	at com.soywiz.korge.render.RenderContext.<init>(RenderContext.kt:18)
	at com.soywiz.korge.view.Views.<init>(Views.kt:61)
	at com.soywiz.korge.Korge$invoke$2.invokeSuspend(Korge.kt:414)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:32)
	at kotlinx.coroutines.DispatchedTask.run(Dispatched.kt:233)
	at com.soywiz.korgw.GameWindowCoroutineDispatcher.executePending(GameWindow.kt:83)
	at com.soywiz.korgw.DefaultGameWindowJvmKt$DefaultGameWindow$1.loop(DefaultGameWindowJvm.kt:379)
	at com.soywiz.korgw.DefaultGameWindowJvmKt$DefaultGameWindow$1$loop$1.invokeSuspend(DefaultGameWindowJvm.kt)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:32)
	at kotlinx.coroutines.DispatchedKt.resumeCancellable(Dispatched.kt:185)
	at kotlinx.coroutines.ResumeModeKt.resumeMode(ResumeMode.kt:22)
	at kotlinx.coroutines.DispatchedKt.resume(Dispatched.kt:272)
	at kotlinx.coroutines.DispatchedKt.dispatch(Dispatched.kt:261)
	at kotlinx.coroutines.CancellableContinuationImpl.dispatchResume(CancellableContinuationImpl.kt:218)
	at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl(CancellableContinuationImpl.kt:227)
	at kotlinx.coroutines.CancellableContinuationImpl.resumeUndispatched(CancellableContinuationImpl.kt:299)
	at kotlinx.coroutines.EventLoopImplBase$DelayedResumeTask.run(EventLoop.kt:298)
	at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.kt:116)
	at kotlinx.coroutines.DefaultExecutor.run(DefaultExecutor.kt:68)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "kotlinx.coroutines.DefaultExecutor" kotlin.UninitializedPropertyAccessException: lateinit property gl has not been initialized
	at com.soywiz.korag.AGAwtBase.getGl(GLExt.kt:42)
	at com.soywiz.korag.AGOpengl$GlBuffer.<init>(OpenglAG.kt:468)
	at com.soywiz.korag.AGOpengl.createBuffer(OpenglAG.kt:24)
	at com.soywiz.korag.AG.createVertexBuffer(AG.kt:403)
	at com.soywiz.korge.render.BatchBuilder2D.<init>(BatchBuilder2D.kt:42)
	at com.soywiz.korge.render.BatchBuilder2D.<init>(BatchBuilder2D.kt:15)
	at com.soywiz.korge.render.RenderContext.<init>(RenderContext.kt:18)
	at com.soywiz.korge.view.Views.<init>(Views.kt:61)
	at com.soywiz.korge.Korge$invoke$2.invokeSuspend(Korge.kt:414)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:32)
	at kotlinx.coroutines.DispatchedTask.run(Dispatched.kt:233)
	at com.soywiz.korgw.GameWindowCoroutineDispatcher.executePending(GameWindow.kt:83)
	at com.soywiz.korgw.DefaultGameWindowJvmKt$DefaultGameWindow$1.loop(DefaultGameWindowJvm.kt:379)
	at com.soywiz.korgw.DefaultGameWindowJvmKt$DefaultGameWindow$1$loop$1.invokeSuspend(DefaultGameWindowJvm.kt)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:32)
	at kotlinx.coroutines.DispatchedKt.resumeCancellable(Dispatched.kt:185)
	at kotlinx.coroutines.ResumeModeKt.resumeMode(ResumeMode.kt:22)
	at kotlinx.coroutines.DispatchedKt.resume(Dispatched.kt:272)
	at kotlinx.coroutines.DispatchedKt.dispatch(Dispatched.kt:261)
	at kotlinx.coroutines.CancellableContinuationImpl.dispatchResume(CancellableContinuationImpl.kt:218)
	at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl(CancellableContinuationImpl.kt:227)
	at kotlinx.coroutines.CancellableContinuationImpl.resumeUndispatched(CancellableContinuationImpl.kt:299)
	at kotlinx.coroutines.EventLoopImplBase$DelayedResumeTask.run(EventLoop.kt:298)
	at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.kt:116)
	at kotlinx.coroutines.DefaultExecutor.run(DefaultExecutor.kt:68)
	at java.lang.Thread.run(Thread.java:748)

AES256/SHA512...etc

I Love this Project
It is very useful fir me
Now
I need
1.AES 256 with IV
2.SHA512
3.HMACSHA256
for pure kotlin in commonMain
May you help to build new version
Thanks a lot

Annoying particle emitter behavior

The particle emitter seems to belch out some particles, then stop for a few seconds, then actually start. How can I make it go straight to actually starting?
Demo:
gif
On a side node; Can you move a particleEmitterView after placing it? It's annoying having to make a new one every time I want to move it.

Are mp3 & ogg sounds supported?

I tried loading sound files in this way:

    val formats = AudioFormats().registerStandard()
    val sound = resourcesVfs["sounds/circle_ok.ogg"].readAudioData(formats)

but it crashes with:

Exception in thread "kotlinx.coroutines.DefaultExecutor" com.soywiz.korio.lang.InvalidOperationException: Can't decode audio file JailVfs(ResourcesVfs[])[/sounds/circle_ok.mp3]
	at com.soywiz.korio.lang.ExceptionsKt.invalidOp(Exceptions.kt:29)
	at com.soywiz.korau.sound.AudioDataKt.readAudioData(AudioData.kt:93)
	at MainKt$main$2.invokeSuspend(main.kt:30)

Are mp3 and ogg files supported in jvm desktop run? Or is there a special encoding which should be used for sound files?

It seems to be supported:

AudioFormats.registerStandard(): AudioFormats = this.apply { register(WAV, OGG, MP3) } 

I tired it with this sound, but only the wav version works:
http://temp.tobsefritz.de/circle_ok.mp3
http://temp.tobsefritz.de/circle_ok.ogg
http://temp.tobsefritz.de/circle_ok.wav

How to deal with memory leaks when using `VectorBuilder`?

In my naive implementation I tried to render shapes in some kind of game loop. So I used the
VectorBuilder to draw primitives like VectorBuilder.rect(...). After playing around a mentioned that my JVM running game instance had a consumption of 10 GB of ram and a GPU consumption of 44%. This seems to be a little to much for my small retro console emulation game. And after running it in the browser and waiting a little, this Browser tab nearly froze my dev machine. So what did I wrong?

Let's extend the korge hallo world example wit that loop:

launchImmediately {
    while (true) {
        for(i  in 0..1000){
            graphics {
                beginFill(Context2d.Color(Colors.RED))
                rect(1+i, 1+i, 100, 100)
                endFill()
            }
        }

    image.tween(image::rotation[minDegrees], time = 1.seconds, easing = Easing.EASE_IN_OUT)
    }
}

I thought this loop shouldn't have a memory leak. Begin, draw, end and before we reach the end, all drawing state should be cleared. But watching the memory speaks another language:

2019-03-06_00h18_29
Thousands of double[]s are stored in GraphicsPath they are growing on every loop iteration.

So what's so wrong on this approach? Did I missed a dispose method which I have to call?

korge-box2d package on bintray is not updated.

Platform-specified implementations(e.g. korge-box2d-jvm, korge-box2d-js) are all updated now, but korge-box2d package is not updated.
Because of this, I can't add korge-box2d as dependency to my project.

Different click areas with `View.onClick()` on JS backend

I tried to get my game buttons working on JS build -without success.
So I tried it with a hello world. The first barrier was my the problem with my scaled Windows desktop resolution on 125%. Then I had problems with the key events in general because of a nasty chrome extension.

Both are easy to solve and my the hello button example runs on JVM and JS. So it's time for the get dirty in my game. Here i have still the problem of unpredictable bounding boxes on JavaScript run. It's hard to find out, what I did wrong, because on JVM all works.

Desktop JVM:
korge_hitklack_desktop

Chrome JS:
korge_hitklack_js

The problem also occurs on Firefox. All Browser extensions are disabled. Resolution is 3840 x 2160 without scaling. System: Windows 10.

The code for the game: https://github.com/TobseF/HitKlackOnKorGE

Don't know if it's related to this change on my game:
Fix wrong timer position in JavaScript build
Here the transform also had a different effect on the JS version.

Export Mac OS X Crash

I export the template app to Mac OS X and crash immediately. This happened when mouse is out the window and the other case is when I start the app with mouse pointer into the window and move mouse.

Add support for Laravel Blade / AdonisJS Edge Templating Syntax

As per Slack conversation with @soywiz, given the flexibility of Korte's implementation, it'd be great to support Laravel Blade/ AdonisJS Edge kind of syntax. I personally think that Blade/Edge is more to the spirit of Kotlin than Jinja syntax as far as the conciseness of the templating language goes. Blade and Edge syntax are almost exact with few minor differences (like self closing tags, which, again, shows the conciseness of the syntax).

Complete game sample request

Hi!

I found quite difficult to figure out how it works.

It would be very useful if you could add a complete game sample showing all the features included on the engine. I mean, the current samples does not show how are combined the features and the possibilities. It would be really useful something like a simple space invaders game. At least until the "Tutorial" section of the documentation is available.

Many thanks!

KorMA shape ops producing inaccurate results when dealing with unit scales close to 0.001

I made an Android app which uses KorMA to detect collision between polygons. On large scales (each unit corresponds to 1.0), it works fine, but when I get to smaller scales, it seems to break for some reason, even though the documentation doesn't mention anything in that regard.

Normal behaviour:

image

Flawed behaviour examples (notice how it sometimes works on one side, but not the other):

image
image
image

My only guess that it could be a problem with orientation. What I mean is, my y-axis is negative above the origin, and positive below it. However, this still wouldn't explain some of the artefacts.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.