Hacker News new | past | comments | ask | show | jobs | submit login

For a simple game it seems like you could get away with vectors of mutable structs. This looks like ECS where one entity has a single component and there are only a few systems that update them (update, draw). For simple games you can do the old-school arcade style model with memory allocated upfront for everything (giant mutable gamestate struct) which was called out as not scalable in the talk but it worked for countless classic console and arcade games and scales all the way to Call of Duty. Another option is to avoid mutation and go for a functional style where you return a new game state struct after update (drawing probably shouldn't need to mutate), which might not scale for large games but is completely reasonable for small games without much state.

I suppose you can have a giant game state and return a new immutable copy on every frame if the amount of change is small, and you reuse most of the unchanged state.

Applications are open for YC Winter 2020

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact