Author Topic: How to create bullet tracers?  (Read 200 times)

How to create bullet tracers?
« on: April 07, 2018, 10:56:33 am »
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.
« Last Edit: April 08, 2018, 11:21:08 am by Zinthos »

Offline Wipe

  • Rotator
  • Random is god
Re: How to create bullet tracers?
« Reply #1 on: April 11, 2018, 08:22:22 am »
i suppose its DrawPrimitive, but i have no idea how to assign a delay for disappearing and such.

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.
Games are meant to be created, not played...