An Entity Component System Scala framework
libraryDependencies += "dev.atedeg" %% "ecscala" % "0.2.1"
ECScala allows you to use the ECS architechtural pattern with ease:
import dev.atedeg.ecscala.given
case class Position(x: Float, y: Float) extends Component
case class Velocity(vx: Float, vy: Float) extends Component
object Example extends ECScalaDSL {
val world = World()
world hasAn entity withComponents { Position(1, 1) &: Velocity(2, 2) }
val movementSystem = System[Position &: Velocity &: CNil]
.withUpdate { (_, components, deltaTime) =>
val Position(x, y) &: Velocity(vx, vy) &: CNil = components
Position(x + vx*deltaTime, y + vy*deltaTime) &: Velocity(vx, vy) &: CNil
}
world hasA system(movementSystem)
world.update(10)
}
To learn how to use ECScala you can start by reading its wiki!
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
- Giacomo Cavalieri - giacomocavalieri
- Nicolò Di Domenico - ndido98
- Nicolas Farabegoli - nicolasfara
- Linda Vitali - vitlinda
Distributed under the MIT license. See LICESE for more information.