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.

25 lines
634 B

4 years ago
  1. package wow.doge.mygame.game
  2. import cats.effect.Resource
  3. import com.jme3.app.state.AppState
  4. import com.jme3.system.AppSettings
  5. import monix.bio.Task
  6. // import wow.doge.mygame.executors.JMERunner
  7. trait GameModule {
  8. def gameAppResource(appStates: AppState*): Resource[Task, GameApp] =
  9. Resource.liftF {
  10. for {
  11. app <- Task(new GameApp(appStates: _*))
  12. _ <- Task {
  13. val settings = new AppSettings(true)
  14. // settings.setVSync(true)
  15. settings.setFrameRate(144)
  16. app.setSettings(settings)
  17. // JMERunner.runner = app
  18. app
  19. }
  20. } yield (app)
  21. }
  22. }