Hacker News new | ask | show | jobs
by rishav_sharan 2072 days ago
Its been a while, so I might be saying it wrong but, I was trying to create an entity collection. Essentially, a super basic scene graph. on every tick in my update call, i would update something about a specific entity in that collection (maybe position, transform etc). And then in my draw call I would render the entire updated collection. Just getting a specific entity from the list was a huge issue and then updating it and putting it back was worse. I gave up after a many days of trying something as basic as this. In JS, Nim, Crystal etc. this would have taken me a couple of lines of code.

Here I ended up reading bid docs on something called Lens and was never able to apply it correctly. here is the repo i was working on https://github.com/rishavs/coral/blob/master/Engine.fs

1 comments

> Just getting a specific entity from the list was a huge issue and then updating it and putting it back was worse.

I must be missing something, but this sounds like a pretty straightforward List.map

Needed to get that by entity id, so its a Hash.