Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.*;
- import java.awt.event.KeyEvent;
- import java.awt.event.KeyListener;
- import java.awt.image.BufferedImage;
- import java.io.File;
- import java.io.IOException;
- import javax.imageio.ImageIO;
- import javax.swing.JFrame;
- import javax.swing.*;
- import java.awt.Image;
- import java.applet.Applet;
- import java.applet.*;
- public class DDR extends JFrame
- {
- public static Image background = new ImageIcon("images/TITLEPAGE.png").getImage();
- private boolean running;
- public DDR()
- {
- super("Dance Dance Revolution"); //Sets the title of our GUI
- running = false;
- setSize(800, 800); //set the size of our JFrame
- setLocationRelativeTo(null); //Unique method that allows us to set our JFrame to the
- //center of our screen
- //Using code from friend
- setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- setContentPane(new DDRDesign()); //Requesting Component from DDRDesign
- setVisible(true);
- setResizable(true); //no maximize button
- gameLoop();
- }
- private void gameLoop() {
- running = true;
- while(running) {
- //Update arrow and object info.
- //Redraw
- repaint();
- //Pause.
- try {
- Thread.sleep(35);
- } catch(InterruptedException ie) {
- }
- }
- }
- public static void main (String[]args)
- {
- new DDR(); //Initializes the JFrame
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement