FOnline Development > Questions and Answers
How to create bullet tracers?
(1/1)
Zinthos:
Like on fonline requiem (from vid by vvish):
https://i.imgur.com/Ind21le.mp4
i suppose its DrawPrimitive, but i have no idea how to assign a delay for disappearing and such.
Wipe:
--- Quote from: Zinthos on April 07, 2018, 10:56:33 am ---i suppose its DrawPrimitive, but i have no idea how to assign a delay for disappearing and such.
--- End quote ---
Easiest will be to prepare array where you can hold data for DrawPrimitive() and a timestamp when effect is supposed to disappear. On each render_iface() call, iterate thru that array and simply draw a line from cached data. After that, check if current time >= timestamp; if it is, remove element from array.
As for creating line data, simply collect GetHexPos() for attacker and target; it's drawn for very short time in your example, so you won't need corrections in case of attacker/target movement. I guess render time shouldn't be longer than attack/damage animation time, whichever is shorter.
Navigation
[0] Message Index
Go to full version