Compare commits
6 commits
06d101cb08
...
9fc3881247
| Author | SHA1 | Date | |
|---|---|---|---|
| 9fc3881247 | |||
| 8f89883cb8 | |||
| b183853f77 | |||
| 402aa9051c | |||
| 97a9d0450c | |||
| 62f2a44864 |
20 changed files with 330 additions and 9 deletions
BIN
.DS_Store
vendored
BIN
.DS_Store
vendored
Binary file not shown.
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -1 +1,4 @@
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
||||||
|
.clj-kondo/
|
||||||
|
.lsp/
|
||||||
|
|
|
||||||
BIN
two_player_cleaning_game/.DS_Store
vendored
BIN
two_player_cleaning_game/.DS_Store
vendored
Binary file not shown.
BIN
two_player_cleaning_game/assets/curiosities-1x.png
Normal file
BIN
two_player_cleaning_game/assets/curiosities-1x.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 91 B |
79
two_player_cleaning_game/assets/gen_levels.bb
Executable file
79
two_player_cleaning_game/assets/gen_levels.bb
Executable file
|
|
@ -0,0 +1,79 @@
|
||||||
|
#!/usr/bin/env bb
|
||||||
|
(ns gen-levels
|
||||||
|
(:require
|
||||||
|
[babashka.fs :as fs]
|
||||||
|
[clojure.pprint :as pprint]
|
||||||
|
[clojure.data.xml :as xml]
|
||||||
|
[clojure.string :as str]
|
||||||
|
[clojure.java.io :as io]))
|
||||||
|
|
||||||
|
(def walls-tsx (xml/parse (io/reader "./tiled/walls.tsx")))
|
||||||
|
(def wall-colliders
|
||||||
|
(->>
|
||||||
|
(:content walls-tsx)
|
||||||
|
(remove string?)
|
||||||
|
(filter #(= (:tag %) :tile))
|
||||||
|
(map (fn [tile] (hash-map
|
||||||
|
:id (get-in tile [:attrs :id])
|
||||||
|
:boxes
|
||||||
|
(->> (:content tile)
|
||||||
|
(remove string?)
|
||||||
|
(map :content)
|
||||||
|
(flatten)
|
||||||
|
(remove string?)
|
||||||
|
(map :attrs)
|
||||||
|
(map #(select-keys % [:x :y :height :width]))
|
||||||
|
(map #(update-vals % (fn [v] (Math/round (Double/parseDouble v)))))))))))
|
||||||
|
|
||||||
|
(def level-001-tmx (xml/parse (io/reader "./tiled/level_001.tmx")))
|
||||||
|
(def level-001
|
||||||
|
(let [tags (remove string? (:content level-001-tmx))
|
||||||
|
tile-nums (-> (filter #(= (:tag %) :layer) tags)
|
||||||
|
first
|
||||||
|
:content
|
||||||
|
second
|
||||||
|
:content
|
||||||
|
first
|
||||||
|
str/split-lines
|
||||||
|
(->>
|
||||||
|
(remove empty?)
|
||||||
|
(map #(str/split % #","))
|
||||||
|
(map (fn [row] (map Integer/parseInt row)))))
|
||||||
|
|
||||||
|
tiles (vec (map-indexed
|
||||||
|
(fn [y row]
|
||||||
|
(vec (map-indexed
|
||||||
|
(fn [x tile-id] {:x (* x 25) :y (* y 25) :tile-id tile-id})
|
||||||
|
row))) tile-nums))]
|
||||||
|
|
||||||
|
(hash-map
|
||||||
|
:tiles tiles
|
||||||
|
:spawns (vec (reduce (fn [acc tag]
|
||||||
|
(if (= (:tag tag) :object)
|
||||||
|
(conj acc
|
||||||
|
(hash-map
|
||||||
|
:name (get-in tag [:attrs :name])
|
||||||
|
:x (Math/round (Double/parseDouble (get-in tag [:attrs :x])))
|
||||||
|
:y (Math/round (Double/parseDouble (get-in tag [:attrs :y])))))
|
||||||
|
acc)) '() (:content (first (filter #(= (get-in % [:attrs :name]) "spawns") tags))))))))
|
||||||
|
|
||||||
|
(pprint/pprint {:row (first (:tiles level-001))})
|
||||||
|
;; :wall-colliders wall-colliders})
|
||||||
|
|
||||||
|
;; (fs/write-lines "level_001.lua" (pr-str '(local name "travis")))
|
||||||
|
;; (pprint/pprint (pr-str level-001))
|
||||||
|
(fs/write-lines "../levels.fnl" ["(local levels"
|
||||||
|
(str/replace (pr-str {:level01 level-001}) #",+" "")
|
||||||
|
")\n\n"
|
||||||
|
"{ :levels levels }"])
|
||||||
|
|
||||||
|
;; (str "return " (pr-str {:tile (ffirst (:tiles level-001))
|
||||||
|
;; :wall-colliders wall-colliders
|
||||||
|
;; :spawns (:spawns level-001)}))))
|
||||||
|
|
||||||
|
;; (defn get-config-files [] (map #(hash-map :file-name % :content (fs/read-all-lines %)) (fs/glob "." "**.hcl")))
|
||||||
|
|
||||||
|
;; (defn gen-cron [start] (format "%d * * * *" start))
|
||||||
|
;; (defn get-config-files [] (map #(hash-map :file-name % :content (fs/read-all-lines %)) (fs/glob "." "**.hcl")))
|
||||||
|
|
||||||
|
;; (defn remove-build-files [files]
|
||||||
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 434 B |
Binary file not shown.
BIN
two_player_cleaning_game/assets/player.aseprite
Normal file
BIN
two_player_cleaning_game/assets/player.aseprite
Normal file
Binary file not shown.
BIN
two_player_cleaning_game/assets/player.png
Normal file
BIN
two_player_cleaning_game/assets/player.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 355 B |
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 184 B |
69
two_player_cleaning_game/assets/tiled/level_001.tmx
Normal file
69
two_player_cleaning_game/assets/tiled/level_001.tmx
Normal file
|
|
@ -0,0 +1,69 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<map version="1.10" tiledversion="1.12.1" orientation="orthogonal" renderorder="right-down" width="50" height="50" tilewidth="25" tileheight="25" infinite="0" nextlayerid="3" nextobjectid="4">
|
||||||
|
<editorsettings>
|
||||||
|
<export target="level_001.tmj" format="json"/>
|
||||||
|
</editorsettings>
|
||||||
|
<tileset firstgid="1" source="walls.tsx"/>
|
||||||
|
<layer id="1" name="Tile Layer 1" width="50" height="50">
|
||||||
|
<data encoding="csv">
|
||||||
|
5,1,1,1,1,1,1,1,1,1,1,1,12,1,1,1,1,1,1,1,12,1,1,1,1,1,1,1,1,12,1,1,1,1,1,1,1,1,1,12,1,1,1,1,1,1,1,1,1,4,
|
||||||
|
10,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,10,
|
||||||
|
10,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,8,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,8,11,11,11,11,11,11,11,11,11,10,
|
||||||
|
10,11,11,11,11,11,11,11,11,11,11,11,8,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,
|
||||||
|
10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,
|
||||||
|
10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,9,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,9,11,11,11,11,11,11,11,11,11,10,
|
||||||
|
10,11,11,11,11,11,11,11,11,11,11,11,9,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,8,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,10,
|
||||||
|
10,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,10,
|
||||||
|
10,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,10,
|
||||||
|
10,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,9,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,10,
|
||||||
|
14,1,1,1,1,1,1,1,1,1,1,1,15,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,10,
|
||||||
|
10,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,2,1,1,1,1,1,1,1,1,13,1,1,1,1,1,1,1,1,1,13,1,1,4,11,11,11,11,11,11,10,
|
||||||
|
10,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,10,
|
||||||
|
10,11,11,11,11,11,11,11,11,11,11,11,8,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,10,
|
||||||
|
10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,10,
|
||||||
|
10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,5,1,1,1,1,1,1,1,1,13,1,18,11,11,17,1,15,
|
||||||
|
10,11,11,11,11,11,11,11,11,11,11,11,9,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,
|
||||||
|
10,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,
|
||||||
|
10,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,9,11,11,11,11,11,11,10,
|
||||||
|
10,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,10,
|
||||||
|
14,1,1,1,1,1,1,1,1,1,1,1,15,11,11,11,11,11,11,11,5,1,1,1,1,1,1,1,1,4,11,11,11,10,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,10,
|
||||||
|
10,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,10,11,11,11,10,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,10,
|
||||||
|
10,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,10,11,11,11,10,11,11,11,11,11,11,11,11,8,11,11,11,11,11,11,10,
|
||||||
|
10,11,11,11,11,11,11,11,11,11,11,11,8,11,11,11,11,11,11,11,8,11,11,11,11,11,11,11,11,8,11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,
|
||||||
|
10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,
|
||||||
|
10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,9,11,11,11,11,11,11,11,11,9,11,11,11,14,18,11,11,17,1,1,1,1,12,1,1,1,18,11,11,20,
|
||||||
|
10,11,11,11,11,11,11,11,11,11,11,11,9,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,10,11,11,11,10,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,10,
|
||||||
|
10,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,10,11,11,11,10,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,10,
|
||||||
|
10,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,10,11,11,11,10,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,10,
|
||||||
|
10,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,2,1,1,1,1,1,1,1,1,3,11,11,11,10,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,10,
|
||||||
|
14,1,1,1,1,1,1,1,1,1,1,1,15,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,10,
|
||||||
|
10,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,10,
|
||||||
|
10,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,10,
|
||||||
|
10,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,14,1,1,1,1,1,18,11,11,10,11,11,17,1,1,1,15,
|
||||||
|
10,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,10,
|
||||||
|
10,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,10,
|
||||||
|
10,11,11,11,11,11,11,11,11,11,11,11,8,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,10,
|
||||||
|
10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,10,
|
||||||
|
10,11,11,11,11,11,11,11,11,11,11,11,9,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,10,
|
||||||
|
10,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,5,1,1,1,1,1,1,1,1,1,12,1,1,3,11,11,17,1,1,1,1,1,16,1,1,1,18,11,11,20,
|
||||||
|
14,1,1,1,1,1,1,1,1,1,1,1,15,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,10,
|
||||||
|
10,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,10,
|
||||||
|
10,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,8,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,10,
|
||||||
|
10,11,11,11,11,11,11,11,11,11,11,11,8,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,10,
|
||||||
|
10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,8,11,11,11,11,11,11,10,
|
||||||
|
10,11,11,11,11,11,11,11,11,11,11,11,9,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,9,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,
|
||||||
|
10,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,8,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,
|
||||||
|
10,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,9,11,11,11,11,11,11,10,
|
||||||
|
10,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,10,
|
||||||
|
2,1,1,1,1,1,1,1,1,1,1,1,13,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,13,1,1,1,1,1,1,1,1,1,1,1,13,1,1,1,1,1,1,3
|
||||||
|
</data>
|
||||||
|
</layer>
|
||||||
|
<objectgroup id="2" name="spawns">
|
||||||
|
<object id="1" name="spawn1" x="569.372" y="697.644">
|
||||||
|
<point/>
|
||||||
|
</object>
|
||||||
|
<object id="3" name="spawn2" x="679.319" y="590.314">
|
||||||
|
<point/>
|
||||||
|
</object>
|
||||||
|
</objectgroup>
|
||||||
|
</map>
|
||||||
14
two_player_cleaning_game/assets/tiled/untitled.tiled-project
Normal file
14
two_player_cleaning_game/assets/tiled/untitled.tiled-project
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
{
|
||||||
|
"automappingRulesFile": "",
|
||||||
|
"commands": [
|
||||||
|
],
|
||||||
|
"compatibilityVersion": 1100,
|
||||||
|
"extensionsPath": "extensions",
|
||||||
|
"folders": [
|
||||||
|
"../../"
|
||||||
|
],
|
||||||
|
"properties": [
|
||||||
|
],
|
||||||
|
"propertyTypes": [
|
||||||
|
]
|
||||||
|
}
|
||||||
32
two_player_cleaning_game/assets/tiled/untitled.tiled-session
Normal file
32
two_player_cleaning_game/assets/tiled/untitled.tiled-session
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
{
|
||||||
|
"activeFile": "",
|
||||||
|
"expandedProjectPaths": [
|
||||||
|
],
|
||||||
|
"fileStates": {
|
||||||
|
"map_tileset.tsx": {
|
||||||
|
"dynamicWrapping": false,
|
||||||
|
"scaleInDock": 1,
|
||||||
|
"scaleInEditor": 8
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"last.exportedFilePath": "/Users/she0001t/personal_projects/fennel_love2d_experiments/two_player_cleaning_game/assets/tiled",
|
||||||
|
"last.imagePath": "/Users/she0001t/personal_projects/fennel_love2d_experiments/two_player_cleaning_game/assets",
|
||||||
|
"map.height": 50,
|
||||||
|
"map.lastUsedExportFilter": "JSON map files (*.tmj *.json)",
|
||||||
|
"map.lastUsedFormat": "tmx",
|
||||||
|
"map.tileHeight": 25,
|
||||||
|
"map.tileWidth": 25,
|
||||||
|
"map.width": 50,
|
||||||
|
"openFiles": [
|
||||||
|
],
|
||||||
|
"project": "untitled.tiled-project",
|
||||||
|
"recentFiles": [
|
||||||
|
"map_tileset.tsx"
|
||||||
|
],
|
||||||
|
"tileset.lastUsedFormat": "tsx",
|
||||||
|
"tileset.tileSize": {
|
||||||
|
"height": 25,
|
||||||
|
"width": 25
|
||||||
|
},
|
||||||
|
"tileset.type": 0
|
||||||
|
}
|
||||||
110
two_player_cleaning_game/assets/tiled/walls.tsx
Normal file
110
two_player_cleaning_game/assets/tiled/walls.tsx
Normal file
|
|
@ -0,0 +1,110 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<tileset version="1.10" tiledversion="1.12.1" name="walls" tilewidth="25" tileheight="25" tilecount="20" columns="20">
|
||||||
|
<image source="../walls.png" width="500" height="25"/>
|
||||||
|
<tile id="0">
|
||||||
|
<objectgroup draworder="index" id="2">
|
||||||
|
<object id="1" x="0.141111" y="4.23334" width="24.9767" height="17.4978"/>
|
||||||
|
</objectgroup>
|
||||||
|
</tile>
|
||||||
|
<tile id="1">
|
||||||
|
<objectgroup draworder="index" id="2">
|
||||||
|
<object id="1" x="10.16" y="4.23334" width="14.6756" height="17.6389"/>
|
||||||
|
<object id="2" x="10.3011" y="-1.77636e-15" width="4.51556" height="5.22112"/>
|
||||||
|
</objectgroup>
|
||||||
|
</tile>
|
||||||
|
<tile id="2">
|
||||||
|
<objectgroup draworder="index" id="2">
|
||||||
|
<object id="1" x="-0.264752" y="4.10365" width="15.0247" height="17.8045"/>
|
||||||
|
<object id="2" x="10.0606" y="-0.0661879" width="4.83172" height="4.30221"/>
|
||||||
|
</objectgroup>
|
||||||
|
</tile>
|
||||||
|
<tile id="3">
|
||||||
|
<objectgroup draworder="index" id="2">
|
||||||
|
<object id="1" x="-0.264752" y="4.03746" width="15.157" height="17.8707"/>
|
||||||
|
<object id="2" x="10.0606" y="20.1873" width="4.76553" height="4.96409"/>
|
||||||
|
</objectgroup>
|
||||||
|
</tile>
|
||||||
|
<tile id="4">
|
||||||
|
<objectgroup draworder="index" id="2">
|
||||||
|
<object id="1" x="10.1267" y="4.16984" width="14.7599" height="17.6722"/>
|
||||||
|
<object id="2" x="10.0606" y="18.3341" width="4.83172" height="6.5526"/>
|
||||||
|
</objectgroup>
|
||||||
|
</tile>
|
||||||
|
<tile id="5">
|
||||||
|
<objectgroup draworder="index" id="2">
|
||||||
|
<object id="1" x="9.99437" y="4.10365" width="15.0247" height="17.8707"/>
|
||||||
|
</objectgroup>
|
||||||
|
</tile>
|
||||||
|
<tile id="6">
|
||||||
|
<objectgroup draworder="index" id="2">
|
||||||
|
<object id="1" x="1.77636e-15" y="4.10365" width="14.8261" height="18.0031"/>
|
||||||
|
</objectgroup>
|
||||||
|
</tile>
|
||||||
|
<tile id="7">
|
||||||
|
<objectgroup draworder="index" id="2">
|
||||||
|
<object id="1" x="10.1267" y="0.0661879" width="4.89791" height="21.7758"/>
|
||||||
|
</objectgroup>
|
||||||
|
</tile>
|
||||||
|
<tile id="8">
|
||||||
|
<objectgroup draworder="index" id="2">
|
||||||
|
<object id="1" x="10.0606" y="4.10365" width="4.89791" height="20.8492"/>
|
||||||
|
</objectgroup>
|
||||||
|
</tile>
|
||||||
|
<tile id="9">
|
||||||
|
<objectgroup draworder="index" id="2">
|
||||||
|
<object id="1" x="9.99437" y="-0.0661879" width="4.96409" height="24.8867"/>
|
||||||
|
</objectgroup>
|
||||||
|
</tile>
|
||||||
|
<tile id="11">
|
||||||
|
<objectgroup draworder="index" id="2">
|
||||||
|
<object id="1" x="-0.132376" y="4.03746" width="25.019" height="17.7384"/>
|
||||||
|
<object id="2" x="10.1929" y="13.9656" width="4.76553" height="11.1858"/>
|
||||||
|
</objectgroup>
|
||||||
|
</tile>
|
||||||
|
<tile id="12">
|
||||||
|
<objectgroup draworder="index" id="2">
|
||||||
|
<object id="1" x="0.0661879" y="4.23603" width="24.9528" height="17.3412"/>
|
||||||
|
<object id="2" x="9.99437" y="0.0661879" width="4.89791" height="10.1267"/>
|
||||||
|
</objectgroup>
|
||||||
|
</tile>
|
||||||
|
<tile id="13">
|
||||||
|
<objectgroup draworder="index" id="2">
|
||||||
|
<object id="1" x="10.1267" y="4.16984" width="14.9585" height="17.7384"/>
|
||||||
|
<object id="2" x="10.0606" y="-0.0661879" width="4.76553" height="25.019"/>
|
||||||
|
</objectgroup>
|
||||||
|
</tile>
|
||||||
|
<tile id="14">
|
||||||
|
<objectgroup draworder="index" id="2">
|
||||||
|
<object id="1" x="0.0661879" y="4.03746" width="14.8923" height="17.9369"/>
|
||||||
|
<object id="2" x="10.0606" y="0.0661879" width="4.89791" height="24.9528"/>
|
||||||
|
</objectgroup>
|
||||||
|
</tile>
|
||||||
|
<tile id="15">
|
||||||
|
<objectgroup draworder="index" id="2">
|
||||||
|
<object id="1" x="-0.264752" y="4.10365" width="25.1514" height="17.8045"/>
|
||||||
|
<object id="2" x="10.1267" y="0" width="4.63315" height="24.8205"/>
|
||||||
|
</objectgroup>
|
||||||
|
</tile>
|
||||||
|
<tile id="16">
|
||||||
|
<objectgroup draworder="index" id="2">
|
||||||
|
<object id="1" x="3.04464" y="4.03746" width="21.9082" height="17.6722"/>
|
||||||
|
</objectgroup>
|
||||||
|
</tile>
|
||||||
|
<tile id="17">
|
||||||
|
<objectgroup draworder="index" id="2">
|
||||||
|
<object id="2" x="0.132376" y="4.10365" width="21.7096" height="17.7384"/>
|
||||||
|
</objectgroup>
|
||||||
|
</tile>
|
||||||
|
<tile id="18">
|
||||||
|
<objectgroup draworder="index" id="2">
|
||||||
|
<object id="1" x="9.99437" y="-0.132376" width="4.89791" height="25.1514"/>
|
||||||
|
<object id="2" x="13.7671" y="4.03746" width="8.14111" height="17.606"/>
|
||||||
|
</objectgroup>
|
||||||
|
</tile>
|
||||||
|
<tile id="19">
|
||||||
|
<objectgroup draworder="index" id="2">
|
||||||
|
<object id="1" x="10.0606" y="0" width="4.76553" height="24.9528"/>
|
||||||
|
<object id="2" x="3.04464" y="4.03746" width="11.6491" height="17.9369"/>
|
||||||
|
</objectgroup>
|
||||||
|
</tile>
|
||||||
|
</tileset>
|
||||||
BIN
two_player_cleaning_game/assets/walls.aseprite
Normal file
BIN
two_player_cleaning_game/assets/walls.aseprite
Normal file
Binary file not shown.
BIN
two_player_cleaning_game/assets/walls.png
Normal file
BIN
two_player_cleaning_game/assets/walls.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 559 B |
6
two_player_cleaning_game/levels.fnl
Normal file
6
two_player_cleaning_game/levels.fnl
Normal file
File diff suppressed because one or more lines are too long
|
|
@ -1,6 +1,7 @@
|
||||||
(local map-util (require "map-util.fnl"))
|
(local map-util (require "map-util.fnl"))
|
||||||
|
(local levels (require "levels.fnl"))
|
||||||
|
|
||||||
(var player-sprite nil) ; 20x20 pixels
|
(var player-art nil) ; 25x50 pixels each player is 25x25
|
||||||
(var dust-sprite nil) ; 35x35 pixels
|
(var dust-sprite nil) ; 35x35 pixels
|
||||||
(local game-state {
|
(local game-state {
|
||||||
:player-pos [0 0]
|
:player-pos [0 0]
|
||||||
|
|
@ -32,10 +33,16 @@
|
||||||
(map-util:load)
|
(map-util:load)
|
||||||
(love.window.setMode 600 640)
|
(love.window.setMode 600 640)
|
||||||
|
|
||||||
(set player-sprite (love.graphics.newImage "assets/player_001.png"))
|
|
||||||
|
(set player-art {
|
||||||
|
:player-sprite (love.graphics.newImage "assets/player.png")
|
||||||
|
:player1-quad (love.graphics.newQuad 0 0 25 25 50 25)
|
||||||
|
:player2-quad (love.graphics.newQuad 25 0 25 25 50 25)
|
||||||
|
})
|
||||||
|
|
||||||
(set dust-sprite (love.graphics.newImage "assets/dust_001.png"))
|
(set dust-sprite (love.graphics.newImage "assets/dust_001.png"))
|
||||||
(start-level)
|
(start-level)
|
||||||
(print (fennel.view game-state))
|
; (print (fennel.view game-state))
|
||||||
;; start a thread listening on stdin
|
;; start a thread listening on stdin
|
||||||
(: (love.thread.newThread "require('love.event')
|
(: (love.thread.newThread "require('love.event')
|
||||||
while 1 do love.event.push('stdin', io.read('*line')) end") :start))
|
while 1 do love.event.push('stdin', io.read('*line')) end") :start))
|
||||||
|
|
@ -67,9 +74,9 @@ while 1 do love.event.push('stdin', io.read('*line')) end") :start))
|
||||||
(each [y cells (ipairs (. game-state :world))]
|
(each [y cells (ipairs (. game-state :world))]
|
||||||
(each [x cell (ipairs cells)]
|
(each [x cell (ipairs cells)]
|
||||||
(case [(. cell :revealed) (. cell :type)]
|
(case [(. cell :revealed) (. cell :type)]
|
||||||
[false _] (do
|
; [false _] (do
|
||||||
(love.graphics.setColor 1 1 1) ; reset color to white (no tinting)
|
; (love.graphics.setColor 1 1 1) ; reset color to white (no tinting)
|
||||||
(love.graphics.draw dust-sprite (+ 45 (* 25 (- x 1))) (+ 45 (* 25 (- y 1)))))
|
; (love.graphics.draw dust-sprite (+ 45 (* 25 (- x 1))) (+ 45 (* 25 (- y 1)))))
|
||||||
[true :wall] (do
|
[true :wall] (do
|
||||||
(love.graphics.setColor (unpack black))
|
(love.graphics.setColor (unpack black))
|
||||||
(love.graphics.rectangle "fill" (+ 50 (* 25 (- x 1))) (+ 50 (* 25 (- y 1))) 25 25))
|
(love.graphics.rectangle "fill" (+ 50 (* 25 (- x 1))) (+ 50 (* 25 (- y 1))) 25 25))
|
||||||
|
|
@ -102,10 +109,11 @@ while 1 do love.event.push('stdin', io.read('*line')) end") :start))
|
||||||
:e 0
|
:e 0
|
||||||
:w 25)
|
:w 25)
|
||||||
]
|
]
|
||||||
(love.graphics.draw player-sprite
|
(love.graphics.draw
|
||||||
|
(. player-art :player-sprite)
|
||||||
|
(. player-art :player1-quad)
|
||||||
(+ (* 25 player-x) x-offset 25)
|
(+ (* 25 player-x) x-offset 25)
|
||||||
(+ (* 25 player-y) y-offset 25)
|
(+ (* 25 player-y) y-offset 25))))
|
||||||
rot 1.25 1.25)))
|
|
||||||
|
|
||||||
(fn draw-ghost-grid []
|
(fn draw-ghost-grid []
|
||||||
(love.graphics.setColor (unpack black-half-tone))
|
(love.graphics.setColor (unpack black-half-tone))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue