How to avoid this NullPointerException

前端 未结 3 1009
礼貌的吻别
礼貌的吻别 2021-01-23 02:30

I\'m working on a small arcade video game, and I am looking to double buffer to improve animation. I have one class that\'s supposed to draw the blank image, and another class t

3条回答
  •  醉酒成梦
    2021-01-23 02:44

    You're calling dbg on the this instance, not the instance of render.

    You need to change it to

    render.dbg.drawLine(....)
    

    Alternatively, if you wanted to leave the dbg call the same, you could call

    this.gameRender();
    

    first and then call

    dbg.drawLine(...);
    

提交回复
热议问题