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.

30 lines
650 B

4 years ago
4 years ago
4 years ago
  1. package wow.doge.mygame.game.entities
  2. import akka.actor.typed.scaladsl.ActorContext
  3. import akka.actor.typed.scaladsl.Behaviors
  4. object PlayerCameraActor {
  5. sealed trait Command
  6. class Props() {
  7. def create =
  8. Behaviors.setup[Command] { ctx =>
  9. new PlayerCameraActor(ctx, this).receive(State.empty)
  10. }
  11. }
  12. case class State()
  13. object State {
  14. val empty = State()
  15. }
  16. }
  17. class PlayerCameraActor(
  18. ctx: ActorContext[PlayerCameraActor.Command],
  19. props: PlayerCameraActor.Props
  20. ) {
  21. import PlayerCameraActor._
  22. def receive(state: State) =
  23. Behaviors.receiveMessage[Command] {
  24. case _ => Behaviors.same
  25. }
  26. }