amatt13 / amatt13/BossFight

Change how damage is drawn on the canvas

未关闭
#26 0 条评论 0 个 reaction 已指派 1 人 已被 @Vukong55 认领 在 GitHub 查看
Front End
主要语言
C#
星标
1
派生
1
PR 合并指标
30 天内没有已合并 PR

描述

Instead of using the timeout function to only sometimes display the damage text, we should instead draw it every frame.

Scrap the old code in the canvas for how damage text is shown.
Instead, create a new list that contains dmg txt "instructions".
Whenever a target is damaged, a new instruction will be added to the list of instructions.

A instruction should contain, the damage number, the target (monster/player), and the _animation_.
The _animation_ is a list of coordinates for which the text must follow. For every frame, the text must take the next coordinate from the animation. The instruction should be removed from the list of instructions when no more coordinates are left.

Example instruction list:
[
{"dmg": "12", "target": "active_monster", "animation_list": [(10,-18), (11, -20), ....]},
{"dmg": "9", "target": "active_monster", "animation_list": [(27,-1), (25, 0), ....]},
{"dmg": "9", "target": "player", "animation_list": [(10,10), (10, 8), ....]},
]

We should either have an additional animation- counter/index field in the instruction that dictates which coordinate to use next, or maybe pop the list to get the front on. Whatever is the easiest to do.

Every frame, the canvas must add a text object for every damage instruction in the instructions list.
This allows us to have multiple damage texts on the canvas at once.

The animation should do an arc like this
![image](https://user-images.githubusercontent.com/5380188/220898614-b5c4760f-3928-44b4-b0e4-89bf64f143d4.png)
Formula: f(x)=x+x(2-x)-x3+2 WHERE 0

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。