Why not just generate all the rotations up front in a associated list and build the bolts based on the list?
This might have to be done on a player by player basis but it might be a decent alternative to generating them all on the fly.
I'm going to go play with this, I was actually thinking of putting something like a skill that allows the player to shoot lightning rods. Then another skill that releases electricity , which is drawn to anything struck with a lightning rod. Thanks for posting
Lightning |
|
generates lines, beams or lightning bolts [More] |
To download this library for your Linux/Mac installation, enter this on your command line:
DreamDownload byond://Rotem12.Lightning##version=12 Emulator users, in the BYOND pager go to File | Open Location and enter this URL:byond://Rotem12.Lightning##version=12 |
Lightning can create a line, beam, lightning bolt or branched lightning bolt between two vectors.
Lightning GitHub This was made following this article. The article can be used for further explanation of how it works. Usage is as simple as: var/vector/start = new (x1 * 32, y1 * 32) // position in pixels Updates: 1.10
1.09
1.08
1.07
1.06
1.05
1.04
1.03
1.02
1.01
For a full list of changes click here. |
Avidanimefan: (Jun 25 2015, 1:28 am)
Rotem12: (Jun 24 2015, 5:27 pm)
Bravo1 wrote:
The problem seems to be exacerbated the closer the destination is to the source. I updated to attempt fix it, the update effects both normal and branched bolts, the segments are positioned slightly different now, I hope it looks better. Aside from that, it also aims to branch out other bolts earlier than it did before, what I think happened was it attempted to branch when it's over 90% close to the end leaving it no room. There's not much point if bolts branch out too late anyway so that should be better now. EDIT: I also toyed with pooling, just pooling segments is not having any impact, I already know how to rotate an entire bolt, I'll work on it more later in hopes pooling entire bolts can help. Bravo1: (Jun 24 2015, 2:56 pm)
I have it running at 60fps. Not sure if that's the cause of the issue or not.
The problem seems to be exacerbated the closer the destination is to the source. Kaiochao: (Jun 24 2015, 2:40 pm)
I remember making a Force Lightning skill for an unreleased Star Wars fan-game years ago. It used Kunark's Line Drawer library and it looked pretty cool for being tile-based. Every couple tiles it would fork, and each segment would be attracted to certain objects like explosive barrels, droids, or other people.
This is much fancier-looking. |
Copyright © 2024 BYOND Software.
All rights reserved.
Because of the new thickness parameter I moved /obj/segment from the demo to the library, the parameter now defaults to /obj/segment, you can still use a different type to generate different results.
I've yet to mess with beam "head", I didn't see much need for it with lightning but it may be nice to do so now.