47 lines
1.6 KiB
Scala
47 lines
1.6 KiB
Scala
package fmon
|
|
|
|
import javafx.application.Application
|
|
import javafx.fxml._
|
|
import javafx.scene.{Scene, Parent}
|
|
import javafx.stage.Stage
|
|
|
|
import scalafx.Includes._
|
|
|
|
import fmon.battle.{BattleEngine, BattleUI}
|
|
import fmon.stat._
|
|
|
|
case class Prop(url : Seq[String])
|
|
|
|
object Game {
|
|
def main(args : Array[String]): Unit = {
|
|
Application.launch(classOf[Game], args: _*)
|
|
}
|
|
}
|
|
|
|
class Game extends Application {
|
|
override def start(primaryStage: Stage): Unit = {
|
|
val url = getClass.getResource("battle/battle.fxml")
|
|
val loader = new FXMLLoader(url)
|
|
val root: Parent = loader.load()
|
|
implicit val controller = loader.getController[BattleUI]()
|
|
val scene: Scene = new Scene(root)
|
|
|
|
implicit val rng = new scala.util.Random()
|
|
val form1 = Form("Diabolo")
|
|
val form2 = Form("Chanilla")
|
|
val movepool1 = IndexedSeq(Move("eruption"), Move("willowisp"), Move("thunderbolt"), Move("thunderwave"), Move("thundershock"))
|
|
val movepool2 = IndexedSeq(Move("tackle"))
|
|
val p1 = TrainerID("Jaeda", Gender.Female, 0)
|
|
val p2 = TrainerID("Wild Monster", Gender.Male, 0)
|
|
val party1 = new Party(p1, new MonsterPtr(Monster.generate("Allied Mon", p1, 500, form1, movepool1)), IndexedSeq())
|
|
val party2 = new Party(p2, new MonsterPtr(Monster.generate("Wild Mon", p2, 500, form2, movepool2)), IndexedSeq(
|
|
Monster.generate("Sideboard Mon", p2, 500, form2, movepool2)
|
|
))
|
|
val engine = new BattleEngine(party1, party2)
|
|
controller.setEngine(engine)
|
|
|
|
primaryStage.setTitle(Config.title)
|
|
primaryStage.setScene(scene)
|
|
primaryStage.show()
|
|
}
|
|
} |