Smooth fast move and repaint()

后端 未结 2 784
天涯浪人
天涯浪人 2021-01-15 10:52

I\'m writing easy space invaders and have a problem with moving ship. Basically I change position of ship and then repaint(). If the change is big it is more li

2条回答
  •  渐次进展
    2021-01-15 11:35

    Please post some code? Is the whole game running inside a canvas or is every ship a JComponent? For games I would use JavaFX or a game engine like http://jmonkeyengine.com. To create smooth animations in Swing you can use a animation framework:

    • http://java.net/projects/timingframework
    • http://kenai.com/projects/trident/pages/Home

提交回复
热议问题