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

If we’re doing tips, here’s another: don’t use bazillion timers to control your actors lifetime! Timers array gets resorted at every addition and that can really add noticeable lag on slow devices. If you need to, rewrite the add timer method to use an insertio sort instead of adding last then sorting the whole array

(I was using timer instead of collision for bullets since I had the hit/miss outcome coming from a percentage base rile as opposed as game phisycs and expired bullets just at the right time to make them appear misses - maybe not the greatest idea mind you but eh got it working and was cool enough)




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

Search: