SlideShare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our User Agreement and Privacy Policy.
SlideShare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our Privacy Policy and User Agreement for details.
Successfully reported this slideshow.
Activate your 14 day free trial to unlock unlimited reading.
Description of the Reactive Collections framework for event-driven, reactive and distributed programming, and the real-time game engine use case. See the game demos on YouTube:
Description of the Reactive Collections framework for event-driven, reactive and distributed programming, and the real-time game engine use case. See the game demos on YouTube:
33.
33
val rotate =
keys.filter(_ == PAGEUP)
.map(_.down)
.signal(false)
true
false
map
signal
34.
34
val rotate: Signal[Boolean] = keys.filter(_ == PAGEUP) .map(_.down) .signal(false)
true
false
map
signal
35.
35
val rotate: Signal[Boolean] val ticks: Reactive[Long]
ticks
36.
36
val rotate: Signal[Boolean]
val ticks: Reactive[Long]
ticks
rotate
37.
37
val rotate: Signal[Boolean]
val ticks: Reactive[Long]
val viewAngle: Signal[Double] =
ticks
rotate
viewAngle
38.
38
val rotate: Signal[Boolean] val ticks: Reactive[Long] val viewAngle: Signal[Double] = ticks.scanPast(0.0)
ticks
rotate
viewAngle
39.
39
val rotate: Signal[Boolean] val ticks: Reactive[Long] val viewAngle: Signal[Double] = ticks.scanPast(0.0) { (a, _) => if (rotate()) a + 1 else a }
ticks
rotate
viewAngle