Problems with Java's Paint method, ridiculous refresh velocity

后端 未结 3 1443
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-27 23:12

I\'m developing a very simple version of R-Type as work for the university, but despite it works, the craft velocity is a lot of slow, so the movement is ugly and clumsy. I

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-27 23:55

    You can find a great example of a similar program here. The example demonstrates creating a new thread and having that thread sleep every iteration through the main loop.

    Here is another question about loading images for games in Java.

    It looks like swing itself is pretty crummy for using images in games. You may want to consider using a more suitable library.

提交回复
热议问题