summary history branches tags files
commit:27955e1771034b92fcce61f9200b1f6c4ceba07f
author:mrmekon
committer:mrmekon
date:Sat Apr 7 00:21:02 2012 -0400
parents:096fccc06f8ca5c1c6dbd5a2c63d4fb5b36712c6
Shrank canvas, shrank levels, changed perspective of levels.
diff --git a/src/tempest_cljs/views/welcome.clj b/src/tempest_cljs/views/welcome.clj
line changes: +3/-3
index 8f7fae3..4710971
--- a/src/tempest_cljs/views/welcome.clj
+++ b/src/tempest_cljs/views/welcome.clj
@@ -11,12 +11,12 @@
 (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) ");"))
    ))
 

diff --git a/tempest/tempest/levels.cljs b/tempest/tempest/levels.cljs
line changes: +11/-6
index 3af6e6b..6e788e5
--- a/tempest/tempest/levels.cljs
+++ b/tempest/tempest/levels.cljs
@@ -40,7 +40,7 @@ Functions related to generating paths representing levels.
 
 
 (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 %))
@@ -234,15 +234,18 @@ Functions related to generating paths representing levels.
 (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)))
 
 
@@ -252,11 +255,12 @@ Functions related to generating paths representing levels.
    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})
@@ -267,7 +271,8 @@ Functions related to generating paths representing levels.
                       {: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})