jmmk / clash-attack-sim

https://jmmk.github.io/clash-attack-sim/
Other
3 stars 1 forks source link

hp bars #10

Closed jmmk closed 9 years ago

jmmk commented 9 years ago

New entity that shares the hp component of another entity and is positioned at top of it

jmmk commented 9 years ago

Need to have a base hp field in component in order to calculate %. Separate HP from attackable so that hp entities don't show up in targeting. Need to find top left of the entity to which the health bar belongs. Set the anchor of the hp bar to bottom left and set it's position to the same x,y.

See https://github.com/johntrimble/asteroids/blob/master/src/cljs/asteroids/health.cljs for an example of how he draws the rectangles

jmmk commented 9 years ago

implemented as health-bar component