How do i get a graphics object in Java?

后端 未结 2 1393
误落风尘
误落风尘 2021-01-23 15:40

Im making a basic space invaders game. I got all the resources from the LWJGL .zip file (Im not using LWJGL librarys to create my game, just got the pictures, etc. from it.) Any

2条回答
  •  孤街浪徒
    2021-01-23 16:07

    The idea is that the listeners should change the state of the game (i.e. create a bullet, or change the location of the bullet, or whatever), and then call repaint(). Then Swing will invoke the paintComponent(Graphics g) method, which will paint the updated game state using the Graphics passed as argument.

提交回复
热议问题