Clojure Reactive Programming by Borges Leonardo

Clojure Reactive Programming by Borges Leonardo

Author:Borges, Leonardo [Borges, Leonardo]
Language: eng
Format: azw3, epub, mobi
Publisher: Packt Publishing - ebooks Account
Published: 2015-03-22T16:00:00+00:00


There is quite a bit going on, so let's break it down.

canvas/entity is a monet constructor and expects you to provide three arguments that describe our ship: its initial x, y coordinates and angle, an update function that gets called in the draw loop, and a draw function that is responsible for actually drawing the shape onto the screen after each update.

The update function is fairly straightforward:

(fn [value] (-> value (assoc :x (shape-x ship)) (assoc :y (shape-y ship)) (assoc :angle (shape-angle ship))))



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.