diff --git a/buildtools/appimage/love-prepared/bin/love b/buildtools/appimage/love-prepared/bin/love index 468ebfe..c6341b3 100755 Binary files a/buildtools/appimage/love-prepared/bin/love and b/buildtools/appimage/love-prepared/bin/love differ diff --git a/mode-intro.fnl b/mode-intro.fnl index 446cd42..738f8fe 100644 --- a/mode-intro.fnl +++ b/mode-intro.fnl @@ -100,6 +100,8 @@ (var newseed (+ (love.timer.getTime) mx my)) (state.setSeed newseed) (set-mode :mode-play)) + (when (= key "f") + (love.window.setFullscreen (not (love.window.getFullscreen)))) (when (= key "x") (love.event.quit))) :mousemoved diff --git a/mode-play.fnl b/mode-play.fnl index 0d32725..5390787 100644 --- a/mode-play.fnl +++ b/mode-play.fnl @@ -52,58 +52,6 @@ ; Draw a big thing before everything else ; (love.graphics.draw (. skybox 1 :t) -20 -20) - ; CEILING/FLOOR CASTING - (var cf-f-tex-num (. walls 2)) - (var cf-c-tex-num (. walls 2)) - ; (var floor-texel (love.graphics.newQuad 0 0 1 1 (. cf-f-tex-num :w) (. cf-f-tex-num :h))) - (for [i (/ screen-height 2) screen-height] - ; Set ray-dir for left-most (i = 0) and right-most (i = screen-width) rays - (var (cf-ray-dir-x0 cf-ray-dir-y0) (values (- dirx planex) (- diry planey))) - (var (cf-ray-dir-x1 cf-ray-dir-y1) (values (+ dirx planex) (+ diry planey))) - - ; Current y position compared to horizon - (var cf-p (math.floor (/ (- i screen-height) 2))) - - ; Vertical position of the camera - (var cf-pos-z (* 0.5 screen-height)) - - ; Horizontal distance from camera to floor for current row - (var cf-row-distance (/ cf-pos-z cf-p)) - - ; Calculate step vectors - (var cf-floor-step-x (/ (* cf-row-distance (- cf-ray-dir-x1 cf-ray-dir-x0)) screen-width)) - (var cf-floor-step-y (/ (* cf-row-distance (- cf-ray-dir-y1 cf-ray-dir-y0)) screen-width)) - - ; Coordinates of left-most column, updated stepping to the right - (var (cf-floor-x cf-floor-y) (values (+ posx (* cf-row-distance cf-ray-dir-x0)) - (+ posy (* cf-row-distance cf-ray-dir-y0)))) - - ; Draw floor and ceiling - (for [j 0 screen-width] - ; Get cell - (var (cf-cell-x cf-cell-y) (values (math.floor cf-floor-x) (math.floor cf-floor-y))) - - ; Get texture coordinate from fractional part - ; CPP Code: wtf is the & doing there? - ; (var (cf-tx cf-ty) (values (math.floor (% (* tex-width (- cf-floor-x cf-cell-x)) tex-width)) - ; (math.floor (% (* tex-height (- cf-floor-y cf-cell-y)) tex-height)))) - (var (cf-tx cf-ty) (values (math.floor (* tex-width (- cf-floor-x cf-cell-x))) - (math.floor (* tex-height (- cf-floor-y cf-cell-y))))) - - ;; Draw the texture - ; (var tex-num cf-f-tex-num) - ; (love.graphics.draw (. tex-num :t) - ; (love.graphics.newQuad cf-tx 0 1 (. tex-num :h) (. tex-num :w) (. tex-num :h)) - ; i cf-ty 0 1 (/ line-height (. tex-num :h))) - ; (love.graphics.draw (. cf-f-tex-num :t) - ; floor-texel - ; j i 0 1 1) - - ; Step - (set cf-floor-x (+ cf-floor-x cf-floor-step-x)) - (set cf-floor-y (+ cf-floor-y cf-floor-step-y)) - ) - ) ; WALL CASTING (for [i 0 screen-width] ; Calculate ray position and direction diff --git a/state.fnl b/state.fnl index 08e0ce5..5d9854d 100644 --- a/state.fnl +++ b/state.fnl @@ -14,7 +14,7 @@ ; The Map table holds the map meta-data ; [n] number of cells ; [h w] hall and wall widths -(var map {:n 10 :h 2 :w 2}) +(var map {:n 10 :h 3 :w 4}) {:getSeed (fn getSeed [] game.seed) :setSeed (fn setSeed [x] (set game.seed x))