How to handle many updating objects efficiently in C#?

后端 未结 6 1169
感情败类
感情败类 2021-01-05 00:34

I\'m developing a 2D overhead shooter game using C# and XNA. I have a class that I\'ll call \"bullet\" and need to update many of these instances every fraction of a second.

6条回答
  •  自闭症患者
    2021-01-05 01:08

    You are correct in assuming that by keeping the unused Bullets in a Stack prevents them from being Garbage Collected.

    As for the cause of the Lag, have you tried any profiling tools? Just to find where the problem is.

提交回复
热议问题