Why is a “main” game loop necessary for developing a game?

前端 未结 11 1899
自闭症患者
自闭症患者 2020-12-23 13:52

I find that most game development requires a main game loop, but I don\'t know why it\'s necessary. Couldn\'t we implement an event listener and respond to every user action

11条回答
  •  滥情空心
    2020-12-23 14:28

    Any program that can just sit there indefinitely and respond to user's input needs some kind of loop. Otherwise it will just reach the end of program and will exit.

提交回复
热议问题