Skip to content

Commit

Permalink
feat: add anchor item implemented with the new Lua scripting system.
Browse files Browse the repository at this point in the history
  • Loading branch information
zicklag committed Nov 25, 2023
1 parent c4f38ae commit 9931272
Show file tree
Hide file tree
Showing 24 changed files with 293 additions and 50 deletions.
79 changes: 50 additions & 29 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ ignored = [
"getrandom", # Needed to add `js` feature
]

# Uncomment for testing during bones development, if you clone bones adjacent to the jumpy
# repo.
[patch.'https://github.com/fishfolk/bones']
bones_framework = { path = "../bones/framework_crates/bones_framework" }
bones_bevy_renderer = { path = "../bones/framework_crates/bones_bevy_renderer" }
# # Uncomment for testing during bones development, if you clone bones adjacent to the jumpy
# # repo.
# [patch.'https://github.com/fishfolk/bones']
# bones_framework = { path = "../bones/framework_crates/bones_framework" }
# bones_bevy_renderer = { path = "../bones/framework_crates/bones_bevy_renderer" }
2 changes: 1 addition & 1 deletion assets/game.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ music:
results_screen: music/11 thar she blows!.ogg
credits: music/12 all hands hoay!.ogg


main_menu:
title_font:
family: Fairfax SM
Expand Down Expand Up @@ -297,6 +296,7 @@ core:
- /map/resources/coral.atlas.yaml

map_elements:
- /plugins/anchor/element.yaml
- /elements/decoration/anemones/anemones.element.yaml
- /elements/decoration/seaweed/seaweed.element.yaml
- /elements/environment/urchin/urchin.element.yaml
Expand Down
4 changes: 4 additions & 0 deletions assets/map/levels/level_1.map.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1237,6 +1237,10 @@ layers:
- 432.0
- 555.0
element: /elements/item/sword/sword.element.yaml
- pos:
- 300.0
- 700.0
element: /plugins/anchor/element.yaml
- pos:
- 480.0
- 118.5
Expand Down
4 changes: 4 additions & 0 deletions assets/pack.yaml
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
root: game.yaml
schemas:
- plugins/anchor/AnchorMeta.schema.yaml
- plugins/anchor/IdleAnchor.schema.yaml
- plugins/anchor/FallingAnchor.schema.yaml
17 changes: 17 additions & 0 deletions assets/plugins/anchor/AnchorMeta.schema.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: AnchorMeta
full_name: core::AnchorMeta
asset_extension: anchor
kind: !Struct
fields:
- name: atlas
# Handle<Atlas>
schema: UntypedHandle
- name: fall_speed
schema: f32
- name: body_size
schema: Vec2
- name: fin_anim
schema: Ustr
- name: grab_offset
schema: Vec2

3 changes: 3 additions & 0 deletions assets/plugins/anchor/FallingAnchor.schema.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: FallingAnchor
full_name: core::FallingAnchor
kind: !Struct
3 changes: 3 additions & 0 deletions assets/plugins/anchor/IdleAnchor.schema.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: IdleAnchor
full_name: core::IdleAnchor
kind: !Struct
5 changes: 5 additions & 0 deletions assets/plugins/anchor/anchor.atlas.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
image: ./anchor.png
tile_size: [28, 35]
columns: 1
rows: 1

Binary file added assets/plugins/anchor/anchor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions assets/plugins/anchor/anchor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
atlas: ./anchor.atlas.yaml
grab_offset: [5, -2]
body_size: [28, 34]
fin_anim: grab_2
fall_speed: 8
4 changes: 4 additions & 0 deletions assets/plugins/anchor/element.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
name: Anchor
category: Weapons
data: anchor.yaml
plugin: plugin.lua
Loading

0 comments on commit 9931272

Please sign in to comment.