I fixed it! The one mistake I made indeed involved the double buffering. It was not a logic problem in the code. The problem was that the line g.drawImage(offscreen, 0, 0, this); was included in an...
Type: Posts; User: beansnbacon
I fixed it! The one mistake I made indeed involved the double buffering. It was not a logic problem in the code. The problem was that the line g.drawImage(offscreen, 0, 0, this); was included in an...
I am debugging the code now. I'm adding comments, but I'm not updating the code here. The "h" variable is true when the h key is down and false when it is released. This variable is working...
I already did that and I realized that the booleans that activate the menus that don'e appear are not being activated when they're supposed to. In the code, do you see anything wrong with the...
Well, knowing that the variables are supposed to change when you press keys, maybe something is wrong in the portion of the code with action listeners and key listeners. I have no clue why the...
What's supposed to happen is when the green and red squares touch, it displays the same screen that appears in the beginning except that another line appears that says "GAME OVER" and instead of...
I just now figured out that when I type g.clearRect(0, 0, 400, 400); it has the same effect of super.paint(g); Same goes for g2: passing g2 in super is the same as g2.clearRect(0, 0, 400, 400);...
When you ran it yourself, are you sure the entire program functioned perfectly? When I run it, besides flickering, the screen goes blank when it is supposed to display the game-over menu and it does...
I tried that just now, but instead it flickers even more than before, and still doesn't paint the game over menu or the how to play menu. But it is different. When I passed g2 it froze instead of...
I am a beginner java programmer and I recently starting learning how to program applets. When I realized my first game started flickering like mad, I looked up ways to solve it and found double...