aMytho / brave-frontier-godot

A simple implementation of Brave Frontier in the Godot Engine
18 stars 8 forks source link

Add weapon effects and equipment to units #33

Closed aMytho closed 1 year ago

aMytho commented 1 year ago

While some spritesheets can be comprised of a single animation, many spritesheets require many different animations. Most sprites have the base character, an attack effect, a shadow (for aerial attacks and movement), and weapons/equipment which are not part of the sprite. Theses will need to be positioned on each character.

My current idea is to add the following properties to the unit_base:

I'm going to try to keep this as minimal as possible to avoid merge conflicts with the battle system. It should be as simple as adding the properties, setting up the new AtlasTextures for each unit, and passing in the values to the field_unit.

aMytho commented 1 year ago

Got the shadows working! https://github.com/aMytho/brave-frontier-godot/assets/58316242/47e39e4b-0db3-4de1-b298-215c29936ce1

The equipment/weapon effects is going to be a little more complicated. I'll probably work more on that tonight.

aMytho commented 1 year ago

I worked on the equipment system, and I think my idea will work. output.webm

We will need to define "equipment" for a unit. This could be a weapon effect, the weapon itself (vargas), armor/a nice hat, or anything else. We add it to the sprite_frames and label it as AttackEquipment or IdleEquipment. The field_unit dynamically creates child sprites for each equipment piece. We also define an array which lists the position, rotation, and z-index of the equipment per frame.

I should have a PR this afternoon.

aMytho commented 1 year ago

Closed in #35 . Units will need to have the new sprites/animations specified. Some units will need an updated spritesheet to fix the bouncing effect.