├── .clj-kondo
├── config.edn
└── rewrite-clj
│ └── rewrite-clj
│ └── config.edn
├── .github
└── FUNDING.yml
├── .gitignore
├── .run
└── REPL.run.xml
├── .vscode
├── settings.json
└── tasks.json
├── .watchmanconfig
├── LICENSE
├── README.md
├── app.json
├── assets
├── cljs.png
├── icon.png
├── icons
│ ├── app.png
│ └── loading.png
├── images
│ ├── arrow
│ │ ├── arrow_down.png
│ │ ├── arrow_left.png
│ │ ├── arrow_right.png
│ │ └── arrow_up.png
│ ├── bonfire
│ │ ├── 0.png
│ │ ├── 1.png
│ │ ├── 2.png
│ │ ├── 3.png
│ │ └── 4.png
│ ├── cljs.png
│ ├── cljs@2x.png
│ ├── cljs@3x.png
│ ├── controls
│ │ ├── dpad.png
│ │ ├── dpad_down.png
│ │ ├── dpad_left.png
│ │ ├── dpad_right.png
│ │ └── dpad_up.png
│ ├── deer
│ │ ├── run_down_0.png
│ │ ├── run_down_1.png
│ │ ├── run_down_2.png
│ │ ├── run_down_3.png
│ │ ├── run_down_4.png
│ │ ├── run_down_5.png
│ │ ├── run_left_0.png
│ │ ├── run_left_1.png
│ │ ├── run_left_2.png
│ │ ├── run_left_3.png
│ │ ├── run_left_4.png
│ │ ├── run_left_5.png
│ │ ├── run_right_0.png
│ │ ├── run_right_1.png
│ │ ├── run_right_2.png
│ │ ├── run_right_3.png
│ │ ├── run_right_4.png
│ │ ├── run_right_5.png
│ │ ├── run_up_0.png
│ │ ├── run_up_1.png
│ │ ├── run_up_2.png
│ │ ├── run_up_3.png
│ │ ├── run_up_4.png
│ │ └── run_up_5.png
│ ├── lakshmana
│ │ ├── walk_down_0.png
│ │ ├── walk_down_1.png
│ │ ├── walk_down_2.png
│ │ ├── walk_down_3.png
│ │ ├── walk_down_4.png
│ │ ├── walk_down_5.png
│ │ ├── walk_down_6.png
│ │ ├── walk_down_7.png
│ │ ├── walk_down_8.png
│ │ ├── walk_left_0.png
│ │ ├── walk_left_1.png
│ │ ├── walk_left_2.png
│ │ ├── walk_left_3.png
│ │ ├── walk_left_4.png
│ │ ├── walk_left_5.png
│ │ ├── walk_left_6.png
│ │ ├── walk_left_7.png
│ │ ├── walk_left_8.png
│ │ ├── walk_right_0.png
│ │ ├── walk_right_1.png
│ │ ├── walk_right_2.png
│ │ ├── walk_right_3.png
│ │ ├── walk_right_4.png
│ │ ├── walk_right_5.png
│ │ ├── walk_right_6.png
│ │ ├── walk_right_7.png
│ │ ├── walk_right_8.png
│ │ ├── walk_up_0.png
│ │ ├── walk_up_1.png
│ │ ├── walk_up_2.png
│ │ ├── walk_up_3.png
│ │ ├── walk_up_4.png
│ │ ├── walk_up_5.png
│ │ ├── walk_up_6.png
│ │ ├── walk_up_7.png
│ │ └── walk_up_8.png
│ ├── objects
│ │ ├── ScareCrow.png
│ │ ├── bow_pickup.png
│ │ ├── collision_area.png
│ │ └── hut.png
│ ├── rama
│ │ ├── shoot_down_0.png
│ │ ├── shoot_down_1.png
│ │ ├── shoot_down_10.png
│ │ ├── shoot_down_11.png
│ │ ├── shoot_down_12.png
│ │ ├── shoot_down_2.png
│ │ ├── shoot_down_3.png
│ │ ├── shoot_down_4.png
│ │ ├── shoot_down_5.png
│ │ ├── shoot_down_6.png
│ │ ├── shoot_down_7.png
│ │ ├── shoot_down_8.png
│ │ ├── shoot_down_9.png
│ │ ├── shoot_left_0.png
│ │ ├── shoot_left_1.png
│ │ ├── shoot_left_10.png
│ │ ├── shoot_left_11.png
│ │ ├── shoot_left_12.png
│ │ ├── shoot_left_2.png
│ │ ├── shoot_left_3.png
│ │ ├── shoot_left_4.png
│ │ ├── shoot_left_5.png
│ │ ├── shoot_left_6.png
│ │ ├── shoot_left_7.png
│ │ ├── shoot_left_8.png
│ │ ├── shoot_left_9.png
│ │ ├── shoot_right_0.png
│ │ ├── shoot_right_1.png
│ │ ├── shoot_right_10.png
│ │ ├── shoot_right_11.png
│ │ ├── shoot_right_12.png
│ │ ├── shoot_right_2.png
│ │ ├── shoot_right_3.png
│ │ ├── shoot_right_4.png
│ │ ├── shoot_right_5.png
│ │ ├── shoot_right_6.png
│ │ ├── shoot_right_7.png
│ │ ├── shoot_right_8.png
│ │ ├── shoot_right_9.png
│ │ ├── shoot_up_0.png
│ │ ├── shoot_up_1.png
│ │ ├── shoot_up_10.png
│ │ ├── shoot_up_11.png
│ │ ├── shoot_up_12.png
│ │ ├── shoot_up_2.png
│ │ ├── shoot_up_3.png
│ │ ├── shoot_up_4.png
│ │ ├── shoot_up_5.png
│ │ ├── shoot_up_6.png
│ │ ├── shoot_up_7.png
│ │ ├── shoot_up_8.png
│ │ ├── shoot_up_9.png
│ │ ├── walk_down_0.png
│ │ ├── walk_down_1.png
│ │ ├── walk_down_2.png
│ │ ├── walk_down_3.png
│ │ ├── walk_down_4.png
│ │ ├── walk_down_5.png
│ │ ├── walk_down_6.png
│ │ ├── walk_down_7.png
│ │ ├── walk_down_8.png
│ │ ├── walk_left_0.png
│ │ ├── walk_left_1.png
│ │ ├── walk_left_2.png
│ │ ├── walk_left_3.png
│ │ ├── walk_left_4.png
│ │ ├── walk_left_5.png
│ │ ├── walk_left_6.png
│ │ ├── walk_left_7.png
│ │ ├── walk_left_8.png
│ │ ├── walk_right_0.png
│ │ ├── walk_right_1.png
│ │ ├── walk_right_2.png
│ │ ├── walk_right_3.png
│ │ ├── walk_right_4.png
│ │ ├── walk_right_5.png
│ │ ├── walk_right_6.png
│ │ ├── walk_right_7.png
│ │ ├── walk_right_8.png
│ │ ├── walk_up_0.png
│ │ ├── walk_up_1.png
│ │ ├── walk_up_2.png
│ │ ├── walk_up_3.png
│ │ ├── walk_up_4.png
│ │ ├── walk_up_5.png
│ │ ├── walk_up_6.png
│ │ ├── walk_up_7.png
│ │ └── walk_up_8.png
│ ├── tadaka
│ │ ├── walk_down_0.png
│ │ ├── walk_down_1.png
│ │ ├── walk_down_2.png
│ │ ├── walk_down_3.png
│ │ ├── walk_left_0.png
│ │ ├── walk_left_1.png
│ │ ├── walk_left_2.png
│ │ ├── walk_left_3.png
│ │ ├── walk_right_0.png
│ │ ├── walk_right_1.png
│ │ ├── walk_right_2.png
│ │ ├── walk_right_3.png
│ │ ├── walk_up_0.png
│ │ ├── walk_up_1.png
│ │ ├── walk_up_2.png
│ │ └── walk_up_3.png
│ ├── terrain
│ │ ├── beach_bl_grass.png
│ │ ├── beach_bm_grass.png
│ │ ├── beach_br_grass.png
│ │ ├── beach_lm_grass.png
│ │ ├── beach_rm_grass.png
│ │ ├── beach_tl_grass.png
│ │ ├── beach_tld_grass.png
│ │ ├── beach_tm_grass.png
│ │ ├── beach_tr_grass.png
│ │ ├── beach_trd_grass.png
│ │ ├── grass.png
│ │ ├── sand.png
│ │ └── water.jpeg
│ └── vishwamitra
│ │ ├── idle_1.png
│ │ ├── idle_2.png
│ │ ├── idle_3.png
│ │ ├── idle_4.png
│ │ ├── idle_5.png
│ │ ├── idle_6.png
│ │ ├── idle_7.png
│ │ └── idle_8.png
├── shadow-cljs.png
└── splash.png
├── babel.config.js
├── eas-build-pre-install.sh
├── etc
├── metro-bundler.patch
└── toolchain-report
├── externs
└── app.txt
├── index.js
├── package-lock.json
├── package.json
├── rn-rf-shadow.png
├── shadow-cljs.edn
└── src
└── main
├── example
├── app.cljs
├── components.cljs
├── constants.cljs
├── db.cljs
├── engine.cljs
├── handlers.cljs
├── objects.cljs
├── render.cljs
├── subs.cljs
├── tiles.cljs
└── util.cljs
└── expo
└── root.cljs
/.clj-kondo/config.edn:
--------------------------------------------------------------------------------
1 | {:lint-as {reagent.core/with-let clojure.core/let}}
2 |
--------------------------------------------------------------------------------
/.clj-kondo/rewrite-clj/rewrite-clj/config.edn:
--------------------------------------------------------------------------------
1 | {:lint-as
2 | {rewrite-clj.zip/subedit-> clojure.core/->
3 | rewrite-clj.zip/subedit->> clojure.core/->>
4 | rewrite-clj.zip/edit-> clojure.core/->
5 | rewrite-clj.zip/edit->> clojure.core/->>}}
6 |
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 |
3 | github: [PEZ, bpringe]
4 | # patreon: # Replace with a single Patreon username
5 | # open_collective: # Replace with a single Open Collective username
6 | # ko_fi: # Replace with a single Ko-fi username
7 | # tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8 | # community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9 | # liberapay: # Replace with a single Liberapay username
10 | # issuehunt: # Replace with a single IssueHunt username
11 | # otechie: # Replace with a single Otechie username
12 | # custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/**/*
2 | .expo/*
3 | npm-debug.*
4 | *.jks
5 | *.p12
6 | *.key
7 | *.mobileprovision
8 | out/
9 | .shadow-cljs/
10 | .nrepl-port
11 | pom.xml
12 | .idea/
13 | *.iml
14 | app
15 | .cpcache
16 | /web-build
17 | .calva/output-window/
18 | .DS_Store
19 |
20 | .lsp/.cache
21 | .clj-kondo/.cache
22 | .lsp/sqlite.db
23 |
--------------------------------------------------------------------------------
/.run/REPL.run.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "calva.replConnectSequences": [
3 | {
4 | "projectType": "shadow-cljs",
5 | "projectRootPath": ["."],
6 | "autoSelectForJackIn": true,
7 | "cljsType": "shadow-cljs",
8 | "name": "Hello RN Shadow",
9 | "menuSelections": {
10 | "cljsDefaultBuild": "app",
11 | "cljsLaunchBuilds": ["app"]
12 | }
13 | }
14 | ]
15 | }
--------------------------------------------------------------------------------
/.vscode/tasks.json:
--------------------------------------------------------------------------------
1 | {
2 | // See https://go.microsoft.com/fwlink/?LinkId=733558
3 | // for the documentation about the tasks.json format
4 | "version": "2.0.0",
5 | "tasks": [
6 | {
7 | "label": "Start Expo",
8 | "type": "npm",
9 | "script": "start",
10 | "problemMatcher": [],
11 | "group": {
12 | "kind": "build",
13 | "isDefault": true
14 | }
15 | },
16 | {
17 | "label": "Start App in Web Browser",
18 | "type": "npm",
19 | "script": "web",
20 | "problemMatcher": []
21 | },
22 | {
23 | "label": "CLJS Release Build",
24 | "type": "npm",
25 | "script": "release",
26 | "problemMatcher": []
27 | }
28 | ]
29 | }
--------------------------------------------------------------------------------
/.watchmanconfig:
--------------------------------------------------------------------------------
1 | {}
2 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2024 Divyansh Prakash
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Simple RPG game setup using ClojureScript + React Native + Expo
2 |
3 | Re-made using [this](https://github.com/PEZ/rn-rf-shadow) awesome template.
4 |
5 | https://gist.github.com/assets/3773773/f8ecbc67-4b04-4468-aa9f-e786d9f64177
6 |
7 | ## Installing
8 |
9 | This project is developed on node 20 - use [nvm](https://github.com/nvm-sh/nvm) to install it.
10 |
11 | - `nvm install 20.6.1`
12 | - `nvm use 20`
13 |
14 | To install dependencies, and setup the project, run:
15 |
16 | - `npm i`
17 |
18 | From there use your favorite editor and/or the prompt.
19 |
20 | ## Using VS Code + Calva
21 |
22 | Assuming you have installed the [Calva](https://calva.io) extension in VS Code:
23 |
24 | ### Build and start the app, and connect Calva
25 |
26 | 1. Open the project in VS Code. Then:
27 | 1. Run the Calva command **Start a Project REPL and Connect (aka Jack-in)**
28 | 1. Wait for shadow to build the project.
29 |
30 | ### Start Expo
31 |
32 | 1. Then **Run Build Task**. This will start Expo and the Metro
33 | bundler. Wait for expo to show its menu options in the terminal pane.
34 | 1. In the expo menu press w for **open web**.
35 |
36 | The app now should be running in your web browser and Calva automatically connects to it. Confirm this by evaluating something like this in Calva (from a cljs file or in the REPL window):
37 |
38 | ``` clojure
39 | (js/alert "Hello world!")
40 | ```
41 |
42 | You should see the alert pop up where the app is running.
43 |
44 | Of course you should try to fire up the app on all simulators, emulators and phones you have as well. Please note that Calva will only be connected to one of your apps at a time, and it is a bit arbitrary which one. Use `(js/alert)` to check this.
45 |
46 | ## Using Emacs with CIDER
47 |
48 | Open Emacs and a bash shell:
49 |
50 | 1. Run `npx shadow-cljs compile :app` to perform an initial build of the app.
51 | 1. In Emacs open one of the files in the project (`deps.edn` is fine)
52 | 1. From that buffer, do `cider-jack-in-clojurescript` [C-c M-J] to
53 | launch a REPL. Follow the series of interactive prompts in the
54 | minibuffer:
55 | 1. select `shadow-cljs` as the command to launch
56 | 1. select `shadow` as the repl type
57 | 1. select `:app` as the build to connect
58 | 1. and optionally answer `y` or `n` to the final question about
59 | opening the `shadow-cljs` UI in a browser.
60 | At this point `shadow-cljs` will be watching the project folder and
61 | running new builds of the app if any files are changed. You'll also
62 | have a REPL prompt, *however the REPL doesn't work because it isn't
63 | connected to anything. The app isn't running yet.*
64 | 1. In a shell run `npm run ios` (same as `npx expo start -i`). This starts
65 | the Metro bundler, perform the bundling, launch the iPhone
66 | simulator, and transmit the bundled app. Be patient at this step as
67 | it can take many seconds to complete. When the app is finally
68 | running expo will display the message:
69 |
70 | WebSocket connected!
71 | REPL init successful
72 | 1. Once you see that the REPL is initalized, you can return to Emacs
73 | and confirm the REPL is connected and functional:
74 | ``` clojure
75 | cljs.user> (js/alert "hello world!")
76 | ```
77 | Which should pop-up a modal alert in the simulator, confirming the
78 | app is running and the REPL is connected end to end.
79 |
80 | ## Using IntelliJ + Cursive REPL
81 |
82 | 1. Follow the instructions specified in [Or the Command line](#or-the-command-line).
83 | 2. Create a Maven POM using `shadow-cljs pom`, as described in the [Shadow doc](https://shadow-cljs.github.io/docs/UsersGuide.html#_cursive).
84 | 3. There are now two options
85 | 1. If you already have a project open, open the project in IntelliJ using _File | New | Project from existing sources..._ and indicating the `pom.xml` file.
86 | 2. If you're at the welcome screen, press the "Open" button and navigate to the `pom.xml`.
87 | 5. Ensure the project has an SDK configured using _File | Project Structure_, and checking under `Project`.
88 | 7. The project comes with a REPL run configuration called "REPL". Run the REPL using the _Run | Run 'REPL'_ menu item, or the toolbar button.
89 | 8. Run the commands in [Using ClojureScript REPL](#using-clojurescript-repl)
90 |
91 | ## Or the Command line
92 | ```sh
93 | $ npm i
94 | $ npx shadow-cljs watch app
95 | # wait for first compile to finish or expo gets confused
96 | # on another terminal tab/window:
97 | $ npm start
98 | ```
99 | This will run Expo DevTools at http://localhost:19002/
100 |
101 | To run the app in browser using expo-web (react-native-web), press `w` in the same terminal after expo devtools is started.
102 | This should open the app automatically on your browser after the web version is built. If it does not open automatically, open http://localhost:19006/ manually on your browser.
103 |
104 | Note that you can also run the following instead of `npm start` to run the app in browser:
105 | ```
106 | # same as npx expo start --web
107 | $ npm run web
108 |
109 | # or
110 |
111 | # same as npx expo start --web-only
112 | $ npm run web-only
113 | ```
114 |
115 | ### Using ClojureScript REPL
116 | Once the app is deployed and opened in phone/simulator/emulator/browser, connect to nrepl and run the following:
117 |
118 | ```clojure
119 | (shadow/nrepl-select :app)
120 | ```
121 |
122 | NB: _Calva users don't need to do ^ this ^._
123 |
124 | To test the REPL connection:
125 |
126 | ```clojure
127 | (js/alert "Hello from Repl")
128 | ```
129 |
130 | ### Command line CLJS REPL
131 |
132 | Shadow can start a CLJS repl for you, if you prefer to stay at the terminal prompt:
133 |
134 | ```bash
135 | $ npx shadow-cljs cljs-repl :app
136 | ```
137 |
138 | ## Disabling Expo Fast Refresh
139 |
140 | You will need to disable **Fast Refresh** provided by the Expo client, which conflicts with shadow-cljs hot reloading. You really want to use Shadow's, because it is way better and way faster than the Expo stuff is.
141 |
142 | For the iOS and Android there is a **Disable Fast Refresh** option in the [development menu](https://docs.expo.io/workflow/debugging/#developer-menu). NB: _Often you need to first enable it and then disable it._
143 |
144 | For web there may be some way to disable it via a `webpack.config` file as per [this example](https://docs.expo.dev/guides/customizing-webpack/#example). But failing that, once the app has loaded you can block requests to/from `localhost:19006/*` (the Webpack dev server) in devtools [like so](https://github.com/facebook/create-react-app/issues/2519#issuecomment-318867289), for instance by right-clicking on a request in the Network tab, selecting `Block request URL`, then editing the pattern. In Chrome this looks something like:
145 |
146 | 
147 | 
148 |
149 | This workaround is far from ideal, because the block needs to be manually toggled *off* whenever a full refresh is required (e.g. to load a new file), then back on again. But it seems to do the job.
150 |
151 | ## Production builds
152 |
153 | A production build involves first asking shadow-cljs to build a release, then to ask Expo to work in Production Mode.
154 |
155 | 1. Kill the watch and expo tasks.
156 | 1. Execute `shadow-cljs release app`
157 | 1. Start the expo task (as per above)
158 | 1. Enable Production mode.
159 | 1. Start the app.
160 |
161 | ### Using EAS Build
162 |
163 | `expo build` is the classic way of building an Expo app, and `eas build` is the new version of `expo build`. Using EAS Build currently requires an Expo account with a paid plan subscription.
164 |
165 | The steps below provide an example of using EAS Build to build an apk file to run on an Android emulator or device.
166 |
167 | 0. Install the latest EAS CLI by running `npm install -g eas-cli`
168 | 0. Log into your Expo account
169 | 0. Configure EAS Build in your project with `eas build:configure`.
170 | 0. Make your eas.json file contents look like this:
171 | ```json
172 | {
173 | "build": {
174 | "production": {},
175 | "development": {
176 | "distribution": "internal",
177 | "android": {
178 | "buildType": "apk"
179 | },
180 | "ios": {
181 | "simulator": true
182 | }
183 | }
184 | }
185 | }
186 | ```
187 | 0. Commit your changes, run `eas build --profile development`, and follow the prompts.
188 | 0. Navigate to the URL given by the command to monitor the build. When it completes, download the apk and install it on your device or emulator.
189 |
190 | See [the EAS Build docs](https://docs.expo.dev/build/introduction/) for more information.
191 |
192 | If you want to use EAS Build with a project not based on this template, see [this PR](https://github.com/PEZ/rn-rf-shadow/pull/24) for information about how your project can be set up to avoid an error during the build process.
193 |
194 | Note: The `eas-build-pre-install.sh` script makes EAS install Java in the MacOS environment when running a build for iOS. This ensures that shadow-cljs can be run in the EAS pipeline to build your ClojureScript code.
195 |
196 | ## Happy Hacking! ❤️
197 |
198 | Please don't hesitate to star the project repository.
199 |
200 | ## License
201 |
202 | [MIT](/LICENSE)
203 |
--------------------------------------------------------------------------------
/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "expo": {
3 | "name": "cljs-expo-game",
4 | "slug": "reagent-expo",
5 | "privacy": "public",
6 | "platforms": [
7 | "ios",
8 | "android",
9 | "web"
10 | ],
11 | "version": "1.0.0",
12 | "orientation": "portrait",
13 | "icon": "./assets/icon.png",
14 | "splash": {
15 | "image": "./assets/splash.png",
16 | "resizeMode": "contain",
17 | "backgroundColor": "#ffffff"
18 | },
19 | "updates": {
20 | "fallbackToCacheTimeout": 0
21 | },
22 | "assetBundlePatterns": [
23 | "**/*"
24 | ],
25 | "ios": {
26 | "supportsTablet": true
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/assets/cljs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/cljs.png
--------------------------------------------------------------------------------
/assets/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/icon.png
--------------------------------------------------------------------------------
/assets/icons/app.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/icons/app.png
--------------------------------------------------------------------------------
/assets/icons/loading.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/icons/loading.png
--------------------------------------------------------------------------------
/assets/images/arrow/arrow_down.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/arrow/arrow_down.png
--------------------------------------------------------------------------------
/assets/images/arrow/arrow_left.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/arrow/arrow_left.png
--------------------------------------------------------------------------------
/assets/images/arrow/arrow_right.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/arrow/arrow_right.png
--------------------------------------------------------------------------------
/assets/images/arrow/arrow_up.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/arrow/arrow_up.png
--------------------------------------------------------------------------------
/assets/images/bonfire/0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/bonfire/0.png
--------------------------------------------------------------------------------
/assets/images/bonfire/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/bonfire/1.png
--------------------------------------------------------------------------------
/assets/images/bonfire/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/bonfire/2.png
--------------------------------------------------------------------------------
/assets/images/bonfire/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/bonfire/3.png
--------------------------------------------------------------------------------
/assets/images/bonfire/4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/bonfire/4.png
--------------------------------------------------------------------------------
/assets/images/cljs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/cljs.png
--------------------------------------------------------------------------------
/assets/images/cljs@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/cljs@2x.png
--------------------------------------------------------------------------------
/assets/images/cljs@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/cljs@3x.png
--------------------------------------------------------------------------------
/assets/images/controls/dpad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/controls/dpad.png
--------------------------------------------------------------------------------
/assets/images/controls/dpad_down.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/controls/dpad_down.png
--------------------------------------------------------------------------------
/assets/images/controls/dpad_left.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/controls/dpad_left.png
--------------------------------------------------------------------------------
/assets/images/controls/dpad_right.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/controls/dpad_right.png
--------------------------------------------------------------------------------
/assets/images/controls/dpad_up.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/controls/dpad_up.png
--------------------------------------------------------------------------------
/assets/images/deer/run_down_0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/deer/run_down_0.png
--------------------------------------------------------------------------------
/assets/images/deer/run_down_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/deer/run_down_1.png
--------------------------------------------------------------------------------
/assets/images/deer/run_down_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/deer/run_down_2.png
--------------------------------------------------------------------------------
/assets/images/deer/run_down_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/deer/run_down_3.png
--------------------------------------------------------------------------------
/assets/images/deer/run_down_4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/deer/run_down_4.png
--------------------------------------------------------------------------------
/assets/images/deer/run_down_5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/deer/run_down_5.png
--------------------------------------------------------------------------------
/assets/images/deer/run_left_0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/deer/run_left_0.png
--------------------------------------------------------------------------------
/assets/images/deer/run_left_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/deer/run_left_1.png
--------------------------------------------------------------------------------
/assets/images/deer/run_left_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/deer/run_left_2.png
--------------------------------------------------------------------------------
/assets/images/deer/run_left_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/deer/run_left_3.png
--------------------------------------------------------------------------------
/assets/images/deer/run_left_4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/deer/run_left_4.png
--------------------------------------------------------------------------------
/assets/images/deer/run_left_5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/deer/run_left_5.png
--------------------------------------------------------------------------------
/assets/images/deer/run_right_0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/deer/run_right_0.png
--------------------------------------------------------------------------------
/assets/images/deer/run_right_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/deer/run_right_1.png
--------------------------------------------------------------------------------
/assets/images/deer/run_right_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/deer/run_right_2.png
--------------------------------------------------------------------------------
/assets/images/deer/run_right_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/deer/run_right_3.png
--------------------------------------------------------------------------------
/assets/images/deer/run_right_4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/deer/run_right_4.png
--------------------------------------------------------------------------------
/assets/images/deer/run_right_5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/deer/run_right_5.png
--------------------------------------------------------------------------------
/assets/images/deer/run_up_0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/deer/run_up_0.png
--------------------------------------------------------------------------------
/assets/images/deer/run_up_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/deer/run_up_1.png
--------------------------------------------------------------------------------
/assets/images/deer/run_up_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/deer/run_up_2.png
--------------------------------------------------------------------------------
/assets/images/deer/run_up_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/deer/run_up_3.png
--------------------------------------------------------------------------------
/assets/images/deer/run_up_4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/deer/run_up_4.png
--------------------------------------------------------------------------------
/assets/images/deer/run_up_5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/deer/run_up_5.png
--------------------------------------------------------------------------------
/assets/images/lakshmana/walk_down_0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/lakshmana/walk_down_0.png
--------------------------------------------------------------------------------
/assets/images/lakshmana/walk_down_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/lakshmana/walk_down_1.png
--------------------------------------------------------------------------------
/assets/images/lakshmana/walk_down_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/lakshmana/walk_down_2.png
--------------------------------------------------------------------------------
/assets/images/lakshmana/walk_down_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/lakshmana/walk_down_3.png
--------------------------------------------------------------------------------
/assets/images/lakshmana/walk_down_4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/lakshmana/walk_down_4.png
--------------------------------------------------------------------------------
/assets/images/lakshmana/walk_down_5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/lakshmana/walk_down_5.png
--------------------------------------------------------------------------------
/assets/images/lakshmana/walk_down_6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/lakshmana/walk_down_6.png
--------------------------------------------------------------------------------
/assets/images/lakshmana/walk_down_7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/lakshmana/walk_down_7.png
--------------------------------------------------------------------------------
/assets/images/lakshmana/walk_down_8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/lakshmana/walk_down_8.png
--------------------------------------------------------------------------------
/assets/images/lakshmana/walk_left_0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/lakshmana/walk_left_0.png
--------------------------------------------------------------------------------
/assets/images/lakshmana/walk_left_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/lakshmana/walk_left_1.png
--------------------------------------------------------------------------------
/assets/images/lakshmana/walk_left_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/lakshmana/walk_left_2.png
--------------------------------------------------------------------------------
/assets/images/lakshmana/walk_left_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/lakshmana/walk_left_3.png
--------------------------------------------------------------------------------
/assets/images/lakshmana/walk_left_4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/lakshmana/walk_left_4.png
--------------------------------------------------------------------------------
/assets/images/lakshmana/walk_left_5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/lakshmana/walk_left_5.png
--------------------------------------------------------------------------------
/assets/images/lakshmana/walk_left_6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/lakshmana/walk_left_6.png
--------------------------------------------------------------------------------
/assets/images/lakshmana/walk_left_7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/lakshmana/walk_left_7.png
--------------------------------------------------------------------------------
/assets/images/lakshmana/walk_left_8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/lakshmana/walk_left_8.png
--------------------------------------------------------------------------------
/assets/images/lakshmana/walk_right_0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/lakshmana/walk_right_0.png
--------------------------------------------------------------------------------
/assets/images/lakshmana/walk_right_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/lakshmana/walk_right_1.png
--------------------------------------------------------------------------------
/assets/images/lakshmana/walk_right_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/lakshmana/walk_right_2.png
--------------------------------------------------------------------------------
/assets/images/lakshmana/walk_right_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/lakshmana/walk_right_3.png
--------------------------------------------------------------------------------
/assets/images/lakshmana/walk_right_4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/lakshmana/walk_right_4.png
--------------------------------------------------------------------------------
/assets/images/lakshmana/walk_right_5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/lakshmana/walk_right_5.png
--------------------------------------------------------------------------------
/assets/images/lakshmana/walk_right_6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/lakshmana/walk_right_6.png
--------------------------------------------------------------------------------
/assets/images/lakshmana/walk_right_7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/lakshmana/walk_right_7.png
--------------------------------------------------------------------------------
/assets/images/lakshmana/walk_right_8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/lakshmana/walk_right_8.png
--------------------------------------------------------------------------------
/assets/images/lakshmana/walk_up_0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/lakshmana/walk_up_0.png
--------------------------------------------------------------------------------
/assets/images/lakshmana/walk_up_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/lakshmana/walk_up_1.png
--------------------------------------------------------------------------------
/assets/images/lakshmana/walk_up_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/lakshmana/walk_up_2.png
--------------------------------------------------------------------------------
/assets/images/lakshmana/walk_up_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/lakshmana/walk_up_3.png
--------------------------------------------------------------------------------
/assets/images/lakshmana/walk_up_4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/lakshmana/walk_up_4.png
--------------------------------------------------------------------------------
/assets/images/lakshmana/walk_up_5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/lakshmana/walk_up_5.png
--------------------------------------------------------------------------------
/assets/images/lakshmana/walk_up_6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/lakshmana/walk_up_6.png
--------------------------------------------------------------------------------
/assets/images/lakshmana/walk_up_7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/lakshmana/walk_up_7.png
--------------------------------------------------------------------------------
/assets/images/lakshmana/walk_up_8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/lakshmana/walk_up_8.png
--------------------------------------------------------------------------------
/assets/images/objects/ScareCrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/objects/ScareCrow.png
--------------------------------------------------------------------------------
/assets/images/objects/bow_pickup.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/objects/bow_pickup.png
--------------------------------------------------------------------------------
/assets/images/objects/collision_area.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/objects/collision_area.png
--------------------------------------------------------------------------------
/assets/images/objects/hut.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/objects/hut.png
--------------------------------------------------------------------------------
/assets/images/rama/shoot_down_0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/shoot_down_0.png
--------------------------------------------------------------------------------
/assets/images/rama/shoot_down_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/shoot_down_1.png
--------------------------------------------------------------------------------
/assets/images/rama/shoot_down_10.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/shoot_down_10.png
--------------------------------------------------------------------------------
/assets/images/rama/shoot_down_11.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/shoot_down_11.png
--------------------------------------------------------------------------------
/assets/images/rama/shoot_down_12.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/shoot_down_12.png
--------------------------------------------------------------------------------
/assets/images/rama/shoot_down_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/shoot_down_2.png
--------------------------------------------------------------------------------
/assets/images/rama/shoot_down_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/shoot_down_3.png
--------------------------------------------------------------------------------
/assets/images/rama/shoot_down_4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/shoot_down_4.png
--------------------------------------------------------------------------------
/assets/images/rama/shoot_down_5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/shoot_down_5.png
--------------------------------------------------------------------------------
/assets/images/rama/shoot_down_6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/shoot_down_6.png
--------------------------------------------------------------------------------
/assets/images/rama/shoot_down_7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/shoot_down_7.png
--------------------------------------------------------------------------------
/assets/images/rama/shoot_down_8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/shoot_down_8.png
--------------------------------------------------------------------------------
/assets/images/rama/shoot_down_9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/shoot_down_9.png
--------------------------------------------------------------------------------
/assets/images/rama/shoot_left_0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/shoot_left_0.png
--------------------------------------------------------------------------------
/assets/images/rama/shoot_left_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/shoot_left_1.png
--------------------------------------------------------------------------------
/assets/images/rama/shoot_left_10.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/shoot_left_10.png
--------------------------------------------------------------------------------
/assets/images/rama/shoot_left_11.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/shoot_left_11.png
--------------------------------------------------------------------------------
/assets/images/rama/shoot_left_12.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/shoot_left_12.png
--------------------------------------------------------------------------------
/assets/images/rama/shoot_left_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/shoot_left_2.png
--------------------------------------------------------------------------------
/assets/images/rama/shoot_left_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/shoot_left_3.png
--------------------------------------------------------------------------------
/assets/images/rama/shoot_left_4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/shoot_left_4.png
--------------------------------------------------------------------------------
/assets/images/rama/shoot_left_5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/shoot_left_5.png
--------------------------------------------------------------------------------
/assets/images/rama/shoot_left_6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/shoot_left_6.png
--------------------------------------------------------------------------------
/assets/images/rama/shoot_left_7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/shoot_left_7.png
--------------------------------------------------------------------------------
/assets/images/rama/shoot_left_8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/shoot_left_8.png
--------------------------------------------------------------------------------
/assets/images/rama/shoot_left_9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/shoot_left_9.png
--------------------------------------------------------------------------------
/assets/images/rama/shoot_right_0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/shoot_right_0.png
--------------------------------------------------------------------------------
/assets/images/rama/shoot_right_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/shoot_right_1.png
--------------------------------------------------------------------------------
/assets/images/rama/shoot_right_10.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/shoot_right_10.png
--------------------------------------------------------------------------------
/assets/images/rama/shoot_right_11.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/shoot_right_11.png
--------------------------------------------------------------------------------
/assets/images/rama/shoot_right_12.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/shoot_right_12.png
--------------------------------------------------------------------------------
/assets/images/rama/shoot_right_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/shoot_right_2.png
--------------------------------------------------------------------------------
/assets/images/rama/shoot_right_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/shoot_right_3.png
--------------------------------------------------------------------------------
/assets/images/rama/shoot_right_4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/shoot_right_4.png
--------------------------------------------------------------------------------
/assets/images/rama/shoot_right_5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/shoot_right_5.png
--------------------------------------------------------------------------------
/assets/images/rama/shoot_right_6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/shoot_right_6.png
--------------------------------------------------------------------------------
/assets/images/rama/shoot_right_7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/shoot_right_7.png
--------------------------------------------------------------------------------
/assets/images/rama/shoot_right_8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/shoot_right_8.png
--------------------------------------------------------------------------------
/assets/images/rama/shoot_right_9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/shoot_right_9.png
--------------------------------------------------------------------------------
/assets/images/rama/shoot_up_0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/shoot_up_0.png
--------------------------------------------------------------------------------
/assets/images/rama/shoot_up_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/shoot_up_1.png
--------------------------------------------------------------------------------
/assets/images/rama/shoot_up_10.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/shoot_up_10.png
--------------------------------------------------------------------------------
/assets/images/rama/shoot_up_11.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/shoot_up_11.png
--------------------------------------------------------------------------------
/assets/images/rama/shoot_up_12.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/shoot_up_12.png
--------------------------------------------------------------------------------
/assets/images/rama/shoot_up_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/shoot_up_2.png
--------------------------------------------------------------------------------
/assets/images/rama/shoot_up_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/shoot_up_3.png
--------------------------------------------------------------------------------
/assets/images/rama/shoot_up_4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/shoot_up_4.png
--------------------------------------------------------------------------------
/assets/images/rama/shoot_up_5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/shoot_up_5.png
--------------------------------------------------------------------------------
/assets/images/rama/shoot_up_6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/shoot_up_6.png
--------------------------------------------------------------------------------
/assets/images/rama/shoot_up_7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/shoot_up_7.png
--------------------------------------------------------------------------------
/assets/images/rama/shoot_up_8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/shoot_up_8.png
--------------------------------------------------------------------------------
/assets/images/rama/shoot_up_9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/shoot_up_9.png
--------------------------------------------------------------------------------
/assets/images/rama/walk_down_0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/walk_down_0.png
--------------------------------------------------------------------------------
/assets/images/rama/walk_down_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/walk_down_1.png
--------------------------------------------------------------------------------
/assets/images/rama/walk_down_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/walk_down_2.png
--------------------------------------------------------------------------------
/assets/images/rama/walk_down_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/walk_down_3.png
--------------------------------------------------------------------------------
/assets/images/rama/walk_down_4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/walk_down_4.png
--------------------------------------------------------------------------------
/assets/images/rama/walk_down_5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/walk_down_5.png
--------------------------------------------------------------------------------
/assets/images/rama/walk_down_6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/walk_down_6.png
--------------------------------------------------------------------------------
/assets/images/rama/walk_down_7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/walk_down_7.png
--------------------------------------------------------------------------------
/assets/images/rama/walk_down_8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/walk_down_8.png
--------------------------------------------------------------------------------
/assets/images/rama/walk_left_0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/walk_left_0.png
--------------------------------------------------------------------------------
/assets/images/rama/walk_left_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/walk_left_1.png
--------------------------------------------------------------------------------
/assets/images/rama/walk_left_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/walk_left_2.png
--------------------------------------------------------------------------------
/assets/images/rama/walk_left_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/walk_left_3.png
--------------------------------------------------------------------------------
/assets/images/rama/walk_left_4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/walk_left_4.png
--------------------------------------------------------------------------------
/assets/images/rama/walk_left_5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/walk_left_5.png
--------------------------------------------------------------------------------
/assets/images/rama/walk_left_6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/walk_left_6.png
--------------------------------------------------------------------------------
/assets/images/rama/walk_left_7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/walk_left_7.png
--------------------------------------------------------------------------------
/assets/images/rama/walk_left_8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/walk_left_8.png
--------------------------------------------------------------------------------
/assets/images/rama/walk_right_0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/walk_right_0.png
--------------------------------------------------------------------------------
/assets/images/rama/walk_right_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/walk_right_1.png
--------------------------------------------------------------------------------
/assets/images/rama/walk_right_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/walk_right_2.png
--------------------------------------------------------------------------------
/assets/images/rama/walk_right_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/walk_right_3.png
--------------------------------------------------------------------------------
/assets/images/rama/walk_right_4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/walk_right_4.png
--------------------------------------------------------------------------------
/assets/images/rama/walk_right_5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/walk_right_5.png
--------------------------------------------------------------------------------
/assets/images/rama/walk_right_6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/walk_right_6.png
--------------------------------------------------------------------------------
/assets/images/rama/walk_right_7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/walk_right_7.png
--------------------------------------------------------------------------------
/assets/images/rama/walk_right_8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/walk_right_8.png
--------------------------------------------------------------------------------
/assets/images/rama/walk_up_0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/walk_up_0.png
--------------------------------------------------------------------------------
/assets/images/rama/walk_up_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/walk_up_1.png
--------------------------------------------------------------------------------
/assets/images/rama/walk_up_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/walk_up_2.png
--------------------------------------------------------------------------------
/assets/images/rama/walk_up_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/walk_up_3.png
--------------------------------------------------------------------------------
/assets/images/rama/walk_up_4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/walk_up_4.png
--------------------------------------------------------------------------------
/assets/images/rama/walk_up_5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/walk_up_5.png
--------------------------------------------------------------------------------
/assets/images/rama/walk_up_6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/walk_up_6.png
--------------------------------------------------------------------------------
/assets/images/rama/walk_up_7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/walk_up_7.png
--------------------------------------------------------------------------------
/assets/images/rama/walk_up_8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/rama/walk_up_8.png
--------------------------------------------------------------------------------
/assets/images/tadaka/walk_down_0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/tadaka/walk_down_0.png
--------------------------------------------------------------------------------
/assets/images/tadaka/walk_down_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/tadaka/walk_down_1.png
--------------------------------------------------------------------------------
/assets/images/tadaka/walk_down_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/tadaka/walk_down_2.png
--------------------------------------------------------------------------------
/assets/images/tadaka/walk_down_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/tadaka/walk_down_3.png
--------------------------------------------------------------------------------
/assets/images/tadaka/walk_left_0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/tadaka/walk_left_0.png
--------------------------------------------------------------------------------
/assets/images/tadaka/walk_left_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/tadaka/walk_left_1.png
--------------------------------------------------------------------------------
/assets/images/tadaka/walk_left_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/tadaka/walk_left_2.png
--------------------------------------------------------------------------------
/assets/images/tadaka/walk_left_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/tadaka/walk_left_3.png
--------------------------------------------------------------------------------
/assets/images/tadaka/walk_right_0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/tadaka/walk_right_0.png
--------------------------------------------------------------------------------
/assets/images/tadaka/walk_right_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/tadaka/walk_right_1.png
--------------------------------------------------------------------------------
/assets/images/tadaka/walk_right_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/tadaka/walk_right_2.png
--------------------------------------------------------------------------------
/assets/images/tadaka/walk_right_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/tadaka/walk_right_3.png
--------------------------------------------------------------------------------
/assets/images/tadaka/walk_up_0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/tadaka/walk_up_0.png
--------------------------------------------------------------------------------
/assets/images/tadaka/walk_up_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/tadaka/walk_up_1.png
--------------------------------------------------------------------------------
/assets/images/tadaka/walk_up_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/tadaka/walk_up_2.png
--------------------------------------------------------------------------------
/assets/images/tadaka/walk_up_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/tadaka/walk_up_3.png
--------------------------------------------------------------------------------
/assets/images/terrain/beach_bl_grass.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/terrain/beach_bl_grass.png
--------------------------------------------------------------------------------
/assets/images/terrain/beach_bm_grass.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/terrain/beach_bm_grass.png
--------------------------------------------------------------------------------
/assets/images/terrain/beach_br_grass.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/terrain/beach_br_grass.png
--------------------------------------------------------------------------------
/assets/images/terrain/beach_lm_grass.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/terrain/beach_lm_grass.png
--------------------------------------------------------------------------------
/assets/images/terrain/beach_rm_grass.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/terrain/beach_rm_grass.png
--------------------------------------------------------------------------------
/assets/images/terrain/beach_tl_grass.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/terrain/beach_tl_grass.png
--------------------------------------------------------------------------------
/assets/images/terrain/beach_tld_grass.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/terrain/beach_tld_grass.png
--------------------------------------------------------------------------------
/assets/images/terrain/beach_tm_grass.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/terrain/beach_tm_grass.png
--------------------------------------------------------------------------------
/assets/images/terrain/beach_tr_grass.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/terrain/beach_tr_grass.png
--------------------------------------------------------------------------------
/assets/images/terrain/beach_trd_grass.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/terrain/beach_trd_grass.png
--------------------------------------------------------------------------------
/assets/images/terrain/grass.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/terrain/grass.png
--------------------------------------------------------------------------------
/assets/images/terrain/sand.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/terrain/sand.png
--------------------------------------------------------------------------------
/assets/images/terrain/water.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/terrain/water.jpeg
--------------------------------------------------------------------------------
/assets/images/vishwamitra/idle_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/vishwamitra/idle_1.png
--------------------------------------------------------------------------------
/assets/images/vishwamitra/idle_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/vishwamitra/idle_2.png
--------------------------------------------------------------------------------
/assets/images/vishwamitra/idle_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/vishwamitra/idle_3.png
--------------------------------------------------------------------------------
/assets/images/vishwamitra/idle_4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/vishwamitra/idle_4.png
--------------------------------------------------------------------------------
/assets/images/vishwamitra/idle_5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/vishwamitra/idle_5.png
--------------------------------------------------------------------------------
/assets/images/vishwamitra/idle_6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/vishwamitra/idle_6.png
--------------------------------------------------------------------------------
/assets/images/vishwamitra/idle_7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/vishwamitra/idle_7.png
--------------------------------------------------------------------------------
/assets/images/vishwamitra/idle_8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/images/vishwamitra/idle_8.png
--------------------------------------------------------------------------------
/assets/shadow-cljs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/shadow-cljs.png
--------------------------------------------------------------------------------
/assets/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/assets/splash.png
--------------------------------------------------------------------------------
/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = function(api) {
2 | api.cache(true);
3 | return {
4 | presets: ['babel-preset-expo'],
5 | };
6 | };
--------------------------------------------------------------------------------
/eas-build-pre-install.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | # If the OS is MacOS, install Java so that the shadow-cljs build succeeds
4 | if [[ $OSTYPE == "darwin"* ]]; then
5 | brew install openjdk@11
6 | sudo ln -sfn /opt/homebrew/opt/openjdk@11/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-11.jdk || { echo 'Homebrew JDK 11 not found?' ; exit 1; }
7 | echo 'export PATH="/opt/homebrew/opt/openjdk@11/bin:$PATH"' >>~/.zshrc
8 | export CPPFLAGS="-I/opt/homebrew/opt/openjdk@11/include"
9 | fi
10 |
--------------------------------------------------------------------------------
/etc/metro-bundler.patch:
--------------------------------------------------------------------------------
1 | --- worker.js 2018-11-21 14:46:01.271844624 -0700
2 | +++ worker.js 2018-11-21 14:45:52.517615272 -0700
3 | @@ -218,7 +218,7 @@
4 | }
5 |
6 | if (!options.transformOptions.dev) {
7 | - plugins.push([constantFoldingPlugin, opts]);
8 | + // plugins.push([constantFoldingPlugin, opts]);
9 | plugins.push([inlinePlugin, opts]);
10 | }var _transformFromAstSync = transformFromAstSync(ast, "", {
11 | ast: true,
12 | babelrc: false,
13 |
--------------------------------------------------------------------------------
/etc/toolchain-report:
--------------------------------------------------------------------------------
1 | #!/Usr/bin/env joker
2 |
3 | ;; Usage: toolchain-report
4 | ;;
5 | ;; This tool queries a set of defined packages in your "toolchain" and
6 | ;; reports the versions of those packages in a map. There are no
7 | ;; command line flags or options for this script.
8 |
9 | (ns main
10 | (:require [joker.os :as os]))
11 |
12 |
13 | ;; The "toolchain" is defined as a vector of maps that define how to
14 | ;; query for version. We expect every tool has some command line flag
15 | ;; that writes the version info to stdout or stderr, but each tool
16 | ;; might format that output in some unique way. Therefore we specify a
17 | ;; regular expression pattern that will be used to extract the version
18 | ;; from the output.
19 | ;;
20 | ;; Easiest to show an example:
21 | ;;
22 | ;; {
23 | ;; :key :yarn ; each tool has a unique key
24 | ;; :cmd ["yarn" "-v"] ; executing this prints the version
25 | ;; :pattern #"(.*)\n" ; this regexp extracts the version #
26 | ;; :output :out ; :out = stdout, :err = stderr
27 | ;; }
28 | ;;
29 | ;; The default is to grab everything from stdout up to the first
30 | ;; newline '\n', so our example can be shortened:
31 | ;;
32 | ;; {:key :yarn :cmd ["yarn" "-v"]}
33 | ;;
34 |
35 | (def toolchain
36 | [
37 | ;; operating system
38 | {:key :os-name
39 | :cmd ["clojure" "-e" "(System/getProperty \"os.name\")"]
40 | :pattern #"\"(.*)\""}
41 | {:key :os-version
42 | :cmd ["clojure" "-e" "(System/getProperty \"os.version\")"]
43 | :pattern #"\"(.*)\""}
44 | {:key :todays-date
45 | :cmd ["clojure" "-e" "(.toString (java.time.LocalDate/now))"]}
46 |
47 | ;; clojure/clojurescript tools
48 | {:key :clojure
49 | :cmd ["clj" "-Stree"]
50 | :pattern #"org.clojure/clojure\s+(.*)\n"}
51 | {:key :clojurescript
52 | :cmd ["clj" "-Stree"]
53 | :pattern #"org.clojure/clojurescript\s+(.*)\n"}
54 | {:key :shadow-cljs-jar
55 | :cmd ["shadow-cljs" "info"]
56 | :pattern #"jar:\s+(.*)\n"}
57 | {:key :shadow-cljs-cli
58 | :cmd ["shadow-cljs" "info"]
59 | :pattern #"cli:\s+(.*)\n"}
60 |
61 | ;; react native toolchain
62 | {:key :expo-cli :cmd ["expo-cli" "-V"]}
63 |
64 | ;; javascript tools
65 | {:key :node :cmd ["node" "-v"]}
66 | {:key :yarn :cmd ["yarn" "-v"]}
67 |
68 | ;; libraries / packages
69 | {:key :expo-js
70 | :cmd ["yarn" "list"]
71 | :pattern #"\s+expo@(.*)\n"}
72 | {:key :react
73 | :cmd ["yarn" "list"]
74 | :pattern #"\s+react@(.*)\n"}
75 | {:key :react-native
76 | :cmd ["yarn" "list"]
77 | :pattern #"\s+react-native@(.*)\n"}
78 | {:key :reagent
79 | :cmd ["clj" "-Stree"]
80 | :pattern #"reagent/reagent\s+(.*)\n"}
81 | {:key :re-frame
82 | :cmd ["clj" "-Stree"]
83 | :pattern #"re-frame/re-frame\s+(.*)\n"}
84 |
85 | ;; java jdk
86 | {:key :jdk-vendor
87 | :cmd ["java" "-version"]
88 | :output :err
89 | :pattern #"(.*)\s+version"}
90 | {:key :jdk-version
91 | :cmd ["java" "-version"]
92 | :output :err
93 | :pattern #"version\s+\"(.*)\"\n"}
94 | ])
95 |
96 | (def sh-memoized (memoize #(apply os/sh %)))
97 |
98 | (defn check [{:keys [key cmd output pattern]
99 | :or {output :out pattern #"(.*)\n"}}]
100 | (let [result (try (sh-memoized cmd)
101 | (catch Error e {:success nil}))]
102 | (if (:success result)
103 | {key (-> (re-find pattern (output result))
104 | (get 1))}
105 | {key nil})))
106 |
107 | (defn print-sorted-keys [m]
108 | ;; hack because joker doesn't provide sorted-map
109 | (println "{")
110 | (doseq [k (sort (keys m))]
111 | (printf " %s \"%s\"\n" k (k m)))
112 | (println "}"))
113 |
114 | ;; run all queries and print the result
115 | (print-sorted-keys (->> (map check toolchain)
116 | (apply merge)))
117 |
118 |
--------------------------------------------------------------------------------
/externs/app.txt:
--------------------------------------------------------------------------------
1 | # fulcro doesn't properly type hint these since they are usually covered
2 | # by react externs. we are not processing any JS however so those are missing
3 | render
4 | props
5 | state
--------------------------------------------------------------------------------
/index.js:
--------------------------------------------------------------------------------
1 | import './app/index.js';
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "scripts": {
3 | "server": "npx shadow-cljs server",
4 | "start": "npx expo start",
5 | "android": "npx expo start --android",
6 | "ios": "npx expo start --ios",
7 | "web": "npx expo start --web",
8 | "web-only": "npx expo start --web-only",
9 | "release": "npx shadow-cljs release app",
10 | "eject": "npx expo eject",
11 | "eas-build-pre-install": "bash eas-build-pre-install.sh",
12 | "eas-build-post-install": "npx shadow-cljs release app"
13 | },
14 | "dependencies": {
15 | "create-react-class": "15.7.0",
16 | "expo": "50.0.17",
17 | "react": "18.2.0",
18 | "react-dom": "18.2.0",
19 | "react-native": "0.73.6",
20 | "react-native-web": "0.19.6",
21 | "react-native-display": "1.0.8",
22 | "@expo/metro-runtime": "~3.1.3"
23 | },
24 | "devDependencies": {
25 | "shadow-cljs": "^2.23.3"
26 | },
27 | "private": true
28 | }
29 |
--------------------------------------------------------------------------------
/rn-rf-shadow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/divs1210/cljs-expo-game/824673975c517522e2b19f373e362e3c337d4001/rn-rf-shadow.png
--------------------------------------------------------------------------------
/shadow-cljs.edn:
--------------------------------------------------------------------------------
1 | {:source-paths ["src/main"
2 | "src/test"]
3 |
4 | :dependencies [[reagent "1.2.0"]
5 | [re-frame "1.3.0"]
6 | [binaryage/oops "0.7.0"]]
7 |
8 | :builds {:app {:target :react-native
9 | :init-fn example.app/init
10 | :output-dir "app"
11 | :compiler-options {:infer-externs :auto}
12 | :devtools {:autoload true}}}}
--------------------------------------------------------------------------------
/src/main/example/app.cljs:
--------------------------------------------------------------------------------
1 | (ns example.app
2 | (:require [reagent.core :as r]
3 | [re-frame.core :as rf]
4 | [expo.root :as expo-root]
5 | [example.render :refer [game]]
6 | [example.handlers]
7 | [example.subs]
8 | [example.util :refer [evt>]]
9 | [example.constants :as k]))
10 |
11 | #_(when js/__DEV__
12 | (require '["react-native" :as rn])
13 | (.setHotLoadingEnabled (.-DevSettings rn/NativeModules) false))
14 |
15 | (defn start
16 | {:dev/after-load true}
17 | []
18 | (expo-root/render-root (r/as-element [game])))
19 |
20 | (defn init []
21 | (rf/dispatch-sync [:initialize-db])
22 | (start)
23 | (js/setInterval #(evt> [:tick])
24 | k/FPS))
25 |
--------------------------------------------------------------------------------
/src/main/example/components.cljs:
--------------------------------------------------------------------------------
1 | (ns example.components
2 | (:require [reagent.core :as r]
3 | [example.constants :as k]))
4 |
5 | (def ReactNative (js/require "react-native"))
6 | (def RNDisplay (js/require "react-native-display"))
7 |
8 | (def status-bar (r/adapt-react-class (.-StatusBar ReactNative)))
9 | (def text (r/adapt-react-class (.-Text ReactNative)))
10 | (def view (r/adapt-react-class (.-View ReactNative)))
11 | (def image (r/adapt-react-class (.-Image ReactNative)))
12 | (def image-background (r/adapt-react-class (.-ImageBackground ReactNative)))
13 | (def touchable-highlight (r/adapt-react-class (.-TouchableHighlight ReactNative)))
14 | (def display (r/adapt-react-class (.-default RNDisplay)))
15 |
16 | (def expo (js/require "expo"))
17 | (def AtExpo (js/require "@expo/vector-icons"))
18 | (def ionicons (.-Ionicons AtExpo))
19 | (def ion-icon (r/adapt-react-class ionicons))
20 |
21 | (defn alert [text]
22 | (.alert (.-Alert ReactNative) text))
23 |
24 | (defn sprite
25 | [{:keys [tile-index curr-state curr-dir curr-frame style]}]
26 | (let [curr-tiles (get-in tile-index [curr-state curr-dir :frames])
27 |
28 | curr-frame (if (< curr-frame (count curr-tiles))
29 | curr-frame
30 | 0)
31 |
32 | {:keys [top left width height rot]} style
33 |
34 | rot (or rot 0)]
35 | (if (= "android" k/OS)
36 | [view
37 | {:style {:position :absolute
38 | :top top
39 | :left left
40 | :width width
41 | :height height}}
42 | (for [[state dirs-map] tile-index
43 | [dir tiles-map] dirs-map
44 | :let [first-tile (-> tiles-map :frames first)
45 | show? (and (zero? curr-frame)
46 | (= curr-state state)
47 | (= curr-dir dir))]]
48 | ^{:key (hash [state dir])}
49 | [image
50 | {:source first-tile
51 | :style {:position :absolute
52 | :top 0
53 | :left 0
54 | :width width
55 | :height height
56 | :opacity (if show? 1 0.05)
57 | :resize-mode :stretch
58 | :transform [{:rotate (str rot "deg")}]}}])
59 | (for [[i tile] (map-indexed vector curr-tiles)
60 | :let [show? (= curr-frame i)]]
61 | ^{:key i}
62 | [image
63 | {:source tile
64 | :style {:position :absolute
65 | :top 0
66 | :left 0
67 | :width width
68 | :height height
69 | :opacity (if show? 1 0)
70 | :resize-mode :stretch
71 | :transform [{:rotate (str rot "deg")}]}}])]
72 | ;; iOS
73 | [image
74 | {:source (nth curr-tiles curr-frame)
75 | :style {:position :absolute
76 | :top top
77 | :left left
78 | :width width
79 | :height height
80 | :resize-mode :stretch
81 | :transform [{:rotate (str rot "deg")}]}}])))
82 |
--------------------------------------------------------------------------------
/src/main/example/constants.cljs:
--------------------------------------------------------------------------------
1 | (ns example.constants)
2 |
3 | (defonce ReactNative (js/require "react-native"))
4 | (defonce Platform (.-Platform ReactNative))
5 | (defonce Dimensions (.-Dimensions ReactNative))
6 |
7 | (defonce ^:const OS
8 | (.-OS Platform))
9 |
10 | (defonce ^:const RES
11 | [(-> Dimensions (.get "window") .-width)
12 | (-> Dimensions (.get "window") .-height)])
13 |
14 | (defonce ^:const GRID-SIZE
15 | [15 6])
16 |
17 | (defonce ^:const TILE-WIDTH
18 | (int (/ (RES 0) (GRID-SIZE 1))))
19 |
20 | (defonce ^:const TILE-HEIGHT
21 | (int (/ (RES 1) (GRID-SIZE 0))))
22 |
23 | (defonce ^:const CONTROLS-Y
24 | (* TILE-HEIGHT 11))
25 |
26 | (defonce ^:const CONTROLS-HEIGHT
27 | (- (RES 1) CONTROLS-Y))
28 |
29 | (defonce ^:const FRADIUS 50)
30 |
31 | (defonce ^:const FPS
32 | (/ 1000 30)) ;; 30 FPS
33 |
34 | (defonce ^:const TICK-MS
35 | (/ 1000 FPS))
36 |
37 | (defonce ^:const DPAD-POS
38 | [(* 0.2 TILE-WIDTH) 0])
39 |
40 | (defonce ^:const DPAD-WIDTH
41 | (* (RES 0) 0.4))
42 |
43 | (defonce ^:const DPAD-HEIGHT
44 | DPAD-WIDTH)
45 |
46 | (defonce ^:const SHOOT-BTN-POS
47 | [(* (RES 0) 0.5)
48 | (* (RES 1) 0.09)])
49 |
50 | (defonce ^:const MANTRA-BTN-POS
51 | [(* 1.3 (SHOOT-BTN-POS 0))
52 | (* 0.4 (SHOOT-BTN-POS 1))])
53 |
54 | (defonce ^:const SHOOT-BTN-WIDTH
55 | (* FRADIUS 1.2))
56 |
57 | (defonce ^:const SHOOT-BTN-HEIGHT
58 | (* FRADIUS 1.2))
59 |
60 | (defonce ^:const WALK-VEL
61 | [(/ TILE-WIDTH 14) (/ TILE-HEIGHT 14)])
62 |
63 | (defonce ^:const ARROW-VEL
64 | [(/ TILE-WIDTH 3) (/ TILE-HEIGHT 3)])
65 |
--------------------------------------------------------------------------------
/src/main/example/db.cljs:
--------------------------------------------------------------------------------
1 | (ns example.db
2 | (:require [clojure.spec.alpha :as s]
3 | [example.tiles :as tiles]
4 | [example.objects :as o]
5 | [example.constants :as k]))
6 |
7 | ;; spec of app-db
8 | (s/def ::app-db map?)
9 |
10 | ;; initial state of app-db
11 | (def app-db
12 | {:sprites {:rama {:idle {:up {:frames tiles/rama-idle-up}
13 | :down {:frames tiles/rama-idle-down}
14 | :left {:frames tiles/rama-idle-left}
15 | :right {:frames tiles/rama-idle-right}}
16 | :walk {:up {:frames tiles/rama-walk-up}
17 | :down {:frames tiles/rama-walk-down}
18 | :left {:frames tiles/rama-walk-left}
19 | :right {:frames tiles/rama-walk-right}}
20 | :shoot {:up {:frames tiles/rama-shoot-up}
21 | :down {:frames tiles/rama-shoot-down}
22 | :left {:frames tiles/rama-shoot-left}
23 | :right {:frames tiles/rama-shoot-right}}}
24 | :vishwamitra {:idle {:down {:frames tiles/vishwamitra-idle}}}
25 | :lakshmana {:idle {:up {:frames tiles/lxmn-idle-up}
26 | :down {:frames tiles/lxmn-idle-down}
27 | :left {:frames tiles/lxmn-idle-left}
28 | :right {:frames tiles/lxmn-idle-right}}
29 | :walk {:up {:frames tiles/lxmn-walk-up}
30 | :down {:frames tiles/lxmn-walk-down}
31 | :left {:frames tiles/lxmn-walk-left}
32 | :right {:frames tiles/lxmn-walk-right}}}
33 | :tadaka {:idle {:up {:frames tiles/tadaka-idle-up}
34 | :down {:frames tiles/tadaka-idle-down}
35 | :left {:frames tiles/tadaka-idle-left}
36 | :right {:frames tiles/tadaka-idle-right}}
37 | :walk {:up {:frames tiles/tadaka-walk-up}
38 | :down {:frames tiles/tadaka-walk-down}
39 | :left {:frames tiles/tadaka-walk-left}
40 | :right {:frames tiles/tadaka-walk-right}}}
41 | :hut {:idle {:down {:frames tiles/hut}}}
42 | :bonfire {:idle {:down {:frames tiles/bonfire}}}
43 | :bow-pickup {:idle {:down {:frames tiles/bow-pickup}}}
44 | :scarecrow {:idle {:down {:frames tiles/scarecrow}}}
45 | :collision-area {:idle {:down {:frames tiles/collision-area}}}
46 | :arrow {:idle {:up {:frames tiles/arrow-up}
47 | :down {:frames tiles/arrow-down}
48 | :left {:frames tiles/arrow-left}
49 | :right {:frames tiles/arrow-right}}}
50 | :deer {:idle {:up {:frames tiles/deer-idle-up}
51 | :down {:frames tiles/deer-idle-down}}
52 | :run {:up {:frames tiles/deer-run-up}
53 | :down {:frames tiles/deer-run-down}
54 | :left {:frames tiles/deer-run-left}
55 | :right {:frames tiles/deer-run-right}}}
56 | :dpad {:idle {:down {:frames tiles/dpad-idle}}
57 | :press {:up {:frames tiles/dpad-up}
58 | :down {:frames tiles/dpad-down}
59 | :left {:frames tiles/dpad-left}
60 | :right {:frames tiles/dpad-right}}}
61 | :shoot-btn {:idle :gold
62 | :press :red}
63 | :mantra-btn {:idle :orange
64 | :press "#FF7C00"}}
65 | :objects {:rama (-> o/rama
66 | (assoc :pos [60 390]
67 | :dir :right))
68 | :lakshmana (assoc o/lakshmana
69 | :pos [45 405]
70 | :dir :right)
71 | :vishwamitra (assoc o/vishwamitra
72 | :pos [(- (first k/RES) k/TILE-WIDTH)
73 | (+ (/ k/TILE-HEIGHT 3)
74 | (* 1.05 (:height o/hut)))])
75 | :tadaka (assoc o/tadaka
76 | :pos [(-> k/RES first (- k/TILE-WIDTH)) 350]
77 | :dir :left
78 | :state :idle)
79 | :deer (assoc o/deer
80 | :pos [5 20]
81 | :dir :down
82 | :state :idle)
83 | :hut (assoc o/hut
84 | :pos [(- (first k/RES) k/TILE-WIDTH)
85 | (/ k/TILE-HEIGHT 3)])
86 | :bonfire (assoc o/bonfire
87 | :pos [(+ (- (first k/RES) k/TILE-WIDTH)
88 | (* 1.1 (:width o/bonfire)))
89 | (+ (/ k/TILE-HEIGHT 3)
90 | (* 1.5 (:height o/hut)))])}
91 | :inventory {:arrows 100}
92 | :text nil
93 | :fingers {}
94 | :controls {:dpad {:state :idle
95 | :dir :down}
96 | :shoot-btn {:state :idle
97 | :enabled? true}
98 | :mantra-btn {:state :idle
99 | :enabled? true}}
100 | :world (for [row (range 16)
101 | col (range 7)]
102 | {:pos [row col]
103 | :tile tiles/grass})})
104 |
--------------------------------------------------------------------------------
/src/main/example/engine.cljs:
--------------------------------------------------------------------------------
1 | (ns example.engine
2 | (:require [example.util :as u]
3 | [example.constants :as k]))
4 |
5 | (defn get-touches [db]
6 | (->> db :fingers vals (map :path) (map last)))
7 |
8 | (defn handle-dpad [db]
9 | (let [touches (get-touches db)
10 | [x y] k/DPAD-POS
11 | third-height (/ k/DPAD-HEIGHT 3)
12 | half-width (/ k/DPAD-WIDTH 2)
13 | up-box [x (+ y k/CONTROLS-Y) k/DPAD-WIDTH third-height]
14 | down-box [x (+ y k/CONTROLS-Y (* 2 third-height)) k/DPAD-WIDTH third-height]
15 | left-box [x (+ y k/CONTROLS-Y) half-width k/DPAD-HEIGHT]
16 | right-box [(+ x half-width) (+ y k/CONTROLS-Y) half-width k/DPAD-HEIGHT]]
17 | (cond
18 | (some #(u/box-contains? up-box %) touches)
19 | (assoc-in db [:controls :dpad] {:state :press
20 | :dir :up})
21 |
22 | (some #(u/box-contains? down-box %) touches)
23 | (assoc-in db [:controls :dpad] {:state :press
24 | :dir :down})
25 |
26 | (some #(u/box-contains? left-box %) touches)
27 | (assoc-in db [:controls :dpad] {:state :press
28 | :dir :left})
29 |
30 | (some #(u/box-contains? right-box %) touches)
31 | (assoc-in db [:controls :dpad] {:state :press
32 | :dir :right})
33 |
34 | :else
35 | (assoc-in db [:controls :dpad] {:state :idle
36 | :dir :down}))))
37 |
38 | (defn handle-shoot [db]
39 | (if (get-in db [:controls :shoot-btn :enabled?])
40 | (let [touches (get-touches db)
41 | [x y] k/SHOOT-BTN-POS
42 | btn-area [x (+ y k/CONTROLS-Y) k/SHOOT-BTN-WIDTH k/SHOOT-BTN-HEIGHT]]
43 | (if (some #(u/box-contains? btn-area %) touches)
44 | (assoc-in db [:controls :shoot-btn :state] :press)
45 | (assoc-in db [:controls :shoot-btn :state] :idle)))
46 | db))
47 |
48 | (defn handle-mantra [db]
49 | (if (get-in db [:controls :mantra-btn :enabled?])
50 | (let [touches (get-touches db)
51 | [x y] k/MANTRA-BTN-POS
52 | btn-area [x (+ y k/CONTROLS-Y) k/SHOOT-BTN-WIDTH k/SHOOT-BTN-HEIGHT]]
53 | (if (some #(u/box-contains? btn-area %) touches)
54 | (assoc-in db [:controls :mantra-btn :state] :press)
55 | (assoc-in db [:controls :mantra-btn :state] :idle)))
56 | db))
57 |
58 | (defn register-collisions! [db]
59 | (u/evt> [:clean-collisions])
60 | (doseq [obj1 (-> db :objects vals)
61 | col (-> obj1 :on-collide keys)
62 | obj2 (filter #(= col (:type %))
63 | (-> db
64 | :objects
65 | (dissoc (:id obj1))
66 | vals))
67 | :let [obj1-center-box (u/obj->center-box obj1)
68 | obj2-center-box (u/obj->center-box obj2)]
69 | :when (u/colliding? obj1-center-box obj2-center-box)
70 | :let [coll-dir (u/collision-dir (u/obj->box obj1)
71 | obj2-center-box)
72 | dir (if (= :center coll-dir)
73 | (case (:dir obj2)
74 | :up :bottom
75 | :down :top
76 | :left :right
77 | :right :left)
78 | coll-dir)]]
79 | (u/evt> [:register-collision obj1 obj2 dir]))
80 | db)
81 |
82 | (defn handle-collisions!
83 | [db]
84 | (doseq [[this-id objs] (:collisions db)
85 | [obj-id coll-dir] objs
86 | :let [this (get-in db [:objects this-id])
87 | obj (get-in db [:objects obj-id])]
88 | :when (and this obj)
89 | :let [methods (:on-collide this)
90 | method (methods (:type obj))]
91 | event (method db this obj coll-dir)]
92 | (u/evt> event))
93 | db)
94 |
95 | (defn handle-interactions [db]
96 | (-> db
97 | handle-dpad
98 | handle-shoot
99 | handle-mantra
100 | register-collisions!
101 | handle-collisions!))
102 |
103 | (defn update-state [db]
104 | (doseq [[id obj] (:objects db)
105 | :let [{:keys [on-update]} obj
106 | events (when on-update
107 | (on-update db obj))]
108 | event events]
109 | (u/evt> event))
110 | db)
111 |
112 | (defn next-frame [db]
113 | (let [{:keys [objects sprites]} db]
114 | (assoc db :objects
115 | (into {}
116 | (for [[id c] objects
117 | :let [{:keys [type state dir pos curr-frame]} c
118 | frames (get-in sprites [type state dir :frames])]]
119 | [id (update c :curr-frame #(mod (inc %) (count frames)))])))))
120 |
--------------------------------------------------------------------------------
/src/main/example/handlers.cljs:
--------------------------------------------------------------------------------
1 | (ns example.handlers
2 | (:require
3 | [re-frame.core :refer [reg-event-db ->interceptor]]
4 | [clojure.spec.alpha :as s]
5 | [example.constants :as k]
6 | [example.db :as db :refer [app-db]]
7 | [example.engine :as e]
8 | [example.util :as u]))
9 |
10 | ;; -- Interceptors ----------------------------------------------------------
11 | ;;
12 | ;; See https://github.com/Day8/re-frame/blob/develop/docs/Interceptors.md
13 | ;;
14 | (defn check-and-throw
15 | "Throw an exception if db doesn't have a valid spec."
16 | [spec db]
17 | (when-not (s/valid? spec db)
18 | (let [explain-data (s/explain-data spec db)]
19 | (throw (ex-info (str "Spec check failed: " explain-data) explain-data)))))
20 |
21 | (def validate-spec
22 | (if goog.DEBUG
23 | (->interceptor
24 | :id :validate-spec
25 | :after (fn [context]
26 | (let [db (-> context :effects :db)]
27 | (check-and-throw ::db/app-db db)
28 | context)))
29 | ->interceptor))
30 |
31 | ;; -- Handlers --------------------------------------------------------------
32 |
33 | (reg-event-db
34 | :initialize-db
35 | [validate-spec]
36 | (fn [_ _]
37 | app-db))
38 |
39 | (reg-event-db
40 | :no-op
41 | (fn [db _]
42 | db))
43 |
44 | (reg-event-db
45 | :set-in
46 | (fn [db [_ path val]]
47 | (assoc-in db path val)))
48 |
49 | (reg-event-db
50 | :update-in
51 | (fn [db [_ path f & args]]
52 | (update-in db path #(apply f % args))))
53 |
54 | (reg-event-db
55 | :tick
56 | (fn [db _]
57 | (-> db
58 | e/update-state
59 | e/handle-interactions
60 | e/next-frame)))
61 |
62 | (reg-event-db
63 | :add-finger
64 | (fn [db [_ {:keys [id pos]}]]
65 | (assoc-in db [:fingers id :path] [pos])))
66 |
67 | (reg-event-db
68 | :move-finger
69 | (fn [db [_ {:keys [id pos]}]]
70 | (update-in db [:fingers id :path] conj pos)))
71 |
72 | (reg-event-db
73 | :remove-finger
74 | (fn [db [_ {:keys [id]}]]
75 | (u/dissoc-in db [:fingers id])))
76 |
77 | (reg-event-db
78 | :clean-collisions
79 | (fn [db _]
80 | (assoc db :collisions {})))
81 |
82 | (reg-event-db
83 | :register-collision
84 | (fn [db [_ o1 o2 dir]]
85 | (assoc-in db [:collisions (:id o1) (:id o2)] dir)))
86 |
87 | (reg-event-db
88 | :set-text
89 | (fn [db [_ text]]
90 | (assoc db :text text)))
91 |
92 | (reg-event-db
93 | :clear-text
94 | (fn [db [_ id]]
95 | (if (= id (-> db :text :id))
96 | (assoc db :text nil)
97 | db)))
98 |
99 | (reg-event-db
100 | :add-to-inventory
101 | (fn [db [_ key val]]
102 | (assoc-in db [:objects :rama :inventory key] val)))
103 |
104 | (reg-event-db
105 | :add-object
106 | (fn [db [_ {:keys [id type] :as obj}]]
107 | (let [id (or id (gensym type))
108 | obj (assoc obj :id id)]
109 | (assoc-in db [:objects id] obj))))
110 |
111 | (reg-event-db
112 | :remove-object
113 | (fn [db [_ id]]
114 | (u/dissoc-in db [:objects id])))
115 |
116 | (reg-event-db
117 | :after-ms
118 | (fn [db [_ ms event]]
119 | (js/setTimeout #(u/evt> event) ms)
120 | db))
121 |
122 | (reg-event-db
123 | :uncollide
124 | (fn [db [_ this obj dir]]
125 | (let [[cx1 cy1 cw1 ch1] (u/obj->center-box this)
126 | [x2 y2 w2 h2 :as b] (u/obj->box obj)
127 | [cx2 cy2 cw2 ch2] (u/center-box b)
128 | [ncx2 ncy2] (case dir
129 | :top [cx2 (- cy1 ch2 5)]
130 | :bottom [cx2 (+ cy1 ch1 3)]
131 | :left [(- cx1 cw2 3) cy2]
132 | :right [(+ cx1 cw1 3) cy2])
133 | dx (- ncx2 cx2)
134 | dy (- ncy2 cy2)
135 | new-pos [(+ x2 dx) (+ y2 dy)]]
136 | (assoc-in db [:objects (:id obj) :pos] new-pos))))
137 |
138 | (reg-event-db
139 | :walk
140 | (fn [db [_ obj]]
141 | (let [id (:id obj)
142 | {:keys [dir pos walk-vel]} (-> db :objects id)
143 | [x y] pos
144 | [dx dy] (or walk-vel k/WALK-VEL)
145 | new-pos (case dir
146 | :left [(- x dx) y]
147 | :right [(+ x dx) y]
148 | :up [x (- y dy)]
149 | :down [x (+ y dy)]
150 | ;; else
151 | [x y])]
152 | (-> db
153 | (assoc-in [:objects id :state] :walk)
154 | (assoc-in [:objects id :pos] new-pos)))))
155 |
156 | (reg-event-db
157 | :retreat
158 | (fn [db [_ obj]]
159 | (let [id (:id obj)
160 | {:keys [dir pos walk-vel]} (-> db :objects id)
161 | [x y] pos
162 | [dx dy] (or walk-vel k/WALK-VEL)
163 | new-pos (case dir
164 | :right [(- x dx) y]
165 | :left [(+ x dx) y]
166 | :down [x (- y dy)]
167 | :up [x (+ y dy)]
168 | ;; else
169 | [x y])]
170 | (-> db
171 | (assoc-in [:objects id :state] :walk)
172 | (assoc-in [:objects id :pos] new-pos)))))
173 |
174 | (reg-event-db
175 | :freeze-for
176 | (fn [db [_ ms obj]]
177 | (let [curr (or (:frozen-for obj) 0)
178 | new (+ curr ms)]
179 | (assoc-in db [:objects (:id obj) :frozen-for] new))))
180 |
--------------------------------------------------------------------------------
/src/main/example/objects.cljs:
--------------------------------------------------------------------------------
1 | (ns example.objects
2 | (:require [example.constants :as k]
3 | [example.util :as u]))
4 |
5 | (def arrow
6 | {:type :arrow
7 | :pos [0 0]
8 | :state :idle
9 | :dir :down
10 | :dist 50
11 | :damage 10
12 | :curr-frame 0
13 | :on-update (fn [db this]
14 | (let [{:keys [id dir pos dist]} this
15 | [x y] pos
16 | [dx dy] k/ARROW-VEL
17 | new-pos (case dir
18 | :left [(- x dx) y]
19 | :right [(+ x dx) y]
20 | :up [x (- y dy)]
21 | :down [x (+ y dy)]
22 | ;; else
23 | [x y])]
24 | (if (zero? dist)
25 | [[:remove-object id]]
26 | [[:set-in [:objects id :pos] new-pos]
27 | [:set-in [:objects id :dist] (dec dist)]])))})
28 |
29 | (def rama
30 | {:id :rama
31 | :type :rama
32 | :pos [(* 4 k/TILE-WIDTH) (* 7 k/TILE-HEIGHT)]
33 | :state :idle
34 | :dir :up
35 | :hp 100
36 | :life 100
37 | :glow? false
38 | :glow-rate 0
39 | :curr-frame 0
40 | :on-update (fn [db this]
41 | (let [{:keys [pos dir curr-frame]} this
42 | shoot-btn-state (-> db :controls :shoot-btn :state)
43 | mantra-btn-state (-> db :controls :mantra-btn :state)
44 | {:keys [dpad-state dpad-dir]} (u/with-prefix (-> db :controls :dpad)
45 | :dpad)
46 | arrows (-> db :inventory :arrows)
47 | should-glow? (= :press mantra-btn-state)
48 | should-shoot? (and (= :press shoot-btn-state)
49 | (pos? arrows))
50 | should-walk? (= :press dpad-state)]
51 | (case [should-glow? (:glow? this)]
52 | [true false]
53 | [[:set-in [:objects :rama :glow?] true]
54 | [:set-in [:objects :rama :glow-rate] 0.1]]
55 |
56 | [true true]
57 | (if (< (:glow-rate this) 0.5)
58 | [[:update-in [:objects :rama :glow-rate] + 0.01]]
59 | [])
60 |
61 | [false true]
62 | [[:set-in [:objects :rama :glow?] false]]
63 |
64 | ;; default
65 | (cond
66 | should-shoot?
67 | (let [shoot-frames-count (-> db :sprites :rama :shoot :up :frames count)
68 | [x y w h] (u/obj->box this)
69 | aw (case dir
70 | :up (/ h 5)
71 | :down (/ h 5)
72 | :left (/ w 2)
73 | :right (/ w 2))
74 | ah (case dir
75 | :up (/ w 2)
76 | :down (/ w 2)
77 | :left (/ h 5)
78 | :right (/ h 5))
79 | [ax ay] (case dir
80 | :up [(- (+ x (/ w 2)) (/ aw 2)) (- (+ y (/ h 2)) (/ ah 2))]
81 | :down [(- (+ x (/ w 2)) (/ aw 2)) (+ y (/ h 2))]
82 | :left [(- (+ x (/ w 2)) aw) (+ y (/ h 3))]
83 | :right [(+ x (/ w 2)) (+ y (/ h 3))])
84 | release-arrow? (= (- shoot-frames-count 2)
85 | curr-frame)]
86 | (if release-arrow?
87 | [[:add-object (assoc arrow
88 | :pos [ax ay]
89 | :width aw
90 | :height ah
91 | :dir dir)]
92 | [:set-in [:inventory :arrows] (dec arrows)]]
93 | [[:set-in [:objects :rama :state] :shoot]]))
94 |
95 | should-walk?
96 | [[:set-in [:objects :rama :dir] dpad-dir]
97 | [:walk this]]
98 |
99 | (= :idle dpad-state)
100 | [[:set-in [:objects :rama :state] :idle]]))))})
101 |
102 | (def lakshmana
103 | {:id :lakshmana
104 | :type :lakshmana
105 | :pos [(* 4.5 k/TILE-WIDTH) (* 7.5 k/TILE-HEIGHT)]
106 | :state :idle
107 | :dir :up
108 | :inventory {}
109 | :curr-frame 0
110 | :on-update (fn [db this]
111 | (let [rama (get-in db [:objects :rama])
112 |
113 | {:keys [rama-state rama-pos rama-dir]}
114 | (u/with-prefix rama :rama)
115 |
116 | should-walk? (> (u/distance rama-pos (:pos this))
117 | (* 0.75 k/TILE-WIDTH))
118 |
119 | dir-to-rama (u/dir-to this rama)]
120 | (if should-walk?
121 | [[:set-in [:objects (:id this) :dir] dir-to-rama]
122 | [:walk this]]
123 | [[:set-in [:objects (:id this) :dir] (:dir rama)]
124 | [:set-in [:objects (:id this) :state] :idle]])))})
125 |
126 | (def vishwamitra
127 | {:id :vishwamitra
128 | :type :vishwamitra
129 | :pos [(* 2.4 k/TILE-WIDTH) (* 4.5 k/TILE-HEIGHT)]
130 | :width (* 0.6 k/TILE-WIDTH)
131 | :height (* 1.1 k/TILE-HEIGHT)
132 | :state :idle
133 | :dir :down
134 | :curr-frame 0
135 | :on-collide {:rama
136 | (fn [db this rama dir]
137 | (let [id (gensym)]
138 | [[:uncollide this rama dir]
139 | [:set-text {:id id
140 | :speaker "Rishi Vishwamitra"
141 | :speech "You are invading my personal space, Prince Rama!"}]
142 | [:after-ms 2000 [:clear-text id]]]))
143 |
144 | :arrow
145 | (fn [db this arrow _]
146 | (let [id (gensym)]
147 | [[:remove-object (:id arrow)]
148 | [:set-text {:speaker "Rishi Vishwamitra"
149 | :speech "Careful, son!"}]
150 | [:after-ms 2000 [:clear-text id]]]))}})
151 |
152 | (def tadaka
153 | {:id :tadaka
154 | :type :tadaka
155 | :pos [(* 4 k/TILE-WIDTH) (* 6 k/TILE-HEIGHT)]
156 | :walk-vel (map #(* 0.5 %) k/WALK-VEL)
157 | :width (* k/TILE-WIDTH 2)
158 | :height (* k/TILE-HEIGHT 2)
159 | :hp 500
160 | :life 500
161 | :state :idle
162 | :dir :left
163 | :curr-frame 0
164 | :frozen-for 0
165 | :on-collide {:rama
166 | (fn [db this rama dir]
167 | [[:uncollide this rama dir]
168 | [:retreat rama]
169 | [:retreat this]])
170 |
171 | :arrow
172 | (fn [db this arrow dir]
173 | [[:remove-object (:id arrow)]
174 | [:set-in [:objects (:id this) :life] (- (:life this)
175 | (:damage arrow))]
176 | [:retreat this]
177 | [:freeze-for 750 this]])}
178 | :on-update (fn [db this]
179 | (let [rama (-> db :objects :rama)
180 | dist-to-rama (u/distance (-> this u/obj->box u/center)
181 | (-> rama u/obj->box u/center))
182 | rama-in-range? (< dist-to-rama (* 0.5 (:width this)))
183 | dir-to-rama (u/dir-to this rama)
184 | frozen-for (:frozen-for this)]
185 | (cond
186 | (pos? frozen-for)
187 | [[:set-in [:objects (:id this) :state] :idle]
188 | [:update-in [:objects (:id this) :frozen-for] - k/TICK-MS]]
189 |
190 | (not= dir-to-rama (:dir this))
191 | [[:set-in [:objects (:id this) :state] :idle]
192 | [:after-ms 750
193 | [:set-in [:objects (:id this) :dir] dir-to-rama]]]
194 |
195 | rama-in-range?
196 | [[:set-in [:objects (:id this) :state] :idle]
197 | [:set-in [:objects (:id rama) :life] (- (:life rama) 1)]]
198 |
199 | (not rama-in-range?)
200 | [[:walk this]]
201 |
202 | :else
203 | [])))})
204 |
205 | (def hut
206 | {:id :hut
207 | :type :hut
208 | :pos [(* 0.8 k/TILE-WIDTH) (* 4.7 k/TILE-HEIGHT)]
209 | :width (* k/TILE-WIDTH 1.2)
210 | :height (* k/TILE-HEIGHT 1.3)
211 | :state :idle
212 | :dir :down
213 | :curr-frame 0
214 | :on-collide {:rama
215 | (fn [db this rama dir]
216 | [[:uncollide this rama dir]])
217 |
218 | :arrow
219 | (fn [db this arrow _]
220 | [[:remove-object (:id arrow)]])}})
221 |
222 | (def bonfire
223 | {:id :bonfire
224 | :type :bonfire
225 | :pos [(* 3.5 k/TILE-WIDTH) (* 5 k/TILE-HEIGHT)]
226 | :width (/ k/TILE-WIDTH 2)
227 | :height (/ k/TILE-HEIGHT 2)
228 | :state :idle
229 | :dir :down
230 | :curr-frame 0
231 | :on-collide {:rama
232 | (fn [db this rama dir]
233 | [[:uncollide this rama dir]])}})
234 |
235 | (def bow-pickup
236 | {:type :bow-pickup
237 | :pos [(* 2.4 k/TILE-WIDTH) (* 6 k/TILE-HEIGHT)]
238 | :rot 0
239 | :width (/ k/TILE-WIDTH 2)
240 | :height (/ k/TILE-HEIGHT 2)
241 | :state :idle
242 | :dir :down
243 | :curr-frame 0
244 | :on-collide {:rama
245 | (fn [db this rama _]
246 | [[:remove-object (:id this)]
247 | [:set-text {:speaker "Rishi Vishwamitra"
248 | :speech (str "Now shoot at the scarecrow.\n"
249 | "Long press to pull back the string and release an arrow.\n"
250 | "Try shooting from all directions.\n"
251 | "Once you are done, move over to the sacrificial fire.")}]
252 | [:add-to-inventory :bow {}]])}})
253 |
254 | (def deer
255 | {:id :deer
256 | :type :deer
257 | :pos [(- k/TILE-WIDTH) (* 10 k/TILE-HEIGHT)]
258 | :width (* k/TILE-WIDTH 0.8)
259 | :height (* k/TILE-HEIGHT 0.8)
260 | :state :run
261 | :dir :right
262 | :curr-frame 0
263 | :on-update (fn [db this]
264 | (let [rama (get-in db [:objects :rama])
265 | {:keys [id dir pos]} this
266 | new-pos (u/ahead-of this k/WALK-VEL)
267 | [rama-row rama-col] (u/obj->grid rama)
268 | [row col] (u/obj->grid this)]
269 | (cond
270 | (< col 0)
271 | [[:set-in [:objects id :pos] new-pos]
272 | [:set-in [:objects id :dir] :right]]
273 |
274 | (> col 5)
275 | [[:set-in [:objects id :pos] new-pos]
276 | [:set-in [:objects id :dir] :left]]
277 |
278 | (= col rama-col)
279 | (cond
280 | (< row rama-row)
281 | [[:set-in [:objects id :state] :idle]
282 | [:set-in [:objects id :dir] :down]]
283 |
284 | (>= row rama-row)
285 | [[:set-in [:objects id :state] :idle]
286 | [:set-in [:objects id :dir] :up]])
287 |
288 | (or (= :down dir)
289 | (= :up dir))
290 | [[:set-in [:objects id :state] :run]
291 | [:set-in [:objects id :dir] (rand-nth [:left :right])]]
292 |
293 | :else
294 | [[:set-in [:objects id :pos] new-pos]])))
295 | :on-collide {:rama
296 | (fn [db this rama dir]
297 | [[:uncollide this rama dir]])
298 |
299 | :arrow
300 | (fn [db this arrow _]
301 | (let [id (gensym)]
302 | [[:remove-object (:id arrow)]
303 | [:set-text {:id id
304 | :speaker "Rishi Vishwamitra"
305 | :speech "Hey, Rama!"}]
306 | [:after-ms 2000 [:clear-text id]]]))}})
307 |
308 | (def collision-area
309 | {:type :collision-area
310 | :pos [0 0]
311 | :state :idle
312 | :dir :down
313 | :width (* k/TILE-WIDTH 2)
314 | :height (* k/TILE-HEIGHT 2)
315 | :curr-frame 0
316 | :on-collide {}})
317 |
318 | (def scarecrow
319 | {:type :scarecrow
320 | :pos [(* 2.5 k/TILE-WIDTH) (* 8 k/TILE-HEIGHT)]
321 | :width (* k/TILE-WIDTH 0.8)
322 | :height (* k/TILE-HEIGHT 0.8)
323 | :state :idle
324 | :dir :down
325 | :curr-frame 0
326 | :on-collide {:rama
327 | (fn [db this rama dir]
328 | [[:uncollide this rama dir]])
329 |
330 | :arrow
331 | (fn [db this arrow _]
332 | (let [id (gensym)
333 | complement (rand-nth ["Good shot!"
334 | "Nice!"
335 | "Great aim!"])]
336 | [[:remove-object (:id arrow)]
337 | [:set-text {:id id
338 | :speaker "Rishi Vishwamitra"
339 | :speech complement}]
340 | [:after-ms 2000 [:clear-text id]]
341 | (if (get-in db [:logic :collision-area-set?])
342 | [:no-op]
343 | [:add-object (assoc collision-area
344 | :pos [(* 2.75 k/TILE-WIDTH)
345 | (* 4.2 k/TILE-HEIGHT)]
346 | :on-collide {:rama
347 | (fn [db this rama _]
348 | (let [id (gensym)]
349 | [[:remove-object (:id this)]
350 | [:set-text {:id id
351 | :speaker "Rishi Vishwamitra"
352 | :speech "AUUUUUUUUUMMMMMM!"}]
353 | [:after-ms 2000 [:clear-text id]]
354 | [:add-object deer]]))})])
355 | [:set-in [:logic :collision-area-set?] true]]))}})
356 |
--------------------------------------------------------------------------------
/src/main/example/render.cljs:
--------------------------------------------------------------------------------
1 | (ns example.render
2 | (:require [reagent.core :as r]
3 | [re-frame.core :as rf]
4 | [example.components :as com]
5 | [example.util :refer [] :as u]
6 | [example.tiles :as tiles]
7 | [cljs.pprint :refer [pprint]]
8 | [example.constants :as k]))
9 |
10 | (defn controls []
11 | (let [sprites @( [:initialize-db])}
80 | [com/text
81 | "RESET"]]]))
82 |
83 | (defn game []
84 | [com/view
85 | {:style {:flex 1
86 | :clickable true}
87 |
88 | :on-touch-start
89 | (fn [e]
90 | (let [e (.-nativeEvent e)]
91 | (evt> [:add-finger {:id (.-identifier e)
92 | :pos [(.-pageX e)
93 | (.-pageY e)]}])))
94 |
95 | :on-touch-move
96 | (fn [e]
97 | (let [e (.-nativeEvent e)]
98 | (evt> [:move-finger {:id (.-identifier e)
99 | :pos [(.-pageX e)
100 | (.-pageY e)]}])))
101 |
102 | :on-touch-end
103 | (fn [e]
104 | (let [e (.-nativeEvent e)]
105 | (evt> [:remove-finger {:id (.-identifier e)}])))}
106 |
107 | [com/status-bar
108 | {:hidden true}]
109 |
110 | (let [world @(box obj)]
135 | (+ y h)))
136 | objects)
137 | :let [{:keys [type rot state dir curr-frame]} object
138 | [x y width height] (u/obj->box object)]]
139 | ^{:key id}
140 | [com/sprite
141 | {:tile-index (sprites type)
142 | :curr-state state
143 | :curr-dir dir
144 | :curr-frame curr-frame
145 | :style {:top y
146 | :left x
147 | :width width
148 | :height height
149 | :rot rot}}])
150 |
151 | ;; render character healths
152 | (for [[id object] (->> objects
153 | (filter (fn [[_ obj]]
154 | (some? (:hp obj))))
155 | (sort-by (fn [[_ obj]]
156 | (let [[_ y _ h] (u/obj->box obj)]
157 | (+ y h)))))
158 | :let [{:keys [hp life]} object
159 | [x y width _] (u/obj->box object)
160 | bar-x (+ x (* 0.2 width))
161 | bar-y (- y 2)
162 | bar-width (* 0.6 width)]]
163 | ^{:key id}
164 | [com/view
165 | {:style {:top bar-y
166 | :left bar-x
167 | :width bar-width
168 | :height 5
169 | :border-width 1
170 | :border-color :black}}
171 | [com/view
172 | {:style {:top 0
173 | :left 0
174 | :width (if (pos? life)
175 | (* (- bar-width 2)
176 | (/ life hp))
177 | 0)
178 | :height 3
179 | :background-color :red}}]])
180 |
181 | ;; render glow
182 | (for [[id object] (->> objects
183 | (filter (fn [[_ obj]]
184 | (:glow? obj)))
185 | (sort-by (fn [[_ obj]]
186 | (let [[_ y _ h] (u/obj->box obj)]
187 | (+ y h)))))
188 | :let [[x y w h] (u/obj->box object)
189 | glow-rate (:glow-rate object)
190 | width (* w glow-rate 2)
191 | height (* h glow-rate 2)
192 | x' (+ x
193 | (/ w 2)
194 | (- (/ width 2)))
195 | y' (+ y
196 | (/ h 2)
197 | (- (/ height 2)))]]
198 | ^{:key id}
199 | [com/view
200 | {:style {:justify-content :center
201 | :align-items :center
202 | :border-radius (* k/FRADIUS 2)
203 | :border-width 2
204 | :border-color :orange
205 | :width width
206 | :height height
207 | :background-color :gold
208 | :position :absolute
209 | :opacity glow-rate
210 | :left x'
211 | :top y'}}])
212 |
213 | ;; render collision boxes
214 | #_(for [[id object] objects
215 | :let [[x y w h] (u/obj->center-box object)]]
216 | ^{:key id}
217 | [com/view
218 | {:style {:position :absolute
219 | :width w
220 | :height h
221 | :left x
222 | :top y
223 | :background-color "rgba(200, 0, 0, 0.3)"}}])
224 |
225 | ;; render speech
226 | (when-let [{:keys [speaker speech]} @( [:initialize-db])}
240 | [com/text
241 | {:style {:font-weight :bold
242 | :padding 2}}
243 | speaker]
244 | [com/text
245 | {:style {:text-align :center}}
246 | speech]])
247 |
248 | ;; render control panel
249 | [controls]])])
250 |
--------------------------------------------------------------------------------
/src/main/example/subs.cljs:
--------------------------------------------------------------------------------
1 | (ns example.subs
2 | (:require [re-frame.core :refer [reg-sub]]))
3 |
4 | (reg-sub
5 | :get-in
6 | (fn [app-db [_ path]]
7 | (get-in app-db path)))
8 |
--------------------------------------------------------------------------------
/src/main/example/tiles.cljs:
--------------------------------------------------------------------------------
1 | (ns example.tiles)
2 |
3 | ;; Terrain
4 | ;; =======
5 | (defonce water
6 | (js/require "../assets/images/terrain/water.jpeg"))
7 |
8 | (defonce grass
9 | (js/require "../assets/images/terrain/grass.png"))
10 |
11 | (defonce sand
12 | (js/require "../assets/images/terrain/sand.png"))
13 |
14 | ;; bottom left
15 | (defonce beach-bl-grass
16 | (js/require "../assets/images/terrain/beach_bl_grass.png"))
17 |
18 | ;; left middle
19 | (defonce beach-lm-grass
20 | (js/require "../assets/images/terrain/beach_lm_grass.png"))
21 |
22 | ;; bottom middle
23 | (defonce beach-bm-grass
24 | (js/require "../assets/images/terrain/beach_bm_grass.png"))
25 |
26 | ;; right middle
27 | (defonce beach-rm-grass
28 | (js/require "../assets/images/terrain/beach_rm_grass.png"))
29 |
30 | ;; bottom right
31 | (defonce beach-br-grass
32 | (js/require "../assets/images/terrain/beach_br_grass.png"))
33 |
34 | ;; top left
35 | (defonce beach-tl-grass
36 | (js/require "../assets/images/terrain/beach_tl_grass.png"))
37 |
38 | ;; top medium
39 | (defonce beach-tm-grass
40 | (js/require "../assets/images/terrain/beach_tm_grass.png"))
41 |
42 | ;; top right
43 | (defonce beach-tr-grass
44 | (js/require "../assets/images/terrain/beach_tr_grass.png"))
45 |
46 | ;; top left diagonal
47 | (defonce beach-tld-grass
48 | (js/require "../assets/images/terrain/beach_tld_grass.png"))
49 |
50 | ;; top right diagonal
51 | (defonce beach-trd-grass
52 | (js/require "../assets/images/terrain/beach_trd_grass.png"))
53 |
54 |
55 | ;; Rama
56 | ;; ====
57 | (defonce rama-idle-up
58 | [(js/require "../assets/images/rama/walk_up_0.png")])
59 |
60 | (defonce rama-idle-down
61 | [(js/require "../assets/images/rama/walk_down_0.png")])
62 |
63 | (defonce rama-idle-left
64 | [(js/require "../assets/images/rama/walk_left_0.png")])
65 |
66 | (defonce rama-idle-right
67 | [(js/require "../assets/images/rama/walk_right_0.png")])
68 |
69 | (defonce rama-walk-up
70 | [(js/require "../assets/images/rama/walk_up_0.png")
71 | (js/require "../assets/images/rama/walk_up_1.png")
72 | (js/require "../assets/images/rama/walk_up_2.png")
73 | (js/require "../assets/images/rama/walk_up_3.png")
74 | (js/require "../assets/images/rama/walk_up_4.png")
75 | (js/require "../assets/images/rama/walk_up_5.png")
76 | (js/require "../assets/images/rama/walk_up_6.png")
77 | (js/require "../assets/images/rama/walk_up_7.png")
78 | (js/require "../assets/images/rama/walk_up_8.png")])
79 |
80 | (defonce rama-walk-down
81 | [(js/require "../assets/images/rama/walk_down_0.png")
82 | (js/require "../assets/images/rama/walk_down_1.png")
83 | (js/require "../assets/images/rama/walk_down_2.png")
84 | (js/require "../assets/images/rama/walk_down_3.png")
85 | (js/require "../assets/images/rama/walk_down_4.png")
86 | (js/require "../assets/images/rama/walk_down_5.png")
87 | (js/require "../assets/images/rama/walk_down_6.png")
88 | (js/require "../assets/images/rama/walk_down_7.png")
89 | (js/require "../assets/images/rama/walk_down_8.png")])
90 |
91 | (defonce rama-walk-left
92 | [(js/require "../assets/images/rama/walk_left_0.png")
93 | (js/require "../assets/images/rama/walk_left_1.png")
94 | (js/require "../assets/images/rama/walk_left_2.png")
95 | (js/require "../assets/images/rama/walk_left_3.png")
96 | (js/require "../assets/images/rama/walk_left_4.png")
97 | (js/require "../assets/images/rama/walk_left_5.png")
98 | (js/require "../assets/images/rama/walk_left_6.png")
99 | (js/require "../assets/images/rama/walk_left_7.png")
100 | (js/require "../assets/images/rama/walk_left_8.png")])
101 |
102 | (defonce rama-walk-right
103 | [(js/require "../assets/images/rama/walk_right_0.png")
104 | (js/require "../assets/images/rama/walk_right_1.png")
105 | (js/require "../assets/images/rama/walk_right_2.png")
106 | (js/require "../assets/images/rama/walk_right_3.png")
107 | (js/require "../assets/images/rama/walk_right_4.png")
108 | (js/require "../assets/images/rama/walk_right_5.png")
109 | (js/require "../assets/images/rama/walk_right_6.png")
110 | (js/require "../assets/images/rama/walk_right_7.png")
111 | (js/require "../assets/images/rama/walk_right_8.png")])
112 |
113 | (defonce rama-shoot-up
114 | [(js/require "../assets/images/rama/shoot_up_0.png")
115 | (js/require "../assets/images/rama/shoot_up_1.png")
116 | (js/require "../assets/images/rama/shoot_up_2.png")
117 | (js/require "../assets/images/rama/shoot_up_3.png")
118 | (js/require "../assets/images/rama/shoot_up_4.png")
119 | (js/require "../assets/images/rama/shoot_up_5.png")
120 | (js/require "../assets/images/rama/shoot_up_6.png")
121 | (js/require "../assets/images/rama/shoot_up_7.png")
122 | (js/require "../assets/images/rama/shoot_up_8.png")
123 | (js/require "../assets/images/rama/shoot_up_9.png")
124 | (js/require "../assets/images/rama/shoot_up_10.png")
125 | (js/require "../assets/images/rama/shoot_up_11.png")
126 | (js/require "../assets/images/rama/shoot_up_12.png")])
127 |
128 | (defonce rama-shoot-down
129 | [(js/require "../assets/images/rama/shoot_down_0.png")
130 | (js/require "../assets/images/rama/shoot_down_1.png")
131 | (js/require "../assets/images/rama/shoot_down_2.png")
132 | (js/require "../assets/images/rama/shoot_down_3.png")
133 | (js/require "../assets/images/rama/shoot_down_4.png")
134 | (js/require "../assets/images/rama/shoot_down_5.png")
135 | (js/require "../assets/images/rama/shoot_down_6.png")
136 | (js/require "../assets/images/rama/shoot_down_7.png")
137 | (js/require "../assets/images/rama/shoot_down_8.png")
138 | (js/require "../assets/images/rama/shoot_down_9.png")
139 | (js/require "../assets/images/rama/shoot_down_10.png")
140 | (js/require "../assets/images/rama/shoot_down_11.png")
141 | (js/require "../assets/images/rama/shoot_down_12.png")])
142 |
143 | (defonce rama-shoot-left
144 | [(js/require "../assets/images/rama/shoot_left_0.png")
145 | (js/require "../assets/images/rama/shoot_left_1.png")
146 | (js/require "../assets/images/rama/shoot_left_2.png")
147 | (js/require "../assets/images/rama/shoot_left_3.png")
148 | (js/require "../assets/images/rama/shoot_left_4.png")
149 | (js/require "../assets/images/rama/shoot_left_5.png")
150 | (js/require "../assets/images/rama/shoot_left_6.png")
151 | (js/require "../assets/images/rama/shoot_left_7.png")
152 | (js/require "../assets/images/rama/shoot_left_8.png")
153 | (js/require "../assets/images/rama/shoot_left_9.png")
154 | (js/require "../assets/images/rama/shoot_left_10.png")
155 | (js/require "../assets/images/rama/shoot_left_11.png")
156 | (js/require "../assets/images/rama/shoot_left_12.png")])
157 |
158 | (defonce rama-shoot-right
159 | [(js/require "../assets/images/rama/shoot_right_0.png")
160 | (js/require "../assets/images/rama/shoot_right_1.png")
161 | (js/require "../assets/images/rama/shoot_right_2.png")
162 | (js/require "../assets/images/rama/shoot_right_3.png")
163 | (js/require "../assets/images/rama/shoot_right_4.png")
164 | (js/require "../assets/images/rama/shoot_right_5.png")
165 | (js/require "../assets/images/rama/shoot_right_6.png")
166 | (js/require "../assets/images/rama/shoot_right_7.png")
167 | (js/require "../assets/images/rama/shoot_right_8.png")
168 | (js/require "../assets/images/rama/shoot_right_9.png")
169 | (js/require "../assets/images/rama/shoot_right_10.png")
170 | (js/require "../assets/images/rama/shoot_right_11.png")
171 | (js/require "../assets/images/rama/shoot_right_12.png")])
172 |
173 |
174 | ;; Lakshmana
175 | ;; =========
176 | (defonce lxmn-idle-up
177 | [(js/require "../assets/images/lakshmana/walk_up_0.png")])
178 |
179 | (defonce lxmn-idle-down
180 | [(js/require "../assets/images/lakshmana/walk_down_0.png")])
181 |
182 | (defonce lxmn-idle-left
183 | [(js/require "../assets/images/lakshmana/walk_left_0.png")])
184 |
185 | (defonce lxmn-idle-right
186 | [(js/require "../assets/images/lakshmana/walk_right_0.png")])
187 |
188 | (defonce lxmn-walk-up
189 | [(js/require "../assets/images/lakshmana/walk_up_0.png")
190 | (js/require "../assets/images/lakshmana/walk_up_1.png")
191 | (js/require "../assets/images/lakshmana/walk_up_2.png")
192 | (js/require "../assets/images/lakshmana/walk_up_3.png")
193 | (js/require "../assets/images/lakshmana/walk_up_4.png")
194 | (js/require "../assets/images/lakshmana/walk_up_5.png")
195 | (js/require "../assets/images/lakshmana/walk_up_6.png")
196 | (js/require "../assets/images/lakshmana/walk_up_7.png")
197 | (js/require "../assets/images/lakshmana/walk_up_8.png")])
198 |
199 | (defonce lxmn-walk-down
200 | [(js/require "../assets/images/lakshmana/walk_down_0.png")
201 | (js/require "../assets/images/lakshmana/walk_down_1.png")
202 | (js/require "../assets/images/lakshmana/walk_down_2.png")
203 | (js/require "../assets/images/lakshmana/walk_down_3.png")
204 | (js/require "../assets/images/lakshmana/walk_down_4.png")
205 | (js/require "../assets/images/lakshmana/walk_down_5.png")
206 | (js/require "../assets/images/lakshmana/walk_down_6.png")
207 | (js/require "../assets/images/lakshmana/walk_down_7.png")
208 | (js/require "../assets/images/lakshmana/walk_down_8.png")])
209 |
210 | (defonce lxmn-walk-left
211 | [(js/require "../assets/images/lakshmana/walk_left_0.png")
212 | (js/require "../assets/images/lakshmana/walk_left_1.png")
213 | (js/require "../assets/images/lakshmana/walk_left_2.png")
214 | (js/require "../assets/images/lakshmana/walk_left_3.png")
215 | (js/require "../assets/images/lakshmana/walk_left_4.png")
216 | (js/require "../assets/images/lakshmana/walk_left_5.png")
217 | (js/require "../assets/images/lakshmana/walk_left_6.png")
218 | (js/require "../assets/images/lakshmana/walk_left_7.png")
219 | (js/require "../assets/images/lakshmana/walk_left_8.png")])
220 |
221 | (defonce lxmn-walk-right
222 | [(js/require "../assets/images/lakshmana/walk_right_0.png")
223 | (js/require "../assets/images/lakshmana/walk_right_1.png")
224 | (js/require "../assets/images/lakshmana/walk_right_2.png")
225 | (js/require "../assets/images/lakshmana/walk_right_3.png")
226 | (js/require "../assets/images/lakshmana/walk_right_4.png")
227 | (js/require "../assets/images/lakshmana/walk_right_5.png")
228 | (js/require "../assets/images/lakshmana/walk_right_6.png")
229 | (js/require "../assets/images/lakshmana/walk_right_7.png")
230 | (js/require "../assets/images/lakshmana/walk_right_8.png")])
231 |
232 |
233 | ;; Vishwamitra
234 | ;; ===========
235 | (defonce vishwamitra-idle
236 | [(js/require "../assets/images/vishwamitra/idle_1.png")]
237 | #_(for [i (range 9)]
238 | (js/require (str "../assets/images/vishwamitra/idle_" i ".png"))))
239 |
240 |
241 | ;; Tadaka
242 | ;; ======
243 | (defonce tadaka-idle-up
244 | [(js/require "../assets/images/tadaka/walk_up_0.png")])
245 |
246 | (defonce tadaka-idle-down
247 | [(js/require "../assets/images/tadaka/walk_down_0.png")])
248 |
249 | (defonce tadaka-idle-left
250 | [(js/require "../assets/images/tadaka/walk_left_0.png")])
251 |
252 | (defonce tadaka-idle-right
253 | [(js/require "../assets/images/tadaka/walk_right_0.png")])
254 |
255 | (defonce tadaka-walk-up
256 | [(js/require "../assets/images/tadaka/walk_up_1.png")
257 | (js/require "../assets/images/tadaka/walk_up_1.png")
258 | (js/require "../assets/images/tadaka/walk_up_1.png")
259 | (js/require "../assets/images/tadaka/walk_up_1.png")
260 | (js/require "../assets/images/tadaka/walk_up_1.png")
261 | (js/require "../assets/images/tadaka/walk_up_1.png")
262 | (js/require "../assets/images/tadaka/walk_up_2.png")
263 | (js/require "../assets/images/tadaka/walk_up_2.png")
264 | (js/require "../assets/images/tadaka/walk_up_2.png")
265 | (js/require "../assets/images/tadaka/walk_up_2.png")
266 | (js/require "../assets/images/tadaka/walk_up_2.png")
267 | (js/require "../assets/images/tadaka/walk_up_2.png")
268 | (js/require "../assets/images/tadaka/walk_up_3.png")
269 | (js/require "../assets/images/tadaka/walk_up_3.png")
270 | (js/require "../assets/images/tadaka/walk_up_3.png")
271 | (js/require "../assets/images/tadaka/walk_up_3.png")
272 | (js/require "../assets/images/tadaka/walk_up_3.png")
273 | (js/require "../assets/images/tadaka/walk_up_3.png")
274 | (js/require "../assets/images/tadaka/walk_up_0.png")
275 | (js/require "../assets/images/tadaka/walk_up_0.png")
276 | (js/require "../assets/images/tadaka/walk_up_0.png")
277 | (js/require "../assets/images/tadaka/walk_up_0.png")
278 | (js/require "../assets/images/tadaka/walk_up_0.png")])
279 |
280 | (defonce tadaka-walk-down
281 | [(js/require "../assets/images/tadaka/walk_down_1.png")
282 | (js/require "../assets/images/tadaka/walk_down_1.png")
283 | (js/require "../assets/images/tadaka/walk_down_1.png")
284 | (js/require "../assets/images/tadaka/walk_down_1.png")
285 | (js/require "../assets/images/tadaka/walk_down_1.png")
286 | (js/require "../assets/images/tadaka/walk_down_1.png")
287 | (js/require "../assets/images/tadaka/walk_down_2.png")
288 | (js/require "../assets/images/tadaka/walk_down_2.png")
289 | (js/require "../assets/images/tadaka/walk_down_2.png")
290 | (js/require "../assets/images/tadaka/walk_down_2.png")
291 | (js/require "../assets/images/tadaka/walk_down_2.png")
292 | (js/require "../assets/images/tadaka/walk_down_2.png")
293 | (js/require "../assets/images/tadaka/walk_down_3.png")
294 | (js/require "../assets/images/tadaka/walk_down_3.png")
295 | (js/require "../assets/images/tadaka/walk_down_3.png")
296 | (js/require "../assets/images/tadaka/walk_down_3.png")
297 | (js/require "../assets/images/tadaka/walk_down_3.png")
298 | (js/require "../assets/images/tadaka/walk_down_3.png")
299 | (js/require "../assets/images/tadaka/walk_down_0.png")
300 | (js/require "../assets/images/tadaka/walk_down_0.png")
301 | (js/require "../assets/images/tadaka/walk_down_0.png")
302 | (js/require "../assets/images/tadaka/walk_down_0.png")
303 | (js/require "../assets/images/tadaka/walk_down_0.png")])
304 |
305 | (defonce tadaka-walk-left
306 | [(js/require "../assets/images/tadaka/walk_left_1.png")
307 | (js/require "../assets/images/tadaka/walk_left_1.png")
308 | (js/require "../assets/images/tadaka/walk_left_1.png")
309 | (js/require "../assets/images/tadaka/walk_left_1.png")
310 | (js/require "../assets/images/tadaka/walk_left_1.png")
311 | (js/require "../assets/images/tadaka/walk_left_1.png")
312 | (js/require "../assets/images/tadaka/walk_left_2.png")
313 | (js/require "../assets/images/tadaka/walk_left_2.png")
314 | (js/require "../assets/images/tadaka/walk_left_2.png")
315 | (js/require "../assets/images/tadaka/walk_left_2.png")
316 | (js/require "../assets/images/tadaka/walk_left_2.png")
317 | (js/require "../assets/images/tadaka/walk_left_2.png")
318 | (js/require "../assets/images/tadaka/walk_left_3.png")
319 | (js/require "../assets/images/tadaka/walk_left_3.png")
320 | (js/require "../assets/images/tadaka/walk_left_3.png")
321 | (js/require "../assets/images/tadaka/walk_left_3.png")
322 | (js/require "../assets/images/tadaka/walk_left_3.png")
323 | (js/require "../assets/images/tadaka/walk_left_3.png")
324 | (js/require "../assets/images/tadaka/walk_left_0.png")
325 | (js/require "../assets/images/tadaka/walk_left_0.png")
326 | (js/require "../assets/images/tadaka/walk_left_0.png")
327 | (js/require "../assets/images/tadaka/walk_left_0.png")
328 | (js/require "../assets/images/tadaka/walk_left_0.png")])
329 |
330 | (defonce tadaka-walk-right
331 | [(js/require "../assets/images/tadaka/walk_right_1.png")
332 | (js/require "../assets/images/tadaka/walk_right_1.png")
333 | (js/require "../assets/images/tadaka/walk_right_1.png")
334 | (js/require "../assets/images/tadaka/walk_right_1.png")
335 | (js/require "../assets/images/tadaka/walk_right_1.png")
336 | (js/require "../assets/images/tadaka/walk_right_1.png")
337 | (js/require "../assets/images/tadaka/walk_right_2.png")
338 | (js/require "../assets/images/tadaka/walk_right_2.png")
339 | (js/require "../assets/images/tadaka/walk_right_2.png")
340 | (js/require "../assets/images/tadaka/walk_right_2.png")
341 | (js/require "../assets/images/tadaka/walk_right_2.png")
342 | (js/require "../assets/images/tadaka/walk_right_2.png")
343 | (js/require "../assets/images/tadaka/walk_right_3.png")
344 | (js/require "../assets/images/tadaka/walk_right_3.png")
345 | (js/require "../assets/images/tadaka/walk_right_3.png")
346 | (js/require "../assets/images/tadaka/walk_right_3.png")
347 | (js/require "../assets/images/tadaka/walk_right_3.png")
348 | (js/require "../assets/images/tadaka/walk_right_3.png")
349 | (js/require "../assets/images/tadaka/walk_right_0.png")
350 | (js/require "../assets/images/tadaka/walk_right_0.png")
351 | (js/require "../assets/images/tadaka/walk_right_0.png")
352 | (js/require "../assets/images/tadaka/walk_right_0.png")
353 | (js/require "../assets/images/tadaka/walk_right_0.png")])
354 |
355 |
356 | ;; Arrow
357 | ;; =====
358 | (defonce arrow-up
359 | [(js/require "../assets/images/arrow/arrow_up.png")])
360 |
361 | (defonce arrow-down
362 | [(js/require "../assets/images/arrow/arrow_down.png")])
363 |
364 | (defonce arrow-left
365 | [(js/require "../assets/images/arrow/arrow_left.png")])
366 |
367 | (defonce arrow-right
368 | [(js/require "../assets/images/arrow/arrow_right.png")])
369 |
370 |
371 | ;; Deer
372 | ;; ====
373 | (defonce deer-idle-up
374 | [(js/require "../assets/images/deer/run_up_2.png")])
375 |
376 | (defonce deer-idle-down
377 | [(js/require "../assets/images/deer/run_down_2.png")])
378 |
379 | (defonce deer-run-up
380 | [(js/require "../assets/images/deer/run_up_0.png")
381 | (js/require "../assets/images/deer/run_up_1.png")
382 | (js/require "../assets/images/deer/run_up_2.png")
383 | (js/require "../assets/images/deer/run_up_3.png")
384 | (js/require "../assets/images/deer/run_up_4.png")
385 | (js/require "../assets/images/deer/run_up_5.png")])
386 |
387 | (defonce deer-run-down
388 | [(js/require "../assets/images/deer/run_down_0.png")
389 | (js/require "../assets/images/deer/run_down_1.png")
390 | (js/require "../assets/images/deer/run_down_2.png")
391 | (js/require "../assets/images/deer/run_down_3.png")
392 | (js/require "../assets/images/deer/run_down_4.png")
393 | (js/require "../assets/images/deer/run_down_5.png")])
394 |
395 | (defonce deer-run-left
396 | [(js/require "../assets/images/deer/run_left_0.png")
397 | (js/require "../assets/images/deer/run_left_1.png")
398 | (js/require "../assets/images/deer/run_left_2.png")
399 | (js/require "../assets/images/deer/run_left_3.png")
400 | (js/require "../assets/images/deer/run_left_4.png")
401 | (js/require "../assets/images/deer/run_left_5.png")])
402 |
403 | (defonce deer-run-right
404 | [(js/require "../assets/images/deer/run_right_0.png")
405 | (js/require "../assets/images/deer/run_right_1.png")
406 | (js/require "../assets/images/deer/run_right_2.png")
407 | (js/require "../assets/images/deer/run_right_3.png")
408 | (js/require "../assets/images/deer/run_right_4.png")
409 | (js/require "../assets/images/deer/run_right_5.png")])
410 |
411 |
412 | ;; Objects
413 | ;; =======
414 | (defonce bonfire
415 | [(js/require "../assets/images/bonfire/0.png")
416 | (js/require "../assets/images/bonfire/1.png")
417 | (js/require "../assets/images/bonfire/2.png")
418 | (js/require "../assets/images/bonfire/3.png")
419 | (js/require "../assets/images/bonfire/4.png")])
420 |
421 | (defonce bow-pickup
422 | [(js/require "../assets/images/objects/bow_pickup.png")])
423 |
424 | (defonce hut
425 | [(js/require "../assets/images/objects/hut.png")])
426 |
427 | (defonce scarecrow
428 | [(js/require "../assets/images/objects/ScareCrow.png")])
429 |
430 | (defonce collision-area
431 | [(js/require "../assets/images/objects/collision_area.png")])
432 |
433 |
434 | ;; Controls
435 | ;; ========
436 | (defonce dpad-idle
437 | [(js/require "../assets/images/controls/dpad.png")])
438 |
439 | (defonce dpad-up
440 | [(js/require "../assets/images/controls/dpad_up.png")])
441 |
442 | (defonce dpad-down
443 | [(js/require "../assets/images/controls/dpad_down.png")])
444 |
445 | (defonce dpad-left
446 | [(js/require "../assets/images/controls/dpad_left.png")])
447 |
448 | (defonce dpad-right
449 | [(js/require "../assets/images/controls/dpad_right.png")])
450 |
--------------------------------------------------------------------------------
/src/main/example/util.cljs:
--------------------------------------------------------------------------------
1 | (ns example.util
2 | (:require [re-frame.core :as rf]
3 | [example.constants :as k]))
4 |
5 | (defn
10 | [evt]
11 | (rf/dispatch evt))
12 |
13 | (defn dissoc-in
14 | [m [k & ks]]
15 | (if ks
16 | (if-let [nextmap (get m k)]
17 | (let [newmap (dissoc-in nextmap ks)]
18 | (assoc m k newmap))
19 | m)
20 | (dissoc m k)))
21 |
22 | (defn pos->grid
23 | [[x y]]
24 | [(int (/ y k/TILE-HEIGHT))
25 | (int (/ x k/TILE-WIDTH))])
26 |
27 | (defn box-contains?
28 | [[x y width height] [x1 y1]]
29 | (and (<= x x1 (+ x width))
30 | (<= y y1 (+ y height))))
31 |
32 | (defn obj->box
33 | [obj]
34 | (let [[x y] (:pos obj)
35 | w (or (:width obj) k/TILE-WIDTH)
36 | h (or (:height obj) k/TILE-HEIGHT)]
37 | [x y w h]))
38 |
39 | (defn center-box
40 | [[x y w h]]
41 | (let [third-width (js/Math.ceil (/ w 3))
42 | third-height (js/Math.ceil (/ h 3))]
43 | [(+ x third-width) (+ y third-height) third-width third-height]))
44 |
45 | (defn obj->center-box
46 | [obj]
47 | (-> obj obj->box center-box))
48 |
49 | (defn obj->grid
50 | [obj]
51 | (let [[x y w h] (obj->box obj)
52 | bottom-middle [(+ x (/ w 2))
53 | (+ y h)]]
54 | (pos->grid bottom-middle)))
55 |
56 | (defn colliding?
57 | [[x1 y1 w1 h1 :as b1] [x2 y2 w2 h2 :as b2]]
58 | (or (box-contains? b1 [x2 y2])
59 | (box-contains? b1 [(+ x2 w2) y2])
60 | (box-contains? b1 [x2 (+ y2 w2)])
61 | (box-contains? b1 [(+ x2 w2) (+ y2 w2)])
62 |
63 | (box-contains? b2 [x1 y1])
64 | (box-contains? b2 [(+ x1 w1) y1])
65 | (box-contains? b2 [x1 (+ y1 w1)])
66 | (box-contains? b2 [(+ x1 w1) (+ y1 w1)])))
67 |
68 | (defn thirds
69 | [[x y w h]]
70 | (let [third-width (js/Math.ceil (/ w 3))
71 | third-height (js/Math.ceil (/ h 3))]
72 | {:top [x y w third-height]
73 | :bottom [x (+ y (* 2 third-height)) w third-height]
74 | :left [x y third-width h]
75 | :right [(+ x (* 2 third-width)) y third-width h]}))
76 |
77 | (defn collision-dir
78 | [[x1 y1 w1 h1 :as b1] [x2 y2 w2 y2 :as b2]]
79 | (let [b1-thirds (thirds b1)
80 | b2-thirds (thirds b2)]
81 | (cond
82 | (colliding? (:top b1-thirds) (:bottom b2-thirds))
83 | :top
84 |
85 | (colliding? (:bottom b1-thirds) (:top b2-thirds))
86 | :bottom
87 |
88 | (colliding? (:left b1-thirds) (:right b2-thirds))
89 | :left
90 |
91 | (colliding? (:right b1-thirds) (:left b2-thirds))
92 | :right
93 |
94 | :else :center)))
95 |
96 | (defn with-prefix [m p]
97 | (into {} (for [[k v] m]
98 | [(keyword (str (name p) "-" (name k))) v])))
99 |
100 | (defn center
101 | [[x y w h]]
102 | [(+ x (/ w 2)) (+ y (/ h 2))])
103 |
104 | (defn ahead-of?
105 | [this that]
106 | (let [this-dir (:dir this)
107 | that-dir (:dir that)
108 | [this-x this-y this-w this-h] (obj->box this)
109 | [that-x that-y that-w that-h] (obj->box that)]
110 | (case that-dir
111 | :up (< this-y that-y)
112 | :down (> (+ this-y this-h)
113 | (+ that-y that-h))
114 | :left (< this-x that-x)
115 | :right (> (+ this-x this-w)
116 | (+ that-x that-w)))))
117 |
118 | (defn above?
119 | [this that]
120 | (let [this-box (obj->box this)
121 | that-box (obj->box that)
122 | [_ this-y] (center this-box)
123 | [_ that-y] (center that-box)]
124 | (< this-y that-y)))
125 |
126 | (defn below?
127 | [this that]
128 | (above? that this))
129 |
130 | (defn left-of?
131 | [this that]
132 | (let [this-box (obj->box this)
133 | that-box (obj->box that)
134 | [this-x _] (center this-box)
135 | [that-x _] (center that-box)]
136 | (< this-x that-x)))
137 |
138 | (defn right-of?
139 | [this that]
140 | (left-of? that this))
141 |
142 | (defn dir-to
143 | [this that]
144 | (let [this-box (obj->box this)
145 | that-box (obj->box that)
146 | [this-x this-y] (center this-box)
147 | [that-x that-y] (center that-box)
148 | distances {:up (- that-y this-y)
149 | :down (- this-y that-y)
150 | :left (- that-x this-x)
151 | :right (- this-x that-x)}]
152 | (->> distances
153 | (sort-by last)
154 | first
155 | first)))
156 |
157 | (defn opposite-dir [dir]
158 | (case dir
159 | :up :down
160 | :down :up
161 | :left :right
162 | :right :left))
163 |
164 | (defn opposite-side [side]
165 | (case side
166 | :top :bottom
167 | :bottom :top
168 | :left :right
169 | :right :left))
170 |
171 | (defn distance
172 | [[x1 y1] [x2 y2]]
173 | (let [dx (- x2 x1)
174 | dy (- y2 y1)]
175 | (js/Math.sqrt (+ (* dx dx)
176 | (* dy dy)))))
177 |
178 | (defn ahead-of
179 | [obj [dx dy]]
180 | (let [{:keys [id state dir pos]} obj
181 | [x y] pos
182 | new-pos (case dir
183 | :left [(- x dx) y]
184 | :right [(+ x dx) y]
185 | :up [x (- y dy)]
186 | :down [x (+ y dy)]
187 | ;; else
188 | [x y])]
189 | new-pos))
190 |
--------------------------------------------------------------------------------
/src/main/expo/root.cljs:
--------------------------------------------------------------------------------
1 | (ns expo.root
2 | (:require ["expo" :as expo]
3 | ["create-react-class" :as crc]))
4 |
5 | (defonce root-ref (atom nil))
6 | (defonce root-component-ref (atom nil))
7 |
8 | (defn render-root [root]
9 | (let [first-call? (nil? @root-ref)]
10 | (reset! root-ref root)
11 |
12 | (if-not first-call?
13 | (when-let [root @root-component-ref]
14 | (.forceUpdate ^js root))
15 | (let [Root
16 | (crc
17 | #js {:componentDidMount
18 | (fn []
19 | (this-as this
20 | (reset! root-component-ref this)))
21 | :componentWillUnmount
22 | (fn []
23 | (reset! root-component-ref nil))
24 | :render
25 | (fn []
26 | (let [body @root-ref]
27 | (if (fn? body)
28 | (body)
29 | body)))})]
30 |
31 | (expo/registerRootComponent Root)))))
32 |
--------------------------------------------------------------------------------