How to move a Bug in GridWorld with arrow keys

荒凉一梦 提交于 2019-12-04 17:20:00

In the ActorWorld class there is a method boolean keyPressed(String description, Location loc) this method is the for the sole purpose of being overridden in a subclass. description is the KeyStroke in the format found here, and loc is the Location that the cursor was on when the key was pressed. (Although in your case it doesn't matter)

So in short, you should extend KeyPressed in a Custom CharacterWorld extends ActorWorld class.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!