简体   繁体   English

Slick2d重新启动状态

[英]Slick2d Restarting States

How do you restart a state in slick2d? 如何在slick2d中重新启动状态? When my game ends and when it goes back to the main menu, after I click to play again, it loads the previous state. 当我的游戏结束并且返回主菜单时,在我再次单击播放后,它将加载以前的状态。

You need to override the enter() method. 您需要重写enter()方法。 It is called each time you enter a state. 每次进入状态时都会调用它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM