resources_for_peek-a-boo
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| resources_for_peek-a-boo [2022/05/09 12:53] – created frchris | resources_for_peek-a-boo [2022/05/23 16:43] (current) – frchris | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| **Peek-A-Boo** | **Peek-A-Boo** | ||
| - | < | + | < |
| import java.awt.Color; | import java.awt.Color; | ||
| import java.awt.Font; | import java.awt.Font; | ||
| Line 15: | Line 15: | ||
| public class PeekABoo extends JPanel implements KeyListener, | public class PeekABoo extends JPanel implements KeyListener, | ||
| { | { | ||
| - | public static int WIDTH=800; | + | public static int WIDTH=1200; |
| public static int HEIGHT=600; | public static int HEIGHT=600; | ||
| private Font titleFont, bigFont; | private Font titleFont, bigFont; | ||
| Line 82: | Line 82: | ||
| int r = (int)(26*Math.random()); | int r = (int)(26*Math.random()); | ||
| ch = " | ch = " | ||
| - | message = "try Again. | + | message = "No, try Again. |
| + | timer1.restart(); | ||
| } | } | ||
| repaint(); | repaint(); | ||
| Line 94: | Line 95: | ||
| if (e.getSource()==timer1){ | if (e.getSource()==timer1){ | ||
| message = "Now type that Letter"; | message = "Now type that Letter"; | ||
| + | timer1.stop(); | ||
| timer2.start(); | timer2.start(); | ||
| } else { | } else { | ||
| + | timer2.stop(); | ||
| int r = (int)(26*Math.random()); | int r = (int)(26*Math.random()); | ||
| ch = " | ch = " | ||
| message = "try Again. | message = "try Again. | ||
| + | timer1.restart();; | ||
| } | } | ||
| repaint(); | repaint(); | ||
resources_for_peek-a-boo.1652115199.txt.gz · Last modified: 2022/05/09 12:53 by frchris