Skip to content

Commit 3e6c705

Browse files
Animations and sprites (#25)
Adds more sprites, changed sprites, and animations. Adds the physics system to the game.
2 parents 59b4002 + f1d6573 commit 3e6c705

File tree

230 files changed

+3920
-373
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

230 files changed

+3920
-373
lines changed

.github/workflows/release.yml

+27-71
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
# with:
3737
# egress-policy: audit
3838
# - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
39-
# - uses: dtolnay/rust-toolchain@78c6b5541adb5849f5d72d15da722aedb26327ca # stable
39+
# - uses: dtolnay/rust-toolchain@be73d7920c329f220ce78e0234b8f96b7ae60248 # master
4040
# with:
4141
# targets: wasm32-unknown-unknown
4242
# toolchain: ${{ env.nightly_toolchain }}
@@ -89,7 +89,7 @@ jobs:
8989
with:
9090
egress-policy: audit
9191
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
92-
- uses: dtolnay/rust-toolchain@78c6b5541adb5849f5d72d15da722aedb26327ca # stable
92+
- uses: dtolnay/rust-toolchain@be73d7920c329f220ce78e0234b8f96b7ae60248 # master
9393
with:
9494
targets: x86_64-unknown-linux-gnu
9595
toolchain: ${{ env.nightly_toolchain }}
@@ -142,7 +142,7 @@ jobs:
142142
with:
143143
egress-policy: audit
144144
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
145-
- uses: dtolnay/rust-toolchain@78c6b5541adb5849f5d72d15da722aedb26327ca # stable
145+
- uses: dtolnay/rust-toolchain@be73d7920c329f220ce78e0234b8f96b7ae60248 # master
146146
with:
147147
targets: x86_64-pc-windows-msvc
148148
toolchain: ${{ env.nightly_toolchain }}
@@ -179,8 +179,8 @@ jobs:
179179
tag: ${{ github.ref }}
180180
overwrite: true
181181

182-
# Build for MacOS x86_64
183-
release-macOS-intel:
182+
# Build for MacOS x86_64 and aaarch64
183+
release-macOS:
184184
runs-on: macOS-latest
185185
# To upload artifacts, contents write permission is required
186186
permissions:
@@ -191,98 +191,55 @@ jobs:
191191
with:
192192
egress-policy: audit
193193
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
194-
- uses: dtolnay/rust-toolchain@78c6b5541adb5849f5d72d15da722aedb26327ca # stable
194+
- uses: dtolnay/rust-toolchain@be73d7920c329f220ce78e0234b8f96b7ae60248 # master
195195
with:
196-
targets: x86_64-apple-darwin
196+
targets: x86_64-apple-darwin, aaarch64-apple-darwin
197197
toolchain: ${{ env.nightly_toolchain }}
198198
- name: Environment Setup
199199
run: |
200200
export CFLAGS="-fno-stack-check"
201201
export MACOSX_DEPLOYMENT_TARGET="10.9"
202202
203-
- name: Build
203+
- name: Install Dependencies
204204
run: |
205205
brew install llvm
206-
cargo build --release --target x86_64-apple-darwin
206+
ln -s /opt/homebrew/opt /usr/local/opt
207+
- name: Build
208+
run: |
209+
cargo build --release --target x86_64-apple-darwin # Intel
210+
cargo build --release --target aaarch64-apple-darwin # Apple Silicon
207211
208212
- name: Prepare Package
209213
run: |
210214
mkdir -p ${{ env.binary }}.app/Contents/MacOS
211-
cp target/x86_64-apple-darwin/release/${{ env.binary }} ${{ env.binary }}.app/Contents/MacOS/
212-
cp -r game/assets ${{ env.binary }}.app/Contents/MacOS/
213-
cp -r game_data ${{ env.binary }}.app/Contents/MacOS/
214-
hdiutil create -fs HFS+ -volname "${{ env.binary }}" -srcfolder ${{ env.binary }}.app ${{ env.binary }}-macOS-intel.dmg
215+
mkdir -p ${{ env.binary }}.app/Contents/Resources
215216
216-
- name: Upload binaries to artifacts
217-
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4
218-
with:
219-
path: ${{ env.binary }}-macOS-intel.dmg
220-
name: macOS-intel
221-
retention-days: 1
217+
cp game_assets/Info.plist ${{ env.binary }}.app/Contents/
218+
cp game_assets/Icon/icon.icns ${{ env.binary }}.app/Contents/Resources/
222219
223-
- name: Upload binaries to release
224-
if: ${{ env.add_binaries_to_github_release == 'true' }}
225-
uses: svenstaro/upload-release-action@1beeb572c19a9242f4361f4cee78f8e0d9aec5df # v2
226-
with:
227-
repo_token: ${{ secrets.GITHUB_TOKEN }}
228-
file: ${{ env.binary }}-macOS-intel.dmg
229-
asset_name: ${{ env.binary }}-macOS-intel-${{ env.tag_name }}.dmg
230-
tag: ${{ github.ref }}
231-
overwrite: true
232-
233-
# Build for MacOS Apple Silicon
234-
release-macOS-apple-silicon:
235-
runs-on: macOS-latest
236-
# To upload artifacts, contents write permission is required
237-
permissions:
238-
contents: write
239-
env:
240-
# macOS 11 was the first version to support ARM
241-
MACOSX_DEPLOYMENT_TARGET: 11
242-
steps:
243-
- uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
244-
with:
245-
egress-policy: audit
246-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
247-
- uses: dtolnay/rust-toolchain@78c6b5541adb5849f5d72d15da722aedb26327ca # stable
248-
with:
249-
targets: aarch64-apple-darwin
250-
toolchain: ${{ env.nightly_toolchain }}
251-
- name: Setup LLVM
252-
run: |
253-
# seems to be we need to install LLVM via brew.
254-
brew install llvm
255-
# Brew suggests a couple other exports during the LLVM install
256-
export PATH="/opt/homebrew/opt/llvm/bin:$PATH"
257-
export LDFLAGS="-L/opt/homebrew/opt/llvm/lib"
258-
export CPPFLAGS="-I/opt/homebrew/opt/llvm/include"
259-
- name: Build
260-
run: |
261-
# This fails the final linking step with error:
262-
# "note: clang: error: invalid linker name in argument '-fuse-ld=/opt/homebrew/opt/llvm/bin/ld64.lld'"
263-
cargo build --release --target aarch64-apple-darwin
264-
- name: Prepare Package
265-
run: |
266-
mkdir -p ${{ env.binary }}.app/Contents/MacOS
267-
cp target/aarch64-apple-darwin/release/${{ env.binary }} ${{ env.binary }}.app/Contents/MacOS/
268220
cp -r game/assets ${{ env.binary }}.app/Contents/MacOS/
269221
cp -r game_data ${{ env.binary }}.app/Contents/MacOS/
270-
hdiutil create -fs HFS+ -volname "${{ env.binary }}-macOS-apple-silicon" -srcfolder ${{ env.binary }}.app ${{ env.binary }}-macOS-apple-silicon.dmg
222+
223+
lipo "target/x86_64-apple-darwin/release/${{ env.binary }}" \
224+
"target/aaarch64-apple-darwin/release/${{ env.binary }}" \
225+
-create -output ${{ env.binary }}.app/Contents/MacOS/${{ env.binary }}
226+
227+
hdiutil create -fs HFS+ -volname "${{ env.binary }}" -srcfolder ${{ env.binary }}.app ${{ env.binary }}-macOS.dmg
271228
272229
- name: Upload binaries to artifacts
273230
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4
274231
with:
275-
path: ${{ env.binary }}-macOS-apple-silicon.dmg
276-
name: macOS-apple-silicon
232+
path: ${{ env.binary }}-macOS.dmg
233+
name: macOS-intel
277234
retention-days: 1
278235

279236
- name: Upload binaries to release
280237
if: ${{ env.add_binaries_to_github_release == 'true' }}
281238
uses: svenstaro/upload-release-action@1beeb572c19a9242f4361f4cee78f8e0d9aec5df # v2
282239
with:
283240
repo_token: ${{ secrets.GITHUB_TOKEN }}
284-
file: ${{ env.binary }}-macOS-apple-silicon.dmg
285-
asset_name: ${{ env.binary }}-macOS-apple-silicon-${{ env.tag_name }}.dmg
241+
file: ${{ env.binary }}-macOS.dmg
242+
asset_name: ${{ env.binary }}-macOS-intel-${{ env.tag_name }}.dmg
286243
tag: ${{ github.ref }}
287244
overwrite: true
288245

@@ -307,8 +264,7 @@ jobs:
307264
# - release-wasm
308265
- release-linux
309266
- release-windows
310-
- release-macOS-intel
311-
- release-macOS-apple-silicon
267+
- release-macOS
312268
if: ${{ needs.check-if-upload-to-itch-is-configured.outputs.should-upload == 'yes' }}
313269

314270
steps:

Cargo.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

elementalist.app/Contents/Info.plist

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>en</string>
7+
<key>CFBundleDisplayName</key>
8+
<string>Elementalist</string>
9+
<key>CFBundleExecutable</key>
10+
<string>elementalist</string>
11+
<key>CFBundleIconFile</key>
12+
<string>icon.icns</string>
13+
<key>CFBundleIdentifier</key>
14+
<string>one.nwest.elementalist</string>
15+
<key>CFBundleInfoDictionaryVersion</key>
16+
<string>6.0</string>
17+
<key>CFBundleName</key>
18+
<string>MyGame</string>
19+
<key>CFBundlePackageType</key>
20+
<string>APPL</string>
21+
<key>CFBundleShortVersionString</key>
22+
<string>0.5.0</string>
23+
<key>LSApplicationCategoryType</key>
24+
<string>public.app-category.games</string>
25+
<key>LSMinimumSystemVersion</key>
26+
<string>10.9</string>
27+
<key>CFBundleSupportedPlatforms</key>
28+
<array>
29+
<string>MacOSX</string>
30+
</array>
31+
</dict>
32+
</plist>
61.6 KB
Binary file not shown.
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
app_icon ICON "icon.ico"
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
Copyright (c) 2011-2012, Ana Sanfelippo ([email protected]), with Reserved Font Name 'Almendra'
2+
3+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
4+
This license is copied below, and is also available with a FAQ at:
5+
http://scripts.sil.org/OFL
6+
7+
8+
-----------------------------------------------------------
9+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10+
-----------------------------------------------------------
11+
12+
PREAMBLE
13+
The goals of the Open Font License (OFL) are to stimulate worldwide
14+
development of collaborative font projects, to support the font creation
15+
efforts of academic and linguistic communities, and to provide a free and
16+
open framework in which fonts may be shared and improved in partnership
17+
with others.
18+
19+
The OFL allows the licensed fonts to be used, studied, modified and
20+
redistributed freely as long as they are not sold by themselves. The
21+
fonts, including any derivative works, can be bundled, embedded,
22+
redistributed and/or sold with any software provided that any reserved
23+
names are not used by derivative works. The fonts and derivatives,
24+
however, cannot be released under any other type of license. The
25+
requirement for fonts to remain under this license does not apply
26+
to any document created using the fonts or their derivatives.
27+
28+
DEFINITIONS
29+
"Font Software" refers to the set of files released by the Copyright
30+
Holder(s) under this license and clearly marked as such. This may
31+
include source files, build scripts and documentation.
32+
33+
"Reserved Font Name" refers to any names specified as such after the
34+
copyright statement(s).
35+
36+
"Original Version" refers to the collection of Font Software components as
37+
distributed by the Copyright Holder(s).
38+
39+
"Modified Version" refers to any derivative made by adding to, deleting,
40+
or substituting -- in part or in whole -- any of the components of the
41+
Original Version, by changing formats or by porting the Font Software to a
42+
new environment.
43+
44+
"Author" refers to any designer, engineer, programmer, technical
45+
writer or other person who contributed to the Font Software.
46+
47+
PERMISSION & CONDITIONS
48+
Permission is hereby granted, free of charge, to any person obtaining
49+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
50+
redistribute, and sell modified and unmodified copies of the Font
51+
Software, subject to the following conditions:
52+
53+
1) Neither the Font Software nor any of its individual components,
54+
in Original or Modified Versions, may be sold by itself.
55+
56+
2) Original or Modified Versions of the Font Software may be bundled,
57+
redistributed and/or sold with any software, provided that each copy
58+
contains the above copyright notice and this license. These can be
59+
included either as stand-alone text files, human-readable headers or
60+
in the appropriate machine-readable metadata fields within text or
61+
binary files as long as those fields can be easily viewed by the user.
62+
63+
3) No Modified Version of the Font Software may use the Reserved Font
64+
Name(s) unless explicit written permission is granted by the corresponding
65+
Copyright Holder. This restriction only applies to the primary font name as
66+
presented to the users.
67+
68+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69+
Software shall not be used to promote, endorse or advertise any
70+
Modified Version, except to acknowledge the contribution(s) of the
71+
Copyright Holder(s) and the Author(s) or with their explicit written
72+
permission.
73+
74+
5) The Font Software, modified or unmodified, in part or in whole,
75+
must be distributed entirely under this license, and must not be
76+
distributed under any other license. The requirement for fonts to
77+
remain under this license does not apply to any document created
78+
using the Font Software.
79+
80+
TERMINATION
81+
This license becomes null and void if any of the above conditions are
82+
not met.
83+
84+
DISCLAIMER
85+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93+
OTHER DEALINGS IN THE FONT SOFTWARE.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Loading
Loading
31.1 MB
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Data Files for Game Mechanics
2+
3+
Elementalist reads in game data from the `game_data` directory at launch. These files contain details about the spells and tilesets, and supporting data like particle effects. This is to allow easily adding content to the game, and to make adding it accessible to players.
4+
5+
These files can be in any directory that is within the `game_data` directory (they do not be to separated into different data types). So for example, you can put the data for your spells and their particle data in the same directory and it will be loaded.
6+
7+
## Schemas for Validation
8+
9+
There are publicly available schemas that define the different data files you may write. These are in `_schemas` but also hosted online for ease of IDE integration via the schema validation settings.
10+
11+
| Data | Schema URL |
12+
| ---------------------- | ------------------------------------------------------------ |
13+
| Particle Effect | `https://schemas.nwest.one/games/elementalist/particle.json` |
14+
| Sprite Atlas / Tileset | `https://schemas.nwest.one/games/elementalist/tileset.json` |
15+
| Spell | `https://schemas.nwest.one/games/elementalist/spell.json` |
16+
17+
## Loading Order
18+
19+
Data files are loaded in a specific order so that some data files may reference others (and we can validate that reference). This is to embrace the multi-threaded-ness of bevy as much as possible, to make loading the data as fast as possible. The schedules for the data files are part of a graph with the dependencies needed for inter-linking (e.g. linking a particle effect to a spell) are in the previous node. This is defined with a "schedule" which is just a system set loaded to allow those jobs to be run in parallel.
20+
21+
1. Schedule A: no inter-linking with other data files (the roots)
22+
2. Schedule B: inter-link only with data loaded from Schedule A
23+
3. (Theoretical) Schedule C: can depend on data in Schedule A and Schedule B or just Schedule B.
24+
25+
The current data loading order:
26+
27+
| Schedule | Data to be loaded |
28+
| -------- | ----------------------- |
29+
| A | Particle Effects |
30+
| A | Sprite Atlas / Tilesets |
31+
| B | Spell |
32+
33+
## YAML Validation
34+
35+
The standard way to add validation to a file is to include a comment at the top of the file which points to the schema URL.
36+
37+
### Specifying the Schema (Recommended)
38+
39+
You can add a comment at the top of the yaml file to indicate what schema to use:
40+
41+
```yaml
42+
# yaml-language-server: $schema=https://schemas.nwest.one/games/elementalist/spell.json
43+
```
44+
45+
This is probably the recommended way if you plan to have different data files in the same directory.
46+
47+
### Specifying the Schema in VSCode (Alternative)
48+
49+
In vscode, if you are using the redhat yaml validation plugin (which is likely), you can edit your `settings.json`
50+
file to inform it of the proper schemas for the vanilla `game_data` file directories:
51+
52+
```json
53+
"yaml.schemas": {
54+
"https://schemas.nwest.one/games/elementalist/spell.json": ["**/game_data/spells/*.y*ml"],
55+
"https://schemas.nwest.one/games/elementalist/spell_tag.json": ["**/game_data/spell_tags/*.y*ml"],
56+
"https://schemas.nwest.one/games/elementalist/tileset.json": ["**/game_data/tilesets/*.y*ml"],
57+
"https://schemas.nwest.one/games/elementalist/particle.json": ["**/game_data/particles/*.y*ml"]
58+
}
59+
```

0 commit comments

Comments
 (0)