forked from nova/jmonkey-test
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.
32 lines
919 B
32 lines
919 B
package wow.doge.mygame.game.subsystems.level
|
|
|
|
import com.jme3.bullet.control.RigidBodyControl
|
|
import com.jme3.light.AmbientLight
|
|
import com.jme3.light.DirectionalLight
|
|
import com.jme3.scene.Spatial
|
|
import com.softwaremill.tagging._
|
|
import monix.bio.Task
|
|
import wow.doge.mygame.game.GameAppTags
|
|
// import wow.doge.mygame.implicits._
|
|
import wow.doge.mygame.utils.wrappers.jme.AppNode
|
|
import wow.doge.mygame.utils.wrappers.jme.PhysicsSpace
|
|
|
|
class GameLevel(
|
|
model: Spatial,
|
|
physicsControl: RigidBodyControl,
|
|
ambientLight: AmbientLight,
|
|
directionalLight: DirectionalLight
|
|
) {
|
|
def addToGame(
|
|
rootNode: AppNode[Task] @@ GameAppTags.RootNode,
|
|
physicsSpace: PhysicsSpace[Task]
|
|
) = {
|
|
for {
|
|
_ <- rootNode += model
|
|
_ <- rootNode += ambientLight
|
|
_ <- rootNode += directionalLight
|
|
_ <- physicsSpace += model
|
|
_ <- physicsSpace += physicsControl
|
|
} yield ()
|
|
}
|
|
}
|