Shrank canvas, shrank levels, changed perspective of levels.
(defpage "/tempest/:level" {:keys [level]}
(common/site-layout
(include-js "/tempest.js")
- [:canvas#canv-bg {:width "1000" :height "900"
+ [:canvas#canv-bg {:width "1000" :height "700"
:style (str "position: absolute; z-index: 0;"
"background-color: #000000;")}]
- [:canvas#canv-fg {:width "1000" :height "900"
+ [:canvas#canv-fg {:width "1000" :height "700"
:style (str "position: absolute; z-index: 1;")}]
- [:p#fps {:style "color: #FFFFFF; position: absolute; top: 910px"} "FPS 0.0"]
+ [:p#fps {:style "color: #FFFFFF; position: absolute; top: 690px"} "FPS 0.0"]
(javascript-tag (str "tempest.canvasDraw(" (pr-str level) ");"))
))
(def ^{:doc "Default length, in pixels, from origin to inner line."}
- *default-line-length* 80)
+ *default-line-length* 20)
(def ^{:doc "Default length function, returns argument*4"}
*default-length-fn* #(* 4 %))
(def *level3_lines* (vec (flat-level 7 15 80)))
;; Oblong level, an open "W"
-(def *level4_lines* (vec (oblong-level [135 105 90 33] 15 80)))
+(def *level4_lines* (vec (oblong-level [135 105 90 33] 15 60)))
;; Oblong level, open "eagle wings"
-(def *level5_lines* (vec (oblong-level [135 100 90 90 90 85 80 75] 15 80)))
+(def *level5_lines* (vec (oblong-level [135 100 90 90 90 85 80 75] 15 60)))
;; Oblong level, a closed, spikey flower
(def *level6_lines* (vec (oblong-level [135 45 90 135 45 90 135 45 90 135 45 90
135 45 90 135 45 90 135 45 90 135 45] 15 80)))
+(def *level6_lines* (vec (oblong-level [135 45 90 135 45 90 135 45 90 135 45 90
+ 135 45 90 135 45 90 135 45 90 135 45] 11 57)))
+
(def *level7_lines* (vec (oblong-level [135 45 135 45] 15 3)))
vector of segments constructed of pairs of lines, and a length function.
This function takes a vector of lines, and a boolean specifying whether
the level is a closed loop, or open."
- [lines loops? enemy-count enemy-probability]
+ [lines loops? enemy-count enemy-probability &
+ {:keys [length-fn] :or {length-fn *default-length-fn*}}]
{:lines lines
:loops? loops?
:segments (build-segment-list (- (count lines) 1) loops?)
- :length-fn *default-length-fn*
+ :length-fn length-fn
:steps *default-steps-per-segment*
:remaining enemy-count
:probability enemy-probability})
{:flipper 0.01})
(make-level-entry *level2_lines* true
{:flipper 20}
- {:flipper 0.01})
+ {:flipper 0.01}
+ :length-fn #(* 9 %))
(make-level-entry *level3_lines* false
{:flipper 20}
{:flipper 0.01})