diff --git a/resources/public/img/bow/BELT_leather.png b/resources/public/img/bow/BELT_leather.png new file mode 100644 index 0000000..ca329cb Binary files /dev/null and b/resources/public/img/bow/BELT_leather.png differ diff --git a/resources/public/img/bow/BELT_rope.png b/resources/public/img/bow/BELT_rope.png new file mode 100644 index 0000000..75f1685 Binary files /dev/null and b/resources/public/img/bow/BELT_rope.png differ diff --git a/resources/public/img/bow/BODY_animation.png b/resources/public/img/bow/BODY_animation.png new file mode 100644 index 0000000..253499d Binary files /dev/null and b/resources/public/img/bow/BODY_animation.png differ diff --git a/resources/public/img/bow/FEET_plate_armor_shoes.png b/resources/public/img/bow/FEET_plate_armor_shoes.png new file mode 100644 index 0000000..d96b2cc Binary files /dev/null and b/resources/public/img/bow/FEET_plate_armor_shoes.png differ diff --git a/resources/public/img/bow/FEET_shoes_brown.png b/resources/public/img/bow/FEET_shoes_brown.png new file mode 100644 index 0000000..872013d Binary files /dev/null and b/resources/public/img/bow/FEET_shoes_brown.png differ diff --git a/resources/public/img/bow/HANDS_plate_armor_gloves.png b/resources/public/img/bow/HANDS_plate_armor_gloves.png new file mode 100644 index 0000000..26a2a52 Binary files /dev/null and b/resources/public/img/bow/HANDS_plate_armor_gloves.png differ diff --git a/resources/public/img/bow/HEAD_chain_armor_helmet.png b/resources/public/img/bow/HEAD_chain_armor_helmet.png new file mode 100644 index 0000000..e0f5c46 Binary files /dev/null and b/resources/public/img/bow/HEAD_chain_armor_helmet.png differ diff --git a/resources/public/img/bow/HEAD_chain_armor_hood.png b/resources/public/img/bow/HEAD_chain_armor_hood.png new file mode 100644 index 0000000..cbf3750 Binary files /dev/null and b/resources/public/img/bow/HEAD_chain_armor_hood.png differ diff --git a/resources/public/img/bow/HEAD_hair_blonde.png b/resources/public/img/bow/HEAD_hair_blonde.png new file mode 100644 index 0000000..25317b5 Binary files /dev/null and b/resources/public/img/bow/HEAD_hair_blonde.png differ diff --git a/resources/public/img/bow/HEAD_leather_armor_hat.png b/resources/public/img/bow/HEAD_leather_armor_hat.png new file mode 100644 index 0000000..52f3ea8 Binary files /dev/null and b/resources/public/img/bow/HEAD_leather_armor_hat.png differ diff --git a/resources/public/img/bow/HEAD_plate_armor_helmet.png b/resources/public/img/bow/HEAD_plate_armor_helmet.png new file mode 100644 index 0000000..c17cd2f Binary files /dev/null and b/resources/public/img/bow/HEAD_plate_armor_helmet.png differ diff --git a/resources/public/img/bow/HEAD_robe_hood.png b/resources/public/img/bow/HEAD_robe_hood.png new file mode 100644 index 0000000..8950acc Binary files /dev/null and b/resources/public/img/bow/HEAD_robe_hood.png differ diff --git a/resources/public/img/bow/LEGS_pants_greenish.png b/resources/public/img/bow/LEGS_pants_greenish.png new file mode 100644 index 0000000..f58ce10 Binary files /dev/null and b/resources/public/img/bow/LEGS_pants_greenish.png differ diff --git a/resources/public/img/bow/LEGS_plate_armor_pants.png b/resources/public/img/bow/LEGS_plate_armor_pants.png new file mode 100644 index 0000000..d13ab43 Binary files /dev/null and b/resources/public/img/bow/LEGS_plate_armor_pants.png differ diff --git a/resources/public/img/bow/LEGS_robe_skirt.png b/resources/public/img/bow/LEGS_robe_skirt.png new file mode 100644 index 0000000..cc85afc Binary files /dev/null and b/resources/public/img/bow/LEGS_robe_skirt.png differ diff --git a/resources/public/img/bow/TORSO_chain_armor_jacket_purple.png b/resources/public/img/bow/TORSO_chain_armor_jacket_purple.png new file mode 100644 index 0000000..be952e7 Binary files /dev/null and b/resources/public/img/bow/TORSO_chain_armor_jacket_purple.png differ diff --git a/resources/public/img/bow/TORSO_chain_armor_torso.png b/resources/public/img/bow/TORSO_chain_armor_torso.png new file mode 100644 index 0000000..39f233c Binary files /dev/null and b/resources/public/img/bow/TORSO_chain_armor_torso.png differ diff --git a/resources/public/img/bow/TORSO_leather_armor_bracers.png b/resources/public/img/bow/TORSO_leather_armor_bracers.png new file mode 100644 index 0000000..bd31174 Binary files /dev/null and b/resources/public/img/bow/TORSO_leather_armor_bracers.png differ diff --git a/resources/public/img/bow/TORSO_leather_armor_shirt_white.png b/resources/public/img/bow/TORSO_leather_armor_shirt_white.png new file mode 100644 index 0000000..051fd8d Binary files /dev/null and b/resources/public/img/bow/TORSO_leather_armor_shirt_white.png differ diff --git a/resources/public/img/bow/TORSO_leather_armor_shoulders.png b/resources/public/img/bow/TORSO_leather_armor_shoulders.png new file mode 100644 index 0000000..3f0ee9a Binary files /dev/null and b/resources/public/img/bow/TORSO_leather_armor_shoulders.png differ diff --git a/resources/public/img/bow/TORSO_leather_armor_torso.png b/resources/public/img/bow/TORSO_leather_armor_torso.png new file mode 100644 index 0000000..57b8384 Binary files /dev/null and b/resources/public/img/bow/TORSO_leather_armor_torso.png differ diff --git a/resources/public/img/bow/TORSO_plate_armor_arms_shoulders.png b/resources/public/img/bow/TORSO_plate_armor_arms_shoulders.png new file mode 100644 index 0000000..e67ecaf Binary files /dev/null and b/resources/public/img/bow/TORSO_plate_armor_arms_shoulders.png differ diff --git a/resources/public/img/bow/TORSO_plate_armor_torso.png b/resources/public/img/bow/TORSO_plate_armor_torso.png new file mode 100644 index 0000000..c51268b Binary files /dev/null and b/resources/public/img/bow/TORSO_plate_armor_torso.png differ diff --git a/resources/public/img/bow/TORSO_robe_shirt_brown.png b/resources/public/img/bow/TORSO_robe_shirt_brown.png new file mode 100644 index 0000000..6d6a8a2 Binary files /dev/null and b/resources/public/img/bow/TORSO_robe_shirt_brown.png differ diff --git a/resources/public/img/bow/WEAPON_arrow.png b/resources/public/img/bow/WEAPON_arrow.png new file mode 100644 index 0000000..5fcb48a Binary files /dev/null and b/resources/public/img/bow/WEAPON_arrow.png differ diff --git a/resources/public/img/bow/WEAPON_bow.png b/resources/public/img/bow/WEAPON_bow.png new file mode 100644 index 0000000..f03712f Binary files /dev/null and b/resources/public/img/bow/WEAPON_bow.png differ diff --git a/resources/public/img/combat_dummy/BODY_animation.png b/resources/public/img/combat_dummy/BODY_animation.png new file mode 100644 index 0000000..c6344b2 Binary files /dev/null and b/resources/public/img/combat_dummy/BODY_animation.png differ diff --git a/resources/public/img/hurt/BEHIND_quiver.png b/resources/public/img/hurt/BEHIND_quiver.png new file mode 100644 index 0000000..89ae761 Binary files /dev/null and b/resources/public/img/hurt/BEHIND_quiver.png differ diff --git a/resources/public/img/hurt/BELT_leather.png b/resources/public/img/hurt/BELT_leather.png new file mode 100644 index 0000000..017455e Binary files /dev/null and b/resources/public/img/hurt/BELT_leather.png differ diff --git a/resources/public/img/hurt/BELT_rope.png b/resources/public/img/hurt/BELT_rope.png new file mode 100644 index 0000000..276d972 Binary files /dev/null and b/resources/public/img/hurt/BELT_rope.png differ diff --git a/resources/public/img/hurt/BODY_male.png b/resources/public/img/hurt/BODY_male.png new file mode 100644 index 0000000..c807444 Binary files /dev/null and b/resources/public/img/hurt/BODY_male.png differ diff --git a/resources/public/img/hurt/BODY_skeleton.png b/resources/public/img/hurt/BODY_skeleton.png new file mode 100644 index 0000000..7bafe0c Binary files /dev/null and b/resources/public/img/hurt/BODY_skeleton.png differ diff --git a/resources/public/img/hurt/FEET_plate_armor_shoes.png b/resources/public/img/hurt/FEET_plate_armor_shoes.png new file mode 100644 index 0000000..4cac8eb Binary files /dev/null and b/resources/public/img/hurt/FEET_plate_armor_shoes.png differ diff --git a/resources/public/img/hurt/FEET_shoes_brown.png b/resources/public/img/hurt/FEET_shoes_brown.png new file mode 100644 index 0000000..c894166 Binary files /dev/null and b/resources/public/img/hurt/FEET_shoes_brown.png differ diff --git a/resources/public/img/hurt/HANDS_plate_armor_gloves.png b/resources/public/img/hurt/HANDS_plate_armor_gloves.png new file mode 100644 index 0000000..657e200 Binary files /dev/null and b/resources/public/img/hurt/HANDS_plate_armor_gloves.png differ diff --git a/resources/public/img/hurt/HEAD_chain_armor_helmet.png b/resources/public/img/hurt/HEAD_chain_armor_helmet.png new file mode 100644 index 0000000..991d57e Binary files /dev/null and b/resources/public/img/hurt/HEAD_chain_armor_helmet.png differ diff --git a/resources/public/img/hurt/HEAD_chain_armor_hood.png b/resources/public/img/hurt/HEAD_chain_armor_hood.png new file mode 100644 index 0000000..85b46b9 Binary files /dev/null and b/resources/public/img/hurt/HEAD_chain_armor_hood.png differ diff --git a/resources/public/img/hurt/HEAD_hair_blonde.png b/resources/public/img/hurt/HEAD_hair_blonde.png new file mode 100644 index 0000000..ed83b39 Binary files /dev/null and b/resources/public/img/hurt/HEAD_hair_blonde.png differ diff --git a/resources/public/img/hurt/HEAD_leather_armor_hat.png b/resources/public/img/hurt/HEAD_leather_armor_hat.png new file mode 100644 index 0000000..9134bb8 Binary files /dev/null and b/resources/public/img/hurt/HEAD_leather_armor_hat.png differ diff --git a/resources/public/img/hurt/HEAD_plate_armor_helmet.png b/resources/public/img/hurt/HEAD_plate_armor_helmet.png new file mode 100644 index 0000000..4857533 Binary files /dev/null and b/resources/public/img/hurt/HEAD_plate_armor_helmet.png differ diff --git a/resources/public/img/hurt/HEAD_robe_hood.png b/resources/public/img/hurt/HEAD_robe_hood.png new file mode 100644 index 0000000..c931045 Binary files /dev/null and b/resources/public/img/hurt/HEAD_robe_hood.png differ diff --git a/resources/public/img/hurt/LEGS_pants_greenish.png b/resources/public/img/hurt/LEGS_pants_greenish.png new file mode 100644 index 0000000..963b428 Binary files /dev/null and b/resources/public/img/hurt/LEGS_pants_greenish.png differ diff --git a/resources/public/img/hurt/LEGS_plate_armor_pants.png b/resources/public/img/hurt/LEGS_plate_armor_pants.png new file mode 100644 index 0000000..f22c5b7 Binary files /dev/null and b/resources/public/img/hurt/LEGS_plate_armor_pants.png differ diff --git a/resources/public/img/hurt/LEGS_robe_skirt.png b/resources/public/img/hurt/LEGS_robe_skirt.png new file mode 100644 index 0000000..939920b Binary files /dev/null and b/resources/public/img/hurt/LEGS_robe_skirt.png differ diff --git a/resources/public/img/hurt/TORSO_chain_armor_jacket_purple.png b/resources/public/img/hurt/TORSO_chain_armor_jacket_purple.png new file mode 100644 index 0000000..d7d5e2e Binary files /dev/null and b/resources/public/img/hurt/TORSO_chain_armor_jacket_purple.png differ diff --git a/resources/public/img/hurt/TORSO_chain_armor_torso.png b/resources/public/img/hurt/TORSO_chain_armor_torso.png new file mode 100644 index 0000000..e717b4d Binary files /dev/null and b/resources/public/img/hurt/TORSO_chain_armor_torso.png differ diff --git a/resources/public/img/hurt/TORSO_leather_armor_bracers.png b/resources/public/img/hurt/TORSO_leather_armor_bracers.png new file mode 100644 index 0000000..cf10d84 Binary files /dev/null and b/resources/public/img/hurt/TORSO_leather_armor_bracers.png differ diff --git a/resources/public/img/hurt/TORSO_leather_armor_shirt_white.png b/resources/public/img/hurt/TORSO_leather_armor_shirt_white.png new file mode 100644 index 0000000..7345c78 Binary files /dev/null and b/resources/public/img/hurt/TORSO_leather_armor_shirt_white.png differ diff --git a/resources/public/img/hurt/TORSO_leather_armor_shoulders.png b/resources/public/img/hurt/TORSO_leather_armor_shoulders.png new file mode 100644 index 0000000..b8983f6 Binary files /dev/null and b/resources/public/img/hurt/TORSO_leather_armor_shoulders.png differ diff --git a/resources/public/img/hurt/TORSO_leather_armor_torso.png b/resources/public/img/hurt/TORSO_leather_armor_torso.png new file mode 100644 index 0000000..d0fc5bc Binary files /dev/null and b/resources/public/img/hurt/TORSO_leather_armor_torso.png differ diff --git a/resources/public/img/hurt/TORSO_plate_armor_arms_shoulders.png b/resources/public/img/hurt/TORSO_plate_armor_arms_shoulders.png new file mode 100644 index 0000000..7c9ad34 Binary files /dev/null and b/resources/public/img/hurt/TORSO_plate_armor_arms_shoulders.png differ diff --git a/resources/public/img/hurt/TORSO_plate_armor_torso.png b/resources/public/img/hurt/TORSO_plate_armor_torso.png new file mode 100644 index 0000000..58ec988 Binary files /dev/null and b/resources/public/img/hurt/TORSO_plate_armor_torso.png differ diff --git a/resources/public/img/hurt/TORSO_robe_shirt_brown.png b/resources/public/img/hurt/TORSO_robe_shirt_brown.png new file mode 100644 index 0000000..fd1de00 Binary files /dev/null and b/resources/public/img/hurt/TORSO_robe_shirt_brown.png differ diff --git a/resources/public/img/slash/BEHIND_quiver.png b/resources/public/img/slash/BEHIND_quiver.png new file mode 100644 index 0000000..3169e9f Binary files /dev/null and b/resources/public/img/slash/BEHIND_quiver.png differ diff --git a/resources/public/img/slash/BELT_leather.png b/resources/public/img/slash/BELT_leather.png new file mode 100644 index 0000000..271be54 Binary files /dev/null and b/resources/public/img/slash/BELT_leather.png differ diff --git a/resources/public/img/slash/BELT_rope.png b/resources/public/img/slash/BELT_rope.png new file mode 100644 index 0000000..954021e Binary files /dev/null and b/resources/public/img/slash/BELT_rope.png differ diff --git a/resources/public/img/slash/BODY_human.png b/resources/public/img/slash/BODY_human.png new file mode 100644 index 0000000..0cf3330 Binary files /dev/null and b/resources/public/img/slash/BODY_human.png differ diff --git a/resources/public/img/slash/BODY_skeleton.png b/resources/public/img/slash/BODY_skeleton.png new file mode 100644 index 0000000..5ba7209 Binary files /dev/null and b/resources/public/img/slash/BODY_skeleton.png differ diff --git a/resources/public/img/slash/FEET_plate_armor_shoes.png b/resources/public/img/slash/FEET_plate_armor_shoes.png new file mode 100644 index 0000000..9ef7e4c Binary files /dev/null and b/resources/public/img/slash/FEET_plate_armor_shoes.png differ diff --git a/resources/public/img/slash/FEET_shoes_brown.png b/resources/public/img/slash/FEET_shoes_brown.png new file mode 100644 index 0000000..5904da7 Binary files /dev/null and b/resources/public/img/slash/FEET_shoes_brown.png differ diff --git a/resources/public/img/slash/HANDS_plate_armor_gloves.png b/resources/public/img/slash/HANDS_plate_armor_gloves.png new file mode 100644 index 0000000..81c949e Binary files /dev/null and b/resources/public/img/slash/HANDS_plate_armor_gloves.png differ diff --git a/resources/public/img/slash/HEAD_chain_armor_helmet.png b/resources/public/img/slash/HEAD_chain_armor_helmet.png new file mode 100644 index 0000000..fafd5a7 Binary files /dev/null and b/resources/public/img/slash/HEAD_chain_armor_helmet.png differ diff --git a/resources/public/img/slash/HEAD_chain_armor_hood.png b/resources/public/img/slash/HEAD_chain_armor_hood.png new file mode 100644 index 0000000..450ee97 Binary files /dev/null and b/resources/public/img/slash/HEAD_chain_armor_hood.png differ diff --git a/resources/public/img/slash/HEAD_hair_blonde.png b/resources/public/img/slash/HEAD_hair_blonde.png new file mode 100644 index 0000000..937b40e Binary files /dev/null and b/resources/public/img/slash/HEAD_hair_blonde.png differ diff --git a/resources/public/img/slash/HEAD_leather_armor_hat.png b/resources/public/img/slash/HEAD_leather_armor_hat.png new file mode 100644 index 0000000..c9ab63e Binary files /dev/null and b/resources/public/img/slash/HEAD_leather_armor_hat.png differ diff --git a/resources/public/img/slash/HEAD_plate_armor_helmet.png b/resources/public/img/slash/HEAD_plate_armor_helmet.png new file mode 100644 index 0000000..03f1974 Binary files /dev/null and b/resources/public/img/slash/HEAD_plate_armor_helmet.png differ diff --git a/resources/public/img/slash/HEAD_robe_hood.png b/resources/public/img/slash/HEAD_robe_hood.png new file mode 100644 index 0000000..f9b95b4 Binary files /dev/null and b/resources/public/img/slash/HEAD_robe_hood.png differ diff --git a/resources/public/img/slash/LEGS_pants_greenish.png b/resources/public/img/slash/LEGS_pants_greenish.png new file mode 100644 index 0000000..9e5565b Binary files /dev/null and b/resources/public/img/slash/LEGS_pants_greenish.png differ diff --git a/resources/public/img/slash/LEGS_plate_armor_pants.png b/resources/public/img/slash/LEGS_plate_armor_pants.png new file mode 100644 index 0000000..c50d53d Binary files /dev/null and b/resources/public/img/slash/LEGS_plate_armor_pants.png differ diff --git a/resources/public/img/slash/LEGS_robe_skirt.png b/resources/public/img/slash/LEGS_robe_skirt.png new file mode 100644 index 0000000..4005540 Binary files /dev/null and b/resources/public/img/slash/LEGS_robe_skirt.png differ diff --git a/resources/public/img/slash/TORSO_chain_armor_jacket_purple.png b/resources/public/img/slash/TORSO_chain_armor_jacket_purple.png new file mode 100644 index 0000000..291a97c Binary files /dev/null and b/resources/public/img/slash/TORSO_chain_armor_jacket_purple.png differ diff --git a/resources/public/img/slash/TORSO_chain_armor_torso.png b/resources/public/img/slash/TORSO_chain_armor_torso.png new file mode 100644 index 0000000..c4a564e Binary files /dev/null and b/resources/public/img/slash/TORSO_chain_armor_torso.png differ diff --git a/resources/public/img/slash/TORSO_leather_armor_bracers.png b/resources/public/img/slash/TORSO_leather_armor_bracers.png new file mode 100644 index 0000000..9075466 Binary files /dev/null and b/resources/public/img/slash/TORSO_leather_armor_bracers.png differ diff --git a/resources/public/img/slash/TORSO_leather_armor_shirt_white.png b/resources/public/img/slash/TORSO_leather_armor_shirt_white.png new file mode 100644 index 0000000..9ab0d6f Binary files /dev/null and b/resources/public/img/slash/TORSO_leather_armor_shirt_white.png differ diff --git a/resources/public/img/slash/TORSO_leather_armor_shoulders.png b/resources/public/img/slash/TORSO_leather_armor_shoulders.png new file mode 100644 index 0000000..672e837 Binary files /dev/null and b/resources/public/img/slash/TORSO_leather_armor_shoulders.png differ diff --git a/resources/public/img/slash/TORSO_leather_armor_torso.png b/resources/public/img/slash/TORSO_leather_armor_torso.png new file mode 100644 index 0000000..06f4d9b Binary files /dev/null and b/resources/public/img/slash/TORSO_leather_armor_torso.png differ diff --git a/resources/public/img/slash/TORSO_plate_armor_arms_shoulders.png b/resources/public/img/slash/TORSO_plate_armor_arms_shoulders.png new file mode 100644 index 0000000..ab09b30 Binary files /dev/null and b/resources/public/img/slash/TORSO_plate_armor_arms_shoulders.png differ diff --git a/resources/public/img/slash/TORSO_plate_armor_torso.png b/resources/public/img/slash/TORSO_plate_armor_torso.png new file mode 100644 index 0000000..0d997e2 Binary files /dev/null and b/resources/public/img/slash/TORSO_plate_armor_torso.png differ diff --git a/resources/public/img/slash/TORSO_robe_shirt_brown.png b/resources/public/img/slash/TORSO_robe_shirt_brown.png new file mode 100644 index 0000000..075cea1 Binary files /dev/null and b/resources/public/img/slash/TORSO_robe_shirt_brown.png differ diff --git a/resources/public/img/slash/WEAPON_dagger.png b/resources/public/img/slash/WEAPON_dagger.png new file mode 100644 index 0000000..b5d5526 Binary files /dev/null and b/resources/public/img/slash/WEAPON_dagger.png differ diff --git a/resources/public/img/spellcast/BEHIND_quiver.png b/resources/public/img/spellcast/BEHIND_quiver.png new file mode 100644 index 0000000..05ad518 Binary files /dev/null and b/resources/public/img/spellcast/BEHIND_quiver.png differ diff --git a/resources/public/img/spellcast/BELT_leather.png b/resources/public/img/spellcast/BELT_leather.png new file mode 100644 index 0000000..06dec90 Binary files /dev/null and b/resources/public/img/spellcast/BELT_leather.png differ diff --git a/resources/public/img/spellcast/BELT_rope.png b/resources/public/img/spellcast/BELT_rope.png new file mode 100644 index 0000000..545ce6a Binary files /dev/null and b/resources/public/img/spellcast/BELT_rope.png differ diff --git a/resources/public/img/spellcast/BODY_male.png b/resources/public/img/spellcast/BODY_male.png new file mode 100644 index 0000000..0e48ce9 Binary files /dev/null and b/resources/public/img/spellcast/BODY_male.png differ diff --git a/resources/public/img/spellcast/BODY_skeleton.png b/resources/public/img/spellcast/BODY_skeleton.png new file mode 100644 index 0000000..97b7e32 Binary files /dev/null and b/resources/public/img/spellcast/BODY_skeleton.png differ diff --git a/resources/public/img/spellcast/FEET_plate_armor_shoes.png b/resources/public/img/spellcast/FEET_plate_armor_shoes.png new file mode 100644 index 0000000..00d4ff7 Binary files /dev/null and b/resources/public/img/spellcast/FEET_plate_armor_shoes.png differ diff --git a/resources/public/img/spellcast/FEET_shoes_brown.png b/resources/public/img/spellcast/FEET_shoes_brown.png new file mode 100644 index 0000000..68551bf Binary files /dev/null and b/resources/public/img/spellcast/FEET_shoes_brown.png differ diff --git a/resources/public/img/spellcast/HANDS_plate_armor_gloves.png b/resources/public/img/spellcast/HANDS_plate_armor_gloves.png new file mode 100644 index 0000000..e0c427c Binary files /dev/null and b/resources/public/img/spellcast/HANDS_plate_armor_gloves.png differ diff --git a/resources/public/img/spellcast/HEAD_chain_armor_helmet.png b/resources/public/img/spellcast/HEAD_chain_armor_helmet.png new file mode 100644 index 0000000..f3dbd10 Binary files /dev/null and b/resources/public/img/spellcast/HEAD_chain_armor_helmet.png differ diff --git a/resources/public/img/spellcast/HEAD_chain_armor_hood.png b/resources/public/img/spellcast/HEAD_chain_armor_hood.png new file mode 100644 index 0000000..06323f2 Binary files /dev/null and b/resources/public/img/spellcast/HEAD_chain_armor_hood.png differ diff --git a/resources/public/img/spellcast/HEAD_hair_blonde.png b/resources/public/img/spellcast/HEAD_hair_blonde.png new file mode 100644 index 0000000..4bc6976 Binary files /dev/null and b/resources/public/img/spellcast/HEAD_hair_blonde.png differ diff --git a/resources/public/img/spellcast/HEAD_leather_armor_hat.png b/resources/public/img/spellcast/HEAD_leather_armor_hat.png new file mode 100644 index 0000000..521ee25 Binary files /dev/null and b/resources/public/img/spellcast/HEAD_leather_armor_hat.png differ diff --git a/resources/public/img/spellcast/HEAD_plate_armor_helmet.png b/resources/public/img/spellcast/HEAD_plate_armor_helmet.png new file mode 100644 index 0000000..78e83ef Binary files /dev/null and b/resources/public/img/spellcast/HEAD_plate_armor_helmet.png differ diff --git a/resources/public/img/spellcast/HEAD_robe_hood.png b/resources/public/img/spellcast/HEAD_robe_hood.png new file mode 100644 index 0000000..3382afa Binary files /dev/null and b/resources/public/img/spellcast/HEAD_robe_hood.png differ diff --git a/resources/public/img/spellcast/HEAD_skeleton_eye_glow.png b/resources/public/img/spellcast/HEAD_skeleton_eye_glow.png new file mode 100644 index 0000000..f883241 Binary files /dev/null and b/resources/public/img/spellcast/HEAD_skeleton_eye_glow.png differ diff --git a/resources/public/img/spellcast/LEGS_pants_greenish.png b/resources/public/img/spellcast/LEGS_pants_greenish.png new file mode 100644 index 0000000..8934b45 Binary files /dev/null and b/resources/public/img/spellcast/LEGS_pants_greenish.png differ diff --git a/resources/public/img/spellcast/LEGS_plate_armor_pants.png b/resources/public/img/spellcast/LEGS_plate_armor_pants.png new file mode 100644 index 0000000..2075184 Binary files /dev/null and b/resources/public/img/spellcast/LEGS_plate_armor_pants.png differ diff --git a/resources/public/img/spellcast/LEGS_robe_skirt.png b/resources/public/img/spellcast/LEGS_robe_skirt.png new file mode 100644 index 0000000..b5f4d99 Binary files /dev/null and b/resources/public/img/spellcast/LEGS_robe_skirt.png differ diff --git a/resources/public/img/spellcast/TORSO_chain_armor_jacket_purple.png b/resources/public/img/spellcast/TORSO_chain_armor_jacket_purple.png new file mode 100644 index 0000000..42fa918 Binary files /dev/null and b/resources/public/img/spellcast/TORSO_chain_armor_jacket_purple.png differ diff --git a/resources/public/img/spellcast/TORSO_chain_armor_torso.png b/resources/public/img/spellcast/TORSO_chain_armor_torso.png new file mode 100644 index 0000000..a7d39e9 Binary files /dev/null and b/resources/public/img/spellcast/TORSO_chain_armor_torso.png differ diff --git a/resources/public/img/spellcast/TORSO_leather_armor_bracers.png b/resources/public/img/spellcast/TORSO_leather_armor_bracers.png new file mode 100644 index 0000000..dbf5dfa Binary files /dev/null and b/resources/public/img/spellcast/TORSO_leather_armor_bracers.png differ diff --git a/resources/public/img/spellcast/TORSO_leather_armor_shirt_white.png b/resources/public/img/spellcast/TORSO_leather_armor_shirt_white.png new file mode 100644 index 0000000..adcf6f5 Binary files /dev/null and b/resources/public/img/spellcast/TORSO_leather_armor_shirt_white.png differ diff --git a/resources/public/img/spellcast/TORSO_leather_armor_shoulders.png b/resources/public/img/spellcast/TORSO_leather_armor_shoulders.png new file mode 100644 index 0000000..5c3cdd0 Binary files /dev/null and b/resources/public/img/spellcast/TORSO_leather_armor_shoulders.png differ diff --git a/resources/public/img/spellcast/TORSO_leather_armor_torso.png b/resources/public/img/spellcast/TORSO_leather_armor_torso.png new file mode 100644 index 0000000..1e054d9 Binary files /dev/null and b/resources/public/img/spellcast/TORSO_leather_armor_torso.png differ diff --git a/resources/public/img/spellcast/TORSO_plate_armor_arms_shoulders.png b/resources/public/img/spellcast/TORSO_plate_armor_arms_shoulders.png new file mode 100644 index 0000000..9c80d03 Binary files /dev/null and b/resources/public/img/spellcast/TORSO_plate_armor_arms_shoulders.png differ diff --git a/resources/public/img/spellcast/TORSO_plate_armor_torso.png b/resources/public/img/spellcast/TORSO_plate_armor_torso.png new file mode 100644 index 0000000..56d7b9a Binary files /dev/null and b/resources/public/img/spellcast/TORSO_plate_armor_torso.png differ diff --git a/resources/public/img/spellcast/TORSO_robe_shirt_brown.png b/resources/public/img/spellcast/TORSO_robe_shirt_brown.png new file mode 100644 index 0000000..ffd94d8 Binary files /dev/null and b/resources/public/img/spellcast/TORSO_robe_shirt_brown.png differ diff --git a/resources/public/img/thrust/BEHIND_quiver.png b/resources/public/img/thrust/BEHIND_quiver.png new file mode 100644 index 0000000..8164834 Binary files /dev/null and b/resources/public/img/thrust/BEHIND_quiver.png differ diff --git a/resources/public/img/thrust/BELT_leather.png b/resources/public/img/thrust/BELT_leather.png new file mode 100644 index 0000000..929adc6 Binary files /dev/null and b/resources/public/img/thrust/BELT_leather.png differ diff --git a/resources/public/img/thrust/BELT_rope.png b/resources/public/img/thrust/BELT_rope.png new file mode 100644 index 0000000..02e1f5a Binary files /dev/null and b/resources/public/img/thrust/BELT_rope.png differ diff --git a/resources/public/img/thrust/BODY_animation.png b/resources/public/img/thrust/BODY_animation.png new file mode 100644 index 0000000..d8b2caf Binary files /dev/null and b/resources/public/img/thrust/BODY_animation.png differ diff --git a/resources/public/img/thrust/FEET_plate_armor_shoes.png b/resources/public/img/thrust/FEET_plate_armor_shoes.png new file mode 100644 index 0000000..748e57c Binary files /dev/null and b/resources/public/img/thrust/FEET_plate_armor_shoes.png differ diff --git a/resources/public/img/thrust/FEET_shoes_brown.png b/resources/public/img/thrust/FEET_shoes_brown.png new file mode 100644 index 0000000..472e549 Binary files /dev/null and b/resources/public/img/thrust/FEET_shoes_brown.png differ diff --git a/resources/public/img/thrust/HANDS_plate_armor_gloves.png b/resources/public/img/thrust/HANDS_plate_armor_gloves.png new file mode 100644 index 0000000..56f216e Binary files /dev/null and b/resources/public/img/thrust/HANDS_plate_armor_gloves.png differ diff --git a/resources/public/img/thrust/HEAD_chain_armor_helmet.png b/resources/public/img/thrust/HEAD_chain_armor_helmet.png new file mode 100644 index 0000000..fa95e9e Binary files /dev/null and b/resources/public/img/thrust/HEAD_chain_armor_helmet.png differ diff --git a/resources/public/img/thrust/HEAD_chain_armor_hood.png b/resources/public/img/thrust/HEAD_chain_armor_hood.png new file mode 100644 index 0000000..3ce4986 Binary files /dev/null and b/resources/public/img/thrust/HEAD_chain_armor_hood.png differ diff --git a/resources/public/img/thrust/HEAD_hair_blonde.png b/resources/public/img/thrust/HEAD_hair_blonde.png new file mode 100644 index 0000000..c83af32 Binary files /dev/null and b/resources/public/img/thrust/HEAD_hair_blonde.png differ diff --git a/resources/public/img/thrust/HEAD_leather_armor_hat.png b/resources/public/img/thrust/HEAD_leather_armor_hat.png new file mode 100644 index 0000000..cc4c683 Binary files /dev/null and b/resources/public/img/thrust/HEAD_leather_armor_hat.png differ diff --git a/resources/public/img/thrust/HEAD_plate_armor_helmet.png b/resources/public/img/thrust/HEAD_plate_armor_helmet.png new file mode 100644 index 0000000..a4084f8 Binary files /dev/null and b/resources/public/img/thrust/HEAD_plate_armor_helmet.png differ diff --git a/resources/public/img/thrust/HEAD_robe_hood.png b/resources/public/img/thrust/HEAD_robe_hood.png new file mode 100644 index 0000000..82f5005 Binary files /dev/null and b/resources/public/img/thrust/HEAD_robe_hood.png differ diff --git a/resources/public/img/thrust/LEGS_pants_greenish.png b/resources/public/img/thrust/LEGS_pants_greenish.png new file mode 100644 index 0000000..6f0879e Binary files /dev/null and b/resources/public/img/thrust/LEGS_pants_greenish.png differ diff --git a/resources/public/img/thrust/LEGS_plate_armor_pants.png b/resources/public/img/thrust/LEGS_plate_armor_pants.png new file mode 100644 index 0000000..526f7b5 Binary files /dev/null and b/resources/public/img/thrust/LEGS_plate_armor_pants.png differ diff --git a/resources/public/img/thrust/LEGS_robe_skirt.png b/resources/public/img/thrust/LEGS_robe_skirt.png new file mode 100644 index 0000000..99f1bdb Binary files /dev/null and b/resources/public/img/thrust/LEGS_robe_skirt.png differ diff --git a/resources/public/img/thrust/TORSO_chain_armor_jacket_purple.png b/resources/public/img/thrust/TORSO_chain_armor_jacket_purple.png new file mode 100644 index 0000000..5a06332 Binary files /dev/null and b/resources/public/img/thrust/TORSO_chain_armor_jacket_purple.png differ diff --git a/resources/public/img/thrust/TORSO_chain_armor_torso.png b/resources/public/img/thrust/TORSO_chain_armor_torso.png new file mode 100644 index 0000000..678f5db Binary files /dev/null and b/resources/public/img/thrust/TORSO_chain_armor_torso.png differ diff --git a/resources/public/img/thrust/TORSO_leather_armor_bracers.png b/resources/public/img/thrust/TORSO_leather_armor_bracers.png new file mode 100644 index 0000000..137314d Binary files /dev/null and b/resources/public/img/thrust/TORSO_leather_armor_bracers.png differ diff --git a/resources/public/img/thrust/TORSO_leather_armor_shirt_white.png b/resources/public/img/thrust/TORSO_leather_armor_shirt_white.png new file mode 100644 index 0000000..5a1ff92 Binary files /dev/null and b/resources/public/img/thrust/TORSO_leather_armor_shirt_white.png differ diff --git a/resources/public/img/thrust/TORSO_leather_armor_shoulders.png b/resources/public/img/thrust/TORSO_leather_armor_shoulders.png new file mode 100644 index 0000000..188fe37 Binary files /dev/null and b/resources/public/img/thrust/TORSO_leather_armor_shoulders.png differ diff --git a/resources/public/img/thrust/TORSO_leather_armor_torso.png b/resources/public/img/thrust/TORSO_leather_armor_torso.png new file mode 100644 index 0000000..ceb143c Binary files /dev/null and b/resources/public/img/thrust/TORSO_leather_armor_torso.png differ diff --git a/resources/public/img/thrust/TORSO_plate_armor_arms_shoulders.png b/resources/public/img/thrust/TORSO_plate_armor_arms_shoulders.png new file mode 100644 index 0000000..3c8e663 Binary files /dev/null and b/resources/public/img/thrust/TORSO_plate_armor_arms_shoulders.png differ diff --git a/resources/public/img/thrust/TORSO_plate_armor_torso.png b/resources/public/img/thrust/TORSO_plate_armor_torso.png new file mode 100644 index 0000000..2b8b63a Binary files /dev/null and b/resources/public/img/thrust/TORSO_plate_armor_torso.png differ diff --git a/resources/public/img/thrust/TORSO_robe_shirt_brown.png b/resources/public/img/thrust/TORSO_robe_shirt_brown.png new file mode 100644 index 0000000..11e8b1d Binary files /dev/null and b/resources/public/img/thrust/TORSO_robe_shirt_brown.png differ diff --git a/resources/public/img/thrust/WEAPON_shield_cutout_body.png b/resources/public/img/thrust/WEAPON_shield_cutout_body.png new file mode 100644 index 0000000..d16fe93 Binary files /dev/null and b/resources/public/img/thrust/WEAPON_shield_cutout_body.png differ diff --git a/resources/public/img/thrust/WEAPON_shield_cutout_chain_armor_helmet.png b/resources/public/img/thrust/WEAPON_shield_cutout_chain_armor_helmet.png new file mode 100644 index 0000000..15e5ab6 Binary files /dev/null and b/resources/public/img/thrust/WEAPON_shield_cutout_chain_armor_helmet.png differ diff --git a/resources/public/img/thrust/WEAPON_spear.png b/resources/public/img/thrust/WEAPON_spear.png new file mode 100644 index 0000000..9eab3c9 Binary files /dev/null and b/resources/public/img/thrust/WEAPON_spear.png differ diff --git a/resources/public/img/thrust/WEAPON_staff.png b/resources/public/img/thrust/WEAPON_staff.png new file mode 100644 index 0000000..7e3d4f0 Binary files /dev/null and b/resources/public/img/thrust/WEAPON_staff.png differ diff --git a/resources/public/img/walkcycle/BEHIND_quiver.png b/resources/public/img/walkcycle/BEHIND_quiver.png new file mode 100644 index 0000000..b8ad8a0 Binary files /dev/null and b/resources/public/img/walkcycle/BEHIND_quiver.png differ diff --git a/resources/public/img/walkcycle/BELT_leather.png b/resources/public/img/walkcycle/BELT_leather.png new file mode 100644 index 0000000..3270510 Binary files /dev/null and b/resources/public/img/walkcycle/BELT_leather.png differ diff --git a/resources/public/img/walkcycle/BELT_rope.png b/resources/public/img/walkcycle/BELT_rope.png new file mode 100644 index 0000000..2974dba Binary files /dev/null and b/resources/public/img/walkcycle/BELT_rope.png differ diff --git a/resources/public/img/walkcycle/BODY_male.png b/resources/public/img/walkcycle/BODY_male.png new file mode 100644 index 0000000..dd23ddc Binary files /dev/null and b/resources/public/img/walkcycle/BODY_male.png differ diff --git a/resources/public/img/walkcycle/BODY_skeleton.png b/resources/public/img/walkcycle/BODY_skeleton.png new file mode 100644 index 0000000..0a3cef3 Binary files /dev/null and b/resources/public/img/walkcycle/BODY_skeleton.png differ diff --git a/resources/public/img/walkcycle/FEET_plate_armor_shoes.png b/resources/public/img/walkcycle/FEET_plate_armor_shoes.png new file mode 100644 index 0000000..638228e Binary files /dev/null and b/resources/public/img/walkcycle/FEET_plate_armor_shoes.png differ diff --git a/resources/public/img/walkcycle/FEET_shoes_brown.png b/resources/public/img/walkcycle/FEET_shoes_brown.png new file mode 100644 index 0000000..b717b1d Binary files /dev/null and b/resources/public/img/walkcycle/FEET_shoes_brown.png differ diff --git a/resources/public/img/walkcycle/HANDS_plate_armor_gloves.png b/resources/public/img/walkcycle/HANDS_plate_armor_gloves.png new file mode 100644 index 0000000..0d8f156 Binary files /dev/null and b/resources/public/img/walkcycle/HANDS_plate_armor_gloves.png differ diff --git a/resources/public/img/walkcycle/HEAD_chain_armor_helmet.png b/resources/public/img/walkcycle/HEAD_chain_armor_helmet.png new file mode 100644 index 0000000..8e90004 Binary files /dev/null and b/resources/public/img/walkcycle/HEAD_chain_armor_helmet.png differ diff --git a/resources/public/img/walkcycle/HEAD_chain_armor_hood.png b/resources/public/img/walkcycle/HEAD_chain_armor_hood.png new file mode 100644 index 0000000..7286f08 Binary files /dev/null and b/resources/public/img/walkcycle/HEAD_chain_armor_hood.png differ diff --git a/resources/public/img/walkcycle/HEAD_hair_blonde.png b/resources/public/img/walkcycle/HEAD_hair_blonde.png new file mode 100644 index 0000000..db59026 Binary files /dev/null and b/resources/public/img/walkcycle/HEAD_hair_blonde.png differ diff --git a/resources/public/img/walkcycle/HEAD_leather_armor_hat.png b/resources/public/img/walkcycle/HEAD_leather_armor_hat.png new file mode 100644 index 0000000..6f6448b Binary files /dev/null and b/resources/public/img/walkcycle/HEAD_leather_armor_hat.png differ diff --git a/resources/public/img/walkcycle/HEAD_plate_armor_helmet.png b/resources/public/img/walkcycle/HEAD_plate_armor_helmet.png new file mode 100644 index 0000000..629adf8 Binary files /dev/null and b/resources/public/img/walkcycle/HEAD_plate_armor_helmet.png differ diff --git a/resources/public/img/walkcycle/HEAD_robe_hood.png b/resources/public/img/walkcycle/HEAD_robe_hood.png new file mode 100644 index 0000000..101ac51 Binary files /dev/null and b/resources/public/img/walkcycle/HEAD_robe_hood.png differ diff --git a/resources/public/img/walkcycle/LEGS_pants_greenish.png b/resources/public/img/walkcycle/LEGS_pants_greenish.png new file mode 100644 index 0000000..9476747 Binary files /dev/null and b/resources/public/img/walkcycle/LEGS_pants_greenish.png differ diff --git a/resources/public/img/walkcycle/LEGS_plate_armor_pants.png b/resources/public/img/walkcycle/LEGS_plate_armor_pants.png new file mode 100644 index 0000000..5b4b170 Binary files /dev/null and b/resources/public/img/walkcycle/LEGS_plate_armor_pants.png differ diff --git a/resources/public/img/walkcycle/LEGS_robe_skirt.png b/resources/public/img/walkcycle/LEGS_robe_skirt.png new file mode 100644 index 0000000..d547cc6 Binary files /dev/null and b/resources/public/img/walkcycle/LEGS_robe_skirt.png differ diff --git a/resources/public/img/walkcycle/TORSO_chain_armor_jacket_purple.png b/resources/public/img/walkcycle/TORSO_chain_armor_jacket_purple.png new file mode 100644 index 0000000..f64c0d4 Binary files /dev/null and b/resources/public/img/walkcycle/TORSO_chain_armor_jacket_purple.png differ diff --git a/resources/public/img/walkcycle/TORSO_chain_armor_torso.png b/resources/public/img/walkcycle/TORSO_chain_armor_torso.png new file mode 100644 index 0000000..9b99dcf Binary files /dev/null and b/resources/public/img/walkcycle/TORSO_chain_armor_torso.png differ diff --git a/resources/public/img/walkcycle/TORSO_leather_armor_bracers.png b/resources/public/img/walkcycle/TORSO_leather_armor_bracers.png new file mode 100644 index 0000000..a189e7d Binary files /dev/null and b/resources/public/img/walkcycle/TORSO_leather_armor_bracers.png differ diff --git a/resources/public/img/walkcycle/TORSO_leather_armor_shirt_white.png b/resources/public/img/walkcycle/TORSO_leather_armor_shirt_white.png new file mode 100644 index 0000000..082d82b Binary files /dev/null and b/resources/public/img/walkcycle/TORSO_leather_armor_shirt_white.png differ diff --git a/resources/public/img/walkcycle/TORSO_leather_armor_shoulders.png b/resources/public/img/walkcycle/TORSO_leather_armor_shoulders.png new file mode 100644 index 0000000..2afd603 Binary files /dev/null and b/resources/public/img/walkcycle/TORSO_leather_armor_shoulders.png differ diff --git a/resources/public/img/walkcycle/TORSO_leather_armor_torso.png b/resources/public/img/walkcycle/TORSO_leather_armor_torso.png new file mode 100644 index 0000000..5ae3239 Binary files /dev/null and b/resources/public/img/walkcycle/TORSO_leather_armor_torso.png differ diff --git a/resources/public/img/walkcycle/TORSO_plate_armor_arms_shoulders.png b/resources/public/img/walkcycle/TORSO_plate_armor_arms_shoulders.png new file mode 100644 index 0000000..1b6751a Binary files /dev/null and b/resources/public/img/walkcycle/TORSO_plate_armor_arms_shoulders.png differ diff --git a/resources/public/img/walkcycle/TORSO_plate_armor_torso.png b/resources/public/img/walkcycle/TORSO_plate_armor_torso.png new file mode 100644 index 0000000..f8402af Binary files /dev/null and b/resources/public/img/walkcycle/TORSO_plate_armor_torso.png differ diff --git a/resources/public/img/walkcycle/TORSO_robe_shirt_brown.png b/resources/public/img/walkcycle/TORSO_robe_shirt_brown.png new file mode 100644 index 0000000..039de14 Binary files /dev/null and b/resources/public/img/walkcycle/TORSO_robe_shirt_brown.png differ diff --git a/resources/public/img/walkcycle/WEAPON_shield_cutout_body.png b/resources/public/img/walkcycle/WEAPON_shield_cutout_body.png new file mode 100644 index 0000000..0194f20 Binary files /dev/null and b/resources/public/img/walkcycle/WEAPON_shield_cutout_body.png differ diff --git a/resources/public/img/walkcycle/WEAPON_shield_cutout_chain_armor_helmet.png b/resources/public/img/walkcycle/WEAPON_shield_cutout_chain_armor_helmet.png new file mode 100644 index 0000000..14f0d28 Binary files /dev/null and b/resources/public/img/walkcycle/WEAPON_shield_cutout_chain_armor_helmet.png differ diff --git a/resources/public/img/walkcycle/hero-awesome.png b/resources/public/img/walkcycle/hero-awesome.png new file mode 100644 index 0000000..0a1aa18 Binary files /dev/null and b/resources/public/img/walkcycle/hero-awesome.png differ diff --git a/resources/public/index.html b/resources/public/index.html index f568c1c..e362405 100644 --- a/resources/public/index.html +++ b/resources/public/index.html @@ -1,9 +1,13 @@
- + + + diff --git a/src/cljs/topdown2d/core.cljs b/src/cljs/topdown2d/core.cljs index 7d9ca8a..e967971 100644 --- a/src/cljs/topdown2d/core.cljs +++ b/src/cljs/topdown2d/core.cljs @@ -7,7 +7,7 @@ (def gamestate { :canvas (.getElementById js/document "gamecanvas") - :2d (.getContext (.getElementById js/document "gamecanvas") "2d") + :ctx (.getContext (.getElementById js/document "gamecanvas") "2d") :target-fps 30 :timing { ; msecs of previous frame @@ -36,7 +36,7 @@ } }) -(aset (:2d gamestate) "font" "10px monospace") +(aset (:ctx gamestate) "font" "10px monospace") (defn set-timing "sets the current time at the given key" @@ -85,12 +85,12 @@ (defn draw-step "clears the canvas, draws fps and invokes the scene draw function" [gamestate] - (.clearRect (:2d gamestate) + (.clearRect (:ctx gamestate) 0 0 (get-in gamestate [:dimensions :w]) (get-in gamestate [:dimensions :h])) (.fillText - (:2d gamestate) + (:ctx gamestate) (int (get-in gamestate [:timing :fps])) 0 10) (let [scenekey (:scene gamestate) diff --git a/src/cljs/topdown2d/demoscene.cljs b/src/cljs/topdown2d/demoscene.cljs index 95da4ea..9e6b192 100644 --- a/src/cljs/topdown2d/demoscene.cljs +++ b/src/cljs/topdown2d/demoscene.cljs @@ -1,58 +1,59 @@ (ns topdown2d.demoscene (:require [topdown2d.objects :as objects] - [topdown2d.input :as input])) + [topdown2d.input :as input] + [topdown2d.sprites :as sprites])) (defn init [gamestate scenedata] (assoc scenedata - :data - { - :bumper - { + :data { + :bumper { :x 100 :y 80 :w 50 :h 50 } - :box - { - :x 5 - :y 5 - :w 10 - :h 10 + :player { + :x 0 :y 0 + :w 64 :h 64 :pps 150 :d :? - :color :black + :sprite { + :image (.getElementById js/document "player") + :size 64 + :d :s + :rows { + :w 1 :e 3 + :n 0 :s 2 + :? 2 + } + :cycle { + :count 8 + :from 1 + :pos 0 + ; seconds per cycle + :spc 0.08 + :last-cycle 0 + } + } } })) (defn update-scene [gamestate scenedata] - (let [box (get-in scenedata [:data :box]) - bumper (get-in scenedata [:data :bumper]) - dir (input/dirinput) - box (assoc box :d dir) - mbox (objects/move-inside-gamestate - gamestate - box)] + (let [player (get-in scenedata [:data :player]) + dir (input/dirinput :?) + player (assoc-in player + [:sprite :d] + dir) + player (sprites/proc-cycle gamestate player)] (assoc-in scenedata - [:data :box] - (if (objects/collide? mbox bumper) - (-> box - (objects/bump-into bumper) - (assoc :color :red)) - (assoc mbox :color :black))))) + [:data :player] + player))) (defn draw-scene [gamestate scenedata] - (let [{{:keys [bumper box]} :data} scenedata - ctx (:2d gamestate)] + (let [{{:keys [bumper player]} :data} scenedata + ctx (:ctx gamestate)] (let [{:keys [x y w h]} bumper] (.fillRect ctx x y w h)) - (let [{:keys [x y w h color]} box - ctx (:2d gamestate)] - (aset ctx "strokeStyle" - (if (= :red color) - "red" - "black")) - (.strokeRect ctx - x y w h)))) + (sprites/draw gamestate player))) diff --git a/src/cljs/topdown2d/input.cljs b/src/cljs/topdown2d/input.cljs index 9d06b88..13ad099 100644 --- a/src/cljs/topdown2d/input.cljs +++ b/src/cljs/topdown2d/input.cljs @@ -18,10 +18,10 @@ #(assoc % (.-code event) false)) false)) -(defn dirinput [] +(defn dirinput [defdir] (cond (keydown? :ArrowLeft) :w (keydown? :ArrowRight) :e (keydown? :ArrowUp) :n (keydown? :ArrowDown) :s - :else :?)) + :else defdir)) diff --git a/src/cljs/topdown2d/sprites.cljs b/src/cljs/topdown2d/sprites.cljs new file mode 100644 index 0000000..4507827 --- /dev/null +++ b/src/cljs/topdown2d/sprites.cljs @@ -0,0 +1,45 @@ +(ns topdown2d.sprites) + +(defn proc-cycle [gamestate obj] + (let [sprite (:sprite obj) + sprite-cycle (:cycle sprite) + maxpos (:count sprite-cycle) + {:keys [pos spc last-cycle]} sprite-cycle + elapsed (get-in gamestate [:timing :elapsed])] + ; new sprite frame? + (if (> (+ last-cycle elapsed) spc) + ; start cycle from new? + ; reset last-cycle + (assoc-in + (if (> (inc pos) maxpos) + ; restart cycle + (assoc-in obj + [:sprite :cycle :pos] + (:from sprite-cycle)) + ; run cycle + (update-in obj + [:sprite :cycle :pos] + inc)) + [:sprite :cycle :last-cycle] + 0) + (update-in obj + [:sprite :cycle :last-cycle] + #(+ % elapsed))))) + +(defn pos-in-sprite [sprite] + (let [{:keys [d size rows]} sprite + pos (get-in sprite [:cycle :pos]) + row (d rows)] + {:y (* row size) :x (* pos size)})) + +(defn draw [gamestate obj] + (let [{:keys [x y w h d sprite]} obj + image (:image sprite) + sprite-size (:size sprite) + {:keys [ctx]} gamestate + sprite-cycle (:cycle sprite) + pos (pos-in-sprite sprite)] + (.drawImage ctx + image + (:x pos) (:y pos) sprite-size sprite-size + x y sprite-size sprite-size)))