Untitled diff

Created Diff never expires
61 removals
69 lines
58 additions
71 lines
package Java;
package javaapplication9;
import java.awt.*;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.KeyEvent;
import javax.swing.ImageIcon;
import javax.swing.*;
import javax.swing.JFrame;
public class javagame extends JFrame {
public class JavaApplication9 extends JFrame {
int x, y;
private Image dbImage;
private Image dbImage;
private Graphics dbg;
private Graphics dbg;
Image face;
int x, y;
Font font = new Font("Arial", Font.BOLD, 30);
public class AL extends KeyAdapter {
public void keyPressed (KeyEvent e) {
public class AL extends KeyAdapter{
public void keyPressed(KeyEvent e){
int keyCode = e.getKeyCode();
int keyCode = e.getKeyCode();
if(keyCode == e.VK_LEFT) {
if(keyCode == e.VK_LEFT){
x-= 5;
x += -10;
}
}
if(keyCode == e.VK_RIGHT) {
if(keyCode == e.VK_RIGHT){
x+= 5;
x += +10;
}
}
if(keyCode == e.VK_UP) {
if(keyCode == e.VK_UP){
y-= 5;
y += -10;
}
}
if(keyCode == e.VK_DOWN) {
if(keyCode == e.VK_DOWN){
y+= 5;
y += +10;
}
}
}
}
public void keyReleased (KeyEvent e) {
}
}
}
public javagame() {
public JavaApplication9(){
//Loading Images
ImageIcon i = new ImageIcon("C:/Documents and Settings/studio/My Documents/NetBeansProjects/JavaApplication9/src/javaapplication9/reddevilhead.gif");
face = i.getImage();
//Game Properties
addKeyListener(new AL());
addKeyListener(new AL());
setTitle("Battle Fortess 8 Alpha _.1");
setTitle("Java Game");
setSize(250, 250);
setSize(750, 750);
setResizable(true);
setResizable(false);
setVisible(true);
setVisible(true);
setBackground(Color.green);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
x = 250;
x = 150;
y = 250;
y = 150;
}
}
public void paint (Graphics g){
public void paint(Graphics g) {
dbImage = createImage(getWidth(), getHeight());
dbImage = createImage(getWidth(), getHeight());
dbg = dbImage.getGraphics();
dbg = dbImage.getGraphics();
paintCompenent(dbg);
paintComponent(dbg);
g.drawImage(dbImage, 0, 0, this);
g.drawImage(dbImage, 0, 0, this);
}
}
public void paintComponent(Graphics g){
public void paintComponent (Graphics g){
g.drawImage(face, x, y, this);
g.drawString("Copy Right All rights reserved to Aaron Collins 2013-2013", 275, 100);
g.drawLine(270, 105, 415, 105);
g.fillOval(x, y, 15, 15);
repaint();
}
}
public static void main(String[] args){
public static void main(String[] args) {
new JavaApplication9();
new javagame();
}
}
}
}