search

Home  >  Q&A  >  body text

cocos2d-x - How to set timer in MVC pattern?

Recently I am trying to develop a Cocos2d-x game using the MVC model. How should the timer (such as the countdown before starting the game) be placed? The countdown int variable must be put into the Model, but where to modify this value? Should we process it in the Model and send an event to notify the Controller after updating the variables? Or should we schedule and modify the variables in the Controller?

phpcn_u1582phpcn_u15822825 days ago556

reply all(1)I'll reply

  • 伊谢尔伦

    伊谢尔伦2017-05-16 17:07:38

    Timer is a logic program and should be written in Controller.

    reply
    0
  • Cancelreply