Testing out JmonkeyEngine to make a game in Scala with Akka Actors within a pure FP layer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
981 B

4 years ago
  1. // @file:Import("src/main/resources/hello2.main.kts")
  2. @file:DependsOn("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.0-M1")
  3. @file:DependsOn("/home/rohan/.m2/repository/wow/doge/game/1.0-SNAPSHOT/game-1.0-SNAPSHOT.jar")
  4. @file:DependsOn("/home/rohan/.ivy2/local/wow.doge/mygame_2.13/1.0-SNAPSHOT/jars/mygame_2.13.jar")
  5. import wow.doge.game.types.GameScript
  6. import kotlinx.coroutines.delay
  7. import kotlinx.coroutines.launch
  8. import kotlinx.coroutines.runBlocking
  9. import kotlin.random.Random
  10. import wow.doge.mygame.components.Test
  11. //println(x * 2)
  12. println("hello from main script")
  13. class GameScriptImpl : GameScript {
  14. override fun start() = runBlocking {
  15. for(x in 0 until 5) {
  16. launch {
  17. val del = Random.nextLong(20, 100)
  18. delay(del)
  19. println("hello from start $x, delay is $del")
  20. }
  21. }
  22. }
  23. override fun stop() {println("hello from stop")}
  24. }
  25. GameScriptImpl()
  26. class MyTest : Test()