forked from nova/jmonkey-test
36 lines
981 B
Plaintext
36 lines
981 B
Plaintext
|
// @file:Import("src/main/resources/hello2.main.kts")
|
||
|
@file:DependsOn("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.0-M1")
|
||
|
@file:DependsOn("/home/rohan/.m2/repository/wow/doge/game/1.0-SNAPSHOT/game-1.0-SNAPSHOT.jar")
|
||
|
@file:DependsOn("/home/rohan/.ivy2/local/wow.doge/mygame_2.13/1.0-SNAPSHOT/jars/mygame_2.13.jar")
|
||
|
|
||
|
import wow.doge.game.types.GameScript
|
||
|
|
||
|
import kotlinx.coroutines.delay
|
||
|
import kotlinx.coroutines.launch
|
||
|
import kotlinx.coroutines.runBlocking
|
||
|
import kotlin.random.Random
|
||
|
|
||
|
import wow.doge.mygame.components.Test
|
||
|
|
||
|
|
||
|
//println(x * 2)
|
||
|
|
||
|
println("hello from main script")
|
||
|
|
||
|
class GameScriptImpl : GameScript {
|
||
|
override fun start() = runBlocking {
|
||
|
for(x in 0 until 5) {
|
||
|
launch {
|
||
|
val del = Random.nextLong(20, 100)
|
||
|
|
||
|
delay(del)
|
||
|
println("hello from start $x, delay is $del")
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
override fun stop() {println("hello from stop")}
|
||
|
}
|
||
|
|
||
|
GameScriptImpl()
|
||
|
|
||
|
class MyTest : Test()
|