├── .gitignore
├── manifest.mf
├── src
└── com
│ └── greatspace
│ ├── sprites
│ ├── ship.gif
│ ├── bullet.png
│ ├── gsicon.png
│ ├── print.png
│ ├── ship2.gif
│ ├── enemy_1.gif
│ ├── enemy_2.gif
│ ├── game_over.png
│ ├── game_won.png
│ ├── main_menu.png
│ └── background.png
│ ├── interfaces
│ ├── IImage.java
│ └── IStrategy.java
│ ├── proxy
│ ├── RealImage.java
│ └── ProxyImage.java
│ ├── controller
│ ├── Touch.java
│ └── Controller.java
│ ├── model
│ ├── GameObject.java
│ ├── Bullet.java
│ ├── Enemy.java
│ └── Player.java
│ └── view
│ ├── Window.java
│ └── Game.java
├── nbproject
├── private
│ ├── private.properties
│ └── private.xml
├── genfiles.properties
├── project.xml
├── project.properties
└── build-impl.xml
└── README.md
/.gitignore:
--------------------------------------------------------------------------------
1 | /build/
2 | /dist/
--------------------------------------------------------------------------------
/manifest.mf:
--------------------------------------------------------------------------------
1 | Manifest-Version: 1.0
2 | X-COMMENT: Main-Class will be added automatically by build
3 |
4 |
--------------------------------------------------------------------------------
/src/com/greatspace/sprites/ship.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thederickff/GreatSpace/HEAD/src/com/greatspace/sprites/ship.gif
--------------------------------------------------------------------------------
/src/com/greatspace/sprites/bullet.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thederickff/GreatSpace/HEAD/src/com/greatspace/sprites/bullet.png
--------------------------------------------------------------------------------
/src/com/greatspace/sprites/gsicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thederickff/GreatSpace/HEAD/src/com/greatspace/sprites/gsicon.png
--------------------------------------------------------------------------------
/src/com/greatspace/sprites/print.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thederickff/GreatSpace/HEAD/src/com/greatspace/sprites/print.png
--------------------------------------------------------------------------------
/src/com/greatspace/sprites/ship2.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thederickff/GreatSpace/HEAD/src/com/greatspace/sprites/ship2.gif
--------------------------------------------------------------------------------
/src/com/greatspace/sprites/enemy_1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thederickff/GreatSpace/HEAD/src/com/greatspace/sprites/enemy_1.gif
--------------------------------------------------------------------------------
/src/com/greatspace/sprites/enemy_2.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thederickff/GreatSpace/HEAD/src/com/greatspace/sprites/enemy_2.gif
--------------------------------------------------------------------------------
/src/com/greatspace/sprites/game_over.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thederickff/GreatSpace/HEAD/src/com/greatspace/sprites/game_over.png
--------------------------------------------------------------------------------
/src/com/greatspace/sprites/game_won.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thederickff/GreatSpace/HEAD/src/com/greatspace/sprites/game_won.png
--------------------------------------------------------------------------------
/src/com/greatspace/sprites/main_menu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thederickff/GreatSpace/HEAD/src/com/greatspace/sprites/main_menu.png
--------------------------------------------------------------------------------
/src/com/greatspace/sprites/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thederickff/GreatSpace/HEAD/src/com/greatspace/sprites/background.png
--------------------------------------------------------------------------------
/nbproject/private/private.properties:
--------------------------------------------------------------------------------
1 | compile.on.save=true
2 | user.properties.file=/home/derickfelix/snap/netbeans/common/data/11.2/build.properties
3 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Great Space
2 | Space Invaders Game Style
3 |
4 | 
5 |
--------------------------------------------------------------------------------
/src/com/greatspace/interfaces/IImage.java:
--------------------------------------------------------------------------------
1 | package com.greatspace.interfaces;
2 |
3 | import javax.swing.ImageIcon;
4 |
5 | /**
6 | *
7 | * @author Dayvson
8 | */
9 | public interface IImage {
10 |
11 | ImageIcon loadImage();
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/src/com/greatspace/interfaces/IStrategy.java:
--------------------------------------------------------------------------------
1 | package com.greatspace.interfaces;
2 |
3 | import com.greatspace.model.Player;
4 | import java.awt.event.KeyEvent;
5 |
6 | /**
7 | *
8 | * @author Dayvson
9 | */
10 | public interface IStrategy {
11 |
12 | void keyPressed(Player player, KeyEvent key);
13 |
14 | void keyReleased(Player player, KeyEvent key);
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/nbproject/genfiles.properties:
--------------------------------------------------------------------------------
1 | build.xml.data.CRC32=8dab3fb5
2 | build.xml.script.CRC32=01234f67
3 | build.xml.stylesheet.CRC32=f85dc8f2@1.93.0.48
4 | # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
5 | # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
6 | nbproject/build-impl.xml.data.CRC32=8dab3fb5
7 | nbproject/build-impl.xml.script.CRC32=3921920d
8 | nbproject/build-impl.xml.stylesheet.CRC32=f89f7d21@1.93.0.48
9 |
--------------------------------------------------------------------------------
/nbproject/private/private.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | file:/home/derickfelix/NetBeansProjects/GreatSpace/src/com/greatspace/view/Game.java
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/nbproject/project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | org.netbeans.modules.java.j2seproject
4 |
5 |
6 | GreatSpace
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/src/com/greatspace/proxy/RealImage.java:
--------------------------------------------------------------------------------
1 | package com.greatspace.proxy;
2 |
3 | import javax.swing.ImageIcon;
4 | import com.greatspace.interfaces.IImage;
5 |
6 | /**
7 | *
8 | * @author Dayvson
9 | */
10 | public class RealImage implements IImage {
11 |
12 | private final String path;
13 | private ImageIcon imageIcon;
14 |
15 | public RealImage(String path)
16 | {
17 | this.path = path;
18 | }
19 |
20 | @Override
21 | public ImageIcon loadImage()
22 | {
23 | if (imageIcon == null) {
24 | imageIcon = new ImageIcon(getClass().getResource(path));
25 | }
26 | return imageIcon;
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/src/com/greatspace/proxy/ProxyImage.java:
--------------------------------------------------------------------------------
1 | package com.greatspace.proxy;
2 |
3 | import javax.swing.ImageIcon;
4 | import com.greatspace.interfaces.IImage;
5 |
6 | /**
7 | *
8 | * @author Dayvson
9 | */
10 | public class ProxyImage implements IImage {
11 |
12 | private RealImage realImage;
13 | private final String path;
14 |
15 | public ProxyImage(String path)
16 | {
17 | this.path = path;
18 | }
19 |
20 | @Override
21 | public ImageIcon loadImage()
22 | {
23 |
24 | if (this.realImage == null) {
25 | this.realImage = new RealImage(this.path);
26 | }
27 |
28 | return this.realImage.loadImage();
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/src/com/greatspace/controller/Touch.java:
--------------------------------------------------------------------------------
1 | package com.greatspace.controller;
2 |
3 | import java.awt.event.KeyEvent;
4 |
5 | public class Touch {
6 |
7 | static final int PLAYER_ONE_MOVE_LEFT = KeyEvent.VK_A;
8 | static final int PLAYER_ONE_MOVE_RIGHT = KeyEvent.VK_D;
9 | static final int PLAYER_ONE_MOVE_UP = KeyEvent.VK_W;
10 | static final int PLAYER_ONE_MOVE_DOWN = KeyEvent.VK_S;
11 | static final int PLAYER_ONE_FIRE = KeyEvent.VK_SPACE;
12 |
13 | static final int PLAYER_TWO_MOVE_LEFT = KeyEvent.VK_LEFT;
14 | static final int PLAYER_TWO_MOVE_RIGHT = KeyEvent.VK_RIGHT;
15 | static final int PLAYER_TWO_MOVE_UP = KeyEvent.VK_UP;
16 | static final int PLAYER_TWO_MOVE_DOWN = KeyEvent.VK_DOWN;
17 | static final int PLAYER_TWO_FIRE = KeyEvent.VK_INSERT;
18 | }
19 |
--------------------------------------------------------------------------------
/src/com/greatspace/model/GameObject.java:
--------------------------------------------------------------------------------
1 | package com.greatspace.model;
2 |
3 | import java.awt.Image;
4 |
5 | /**
6 | * Date: 13/02/2016
7 | */
8 | public abstract class GameObject implements Cloneable {
9 |
10 | private Image image;
11 | private int height;
12 | private int width;
13 |
14 | private boolean visivel;
15 |
16 | public int getAltura()
17 | {
18 | return height;
19 | }
20 |
21 | public void setHeight(int a)
22 | {
23 | this.height = a;
24 | }
25 |
26 | public int getLargura()
27 | {
28 | return width;
29 | }
30 |
31 | public void setWidth(int l)
32 | {
33 |
34 | this.width = l;
35 | }
36 |
37 | public Image getImage()
38 | {
39 | return image;
40 | }
41 |
42 | public void setImage(Image i)
43 | {
44 | this.image = i;
45 | }
46 |
47 | public boolean isVisible()
48 | {
49 | return visivel;
50 | }
51 |
52 | public void setVisibility(boolean v)
53 | {
54 | this.visivel = v;
55 | }
56 |
57 | @Override
58 | public Object clone()
59 | {
60 | Object clone = null;
61 |
62 | try {
63 | clone = super.clone();
64 |
65 | } catch (CloneNotSupportedException e) {
66 | e.printStackTrace();
67 | }
68 |
69 | return clone;
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/src/com/greatspace/model/Bullet.java:
--------------------------------------------------------------------------------
1 | package com.greatspace.model;
2 |
3 | import com.greatspace.proxy.ProxyImage;
4 | import java.awt.Rectangle;
5 |
6 | /**
7 | * Date: 13/02/2016
8 | */
9 | public class Bullet extends GameObject {
10 |
11 | private int x;
12 | private int y;
13 | private static ProxyImage imagemProxy;
14 | private static final int LARGURA_TELA = 500;
15 | private static final int VELOCIDADE = 3;
16 |
17 | public Bullet()
18 | {
19 | if (imagemProxy == null) {
20 | imagemProxy = new ProxyImage("/com/greatspace/sprites/bullet.png");
21 | }
22 |
23 | this.setImage(imagemProxy.loadImage().getImage());
24 | this.setHeight(getImage().getHeight(null));
25 | this.setWidth(getImage().getWidth(null));
26 |
27 | this.setVisibility(true);
28 | }
29 |
30 | public void mexer()
31 | {
32 |
33 | this.x += VELOCIDADE;
34 | if (this.x > LARGURA_TELA) {
35 | setVisibility(false);
36 | }
37 |
38 | }
39 |
40 | public void setX(int x)
41 | {
42 | this.x = x;
43 | }
44 |
45 | public void setY(int y)
46 | {
47 | this.y = y;
48 | }
49 |
50 | public int getX()
51 | {
52 | return x;
53 | }
54 |
55 | public int getY()
56 | {
57 | return y;
58 | }
59 |
60 | public Rectangle getBounds()
61 | {
62 | return new Rectangle(x, y, getLargura(), getAltura());
63 | }
64 |
65 | }
66 |
--------------------------------------------------------------------------------
/src/com/greatspace/model/Enemy.java:
--------------------------------------------------------------------------------
1 | package com.greatspace.model;
2 |
3 | import java.awt.Rectangle;
4 |
5 | /**
6 | * Date: 13/02/2016
7 | */
8 | public class Enemy extends GameObject {
9 |
10 | private int x;
11 | private int y;
12 |
13 | private static final int VELOCIDADE = 2;
14 |
15 | public Enemy()
16 | {
17 | }
18 |
19 | public static int GeneratePosX()
20 | {
21 | return GeneratePosX(100);
22 | }
23 |
24 | public static int GeneratePosX(int nb)
25 | {
26 |
27 | int aax = 456 + (int) (Math.random() * 16 * nb);
28 | return aax;
29 | }
30 |
31 | public static int GeneratePosY()
32 | {
33 | int aay = 10 + (int) (Math.random() * 320);
34 |
35 | return aay;
36 | }
37 |
38 | public void move()
39 | {
40 | move(100);
41 | }
42 |
43 | public void move(int nbEnemy)
44 | {
45 | if (this.x < 0) {
46 | this.x = GeneratePosX(nbEnemy);
47 | this.y = GeneratePosY();
48 | } else {
49 | this.x -= VELOCIDADE;
50 | }
51 | }
52 |
53 | public int getX()
54 | {
55 | return x;
56 | }
57 |
58 | public int getY()
59 | {
60 | return y;
61 | }
62 |
63 | public void setX(int x)
64 | {
65 | this.x = x;
66 | }
67 |
68 | public void setY(int y)
69 | {
70 | this.y = y;
71 | }
72 |
73 | public Rectangle getBounds()
74 | {
75 | return new Rectangle(x, y, getLargura(), getAltura());
76 | }
77 |
78 | }
79 |
--------------------------------------------------------------------------------
/src/com/greatspace/view/Window.java:
--------------------------------------------------------------------------------
1 | package com.greatspace.view;
2 |
3 | import java.awt.image.BufferedImage;
4 | import java.io.IOException;
5 | import java.net.URL;
6 | import javax.imageio.ImageIO;
7 | import javax.swing.JFrame;
8 |
9 | /**
10 | * @author: Derick Felix
11 | * @Data: 02/13/2016
12 | * @Release: 2.1
13 | * @Class: Window
14 | * @Objective: Create the Main Window
15 | */
16 | public class Window {
17 |
18 | public Window() {
19 |
20 | JFrame frame = new JFrame("Great Space");
21 | Game f = new Game();
22 | f.checkPlayer();
23 | frame.add(f);
24 | frame.setJMenuBar(f.criarMenu());
25 | frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
26 | frame.setSize(500, 420);
27 | frame.setLocationRelativeTo(null);
28 | frame.setResizable(false);
29 |
30 | try {
31 | URL url = getClass().getResource("../sprites/gsicon.png");
32 | BufferedImage image = ImageIO.read(url);
33 | frame.setIconImage(image);
34 | } catch (IOException e) {
35 | System.out.println("ImageError: " + e);
36 | }
37 | frame.setVisible(true);
38 | }
39 |
40 | public static void main(String[] args) {
41 | /* Set the System look and feel */
42 | //
43 | try {
44 | javax.swing.UIManager.setLookAndFeel(javax.swing.UIManager.getSystemLookAndFeelClassName());
45 | } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | javax.swing.UnsupportedLookAndFeelException ex) {
46 | java.util.logging.Logger.getLogger(Window.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
47 | }
48 | //
49 | /* Create and display the form */
50 | java.awt.EventQueue.invokeLater(() -> {
51 | Window window = new Window();
52 | });
53 |
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/src/com/greatspace/model/Player.java:
--------------------------------------------------------------------------------
1 | package com.greatspace.model;
2 |
3 | import com.greatspace.controller.Controller;
4 | import com.greatspace.proxy.ProxyImage;
5 |
6 | import java.awt.Rectangle;
7 | import java.util.ArrayList;
8 | import java.util.List;
9 |
10 |
11 | /**
12 | * Date: 13/02/2016
13 | */
14 | public class Player extends GameObject {
15 |
16 | private int x, y;
17 | private int dx, dy;
18 | private boolean morto;
19 | private static ProxyImage imagemProxy;
20 | private Bullet missel;
21 |
22 | private Controller controle;
23 |
24 | private List bullets;
25 |
26 | public Player() {
27 | if (imagemProxy == null)
28 | imagemProxy = new ProxyImage("/com/greatspace/sprites/ship.gif");
29 |
30 | this.setImage(imagemProxy.loadImage().getImage());
31 |
32 | this.setHeight(getImage().getHeight(null));
33 | this.setWidth(getImage().getWidth(null));
34 |
35 | bullets = new ArrayList();
36 | missel = new Bullet();
37 | }
38 |
39 | public void mexer() {
40 | x += dx*2; // 1 e 462
41 | y += dy*2; // 1 e 340
42 |
43 | colisaoJanela();
44 | }
45 |
46 | public void colisaoJanela() {
47 |
48 | if (this.x < 1) {
49 | x = 1;
50 | }
51 |
52 | if (this.x > 462) {
53 | x = 462;
54 | }
55 |
56 | if (this.y < 1) {
57 | y = 1;
58 | }
59 |
60 | if (this.y > 340) {
61 | y = 340;
62 | }
63 | }
64 |
65 | public List getBullet() {
66 | return bullets;
67 | }
68 |
69 | public int getX() {
70 | return x;
71 | }
72 |
73 | public void setX(int x) {
74 | this.x = x;
75 | }
76 |
77 | public void setDx(int d) {
78 | this.dx = d;
79 | }
80 |
81 | public void setDy(int d) {
82 | this.dy = d;
83 | }
84 |
85 | public int getY() {
86 | return y;
87 | }
88 |
89 | public void setY(int num) {
90 |
91 | this.y = num;
92 | }
93 |
94 | public boolean isDead() {
95 | return morto;
96 | }
97 |
98 | public void setMorto(boolean morto) {
99 | this.morto = morto;
100 | }
101 |
102 | public void fire() {
103 | Bullet mis = (Bullet) missel.clone();
104 | mis.setX(x + getLargura());
105 | mis.setY(y + getAltura() / 2);
106 |
107 | this.bullets.add(mis);
108 | }
109 |
110 | public Rectangle getBounds() {
111 | return new Rectangle(x, y, getLargura(), getAltura());
112 | }
113 |
114 | public Controller getControle() {
115 | return controle;
116 | }
117 |
118 | public void setControle(Controller controle) {
119 | this.controle = controle;
120 | }
121 |
122 | }
123 |
--------------------------------------------------------------------------------
/nbproject/project.properties:
--------------------------------------------------------------------------------
1 | annotation.processing.enabled=true
2 | annotation.processing.enabled.in.editor=false
3 | annotation.processing.processor.options=
4 | annotation.processing.processors.list=
5 | annotation.processing.run.all.processors=true
6 | annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
7 | build.classes.dir=${build.dir}/classes
8 | build.classes.excludes=**/*.java,**/*.form
9 | # This directory is removed when the project is cleaned:
10 | build.dir=build
11 | build.generated.dir=${build.dir}/generated
12 | build.generated.sources.dir=${build.dir}/generated-sources
13 | # Only compile against the classpath explicitly listed here:
14 | build.sysclasspath=ignore
15 | build.test.classes.dir=${build.dir}/test/classes
16 | build.test.results.dir=${build.dir}/test/results
17 | # Uncomment to specify the preferred debugger connection transport:
18 | #debug.transport=dt_socket
19 | debug.classpath=\
20 | ${run.classpath}
21 | debug.modulepath=\
22 | ${run.modulepath}
23 | debug.test.classpath=\
24 | ${run.test.classpath}
25 | debug.test.modulepath=\
26 | ${run.test.modulepath}
27 | # Os arquivos em build.classes.dir que devem ser exclu\u00eddos do jar de distribui\u00e7\u00e3o
28 | dist.archive.excludes=
29 | # This directory is removed when the project is cleaned:
30 | dist.dir=dist
31 | dist.jar=${dist.dir}/GreatSpace.jar
32 | dist.javadoc.dir=${dist.dir}/javadoc
33 | excludes=
34 | includes=**
35 | jar.compress=false
36 | javac.classpath=
37 | # Space-separated list of extra javac options
38 | javac.compilerargs=
39 | javac.deprecation=false
40 | javac.modulepath=
41 | javac.processormodulepath=
42 | javac.processorpath=\
43 | ${javac.classpath}
44 | javac.source=1.8
45 | javac.target=1.8
46 | javac.test.classpath=\
47 | ${javac.classpath}:\
48 | ${build.classes.dir}
49 | javac.test.modulepath=\
50 | ${javac.modulepath}
51 | javac.test.processorpath=\
52 | ${javac.test.classpath}
53 | javadoc.additionalparam=
54 | javadoc.author=false
55 | javadoc.encoding=${source.encoding}
56 | javadoc.noindex=false
57 | javadoc.nonavbar=false
58 | javadoc.notree=false
59 | javadoc.private=false
60 | javadoc.splitindex=true
61 | javadoc.use=true
62 | javadoc.version=false
63 | javadoc.windowtitle=
64 | main.class=com.greatspace.view.Window
65 | manifest.file=manifest.mf
66 | meta.inf.dir=${src.dir}/META-INF
67 | mkdist.disabled=false
68 | platform.active=default_platform
69 | run.classpath=\
70 | ${javac.classpath}:\
71 | ${build.classes.dir}
72 | # Space-separated list of JVM arguments used when running the project.
73 | # You may also define separate properties like run-sys-prop.name=value instead of -Dname=value.
74 | # To set system properties for unit tests define test-sys-prop.name=value:
75 | run.jvmargs=
76 | run.modulepath=\
77 | ${javac.modulepath}
78 | run.test.classpath=\
79 | ${javac.test.classpath}:\
80 | ${build.test.classes.dir}
81 | run.test.modulepath=\
82 | ${javac.test.modulepath}
83 | source.encoding=UTF-8
84 | src.dir=src
85 | test.src.dir=test
86 |
--------------------------------------------------------------------------------
/src/com/greatspace/controller/Controller.java:
--------------------------------------------------------------------------------
1 | package com.greatspace.controller;
2 |
3 | import com.greatspace.interfaces.IStrategy;
4 | import com.greatspace.model.Player;
5 |
6 | import java.awt.event.KeyEvent;
7 |
8 | import static com.greatspace.controller.Touch.*;
9 |
10 | /**
11 | *
12 | * @author Dayvson
13 | */
14 | public enum Controller implements IStrategy {
15 |
16 | PLAYER_1 {
17 | @Override
18 | public void keyPressed(Player player, KeyEvent key)
19 | {
20 |
21 | int codigo = key.getKeyCode();
22 | if (!player.isDead()) {
23 | switch (codigo) {
24 | case PLAYER_ONE_FIRE:
25 | player.fire();
26 | break;
27 | case PLAYER_ONE_MOVE_UP:
28 | player.setDy(-1);
29 | break;
30 | case PLAYER_ONE_MOVE_DOWN:
31 | player.setDy(1);
32 | break;
33 | case PLAYER_ONE_MOVE_LEFT:
34 | player.setDx(-1);
35 | break;
36 | case PLAYER_ONE_MOVE_RIGHT:
37 | player.setDx(1);
38 | break;
39 | }
40 | }
41 | }
42 |
43 | @Override
44 | public void keyReleased(Player player, KeyEvent key)
45 | {
46 | int codigo = key.getKeyCode();
47 |
48 | if (!player.isDead()) {
49 | switch (codigo) {
50 | case PLAYER_ONE_MOVE_UP:
51 | player.setDy(0);
52 | break;
53 | case PLAYER_ONE_MOVE_DOWN:
54 | player.setDy(0);
55 | break;
56 | case PLAYER_ONE_MOVE_LEFT:
57 | player.setDx(0);
58 | break;
59 | case PLAYER_ONE_MOVE_RIGHT:
60 | player.setDx(0);
61 | break;
62 | }
63 | }
64 | }
65 | },
66 | PLAYER_2 {
67 | @Override
68 | public void keyPressed(Player player, KeyEvent key)
69 | {
70 | int codigo = key.getKeyCode();
71 | if (!player.isDead()) {
72 | switch (codigo) {
73 | case PLAYER_TWO_FIRE:
74 | player.fire();
75 | break;
76 | case PLAYER_TWO_MOVE_UP:
77 | player.setDy(-1);
78 | break;
79 | case PLAYER_TWO_MOVE_DOWN:
80 | player.setDy(1);
81 | break;
82 | case PLAYER_TWO_MOVE_LEFT:
83 | player.setDx(-1);
84 | break;
85 | case PLAYER_TWO_MOVE_RIGHT:
86 | player.setDx(1);
87 | break;
88 | }
89 | }
90 | }
91 |
92 | @Override
93 | public void keyReleased(Player player, KeyEvent key)
94 | {
95 | int codigo = key.getKeyCode();
96 | if (!player.isDead()) {
97 | switch (codigo) {
98 | case PLAYER_TWO_MOVE_UP:
99 | player.setDy(0);
100 | break;
101 | case PLAYER_TWO_MOVE_DOWN:
102 | player.setDy(0);
103 | break;
104 | case PLAYER_TWO_MOVE_LEFT:
105 | player.setDx(0);
106 | break;
107 | case PLAYER_TWO_MOVE_RIGHT:
108 | player.setDx(0);
109 | break;
110 | }
111 | }
112 | }
113 | }
114 | }
115 |
--------------------------------------------------------------------------------
/src/com/greatspace/view/Game.java:
--------------------------------------------------------------------------------
1 | package com.greatspace.view;
2 |
3 | import com.greatspace.controller.Controller;
4 | import com.greatspace.model.Bullet;
5 | import com.greatspace.model.Enemy;
6 | import com.greatspace.model.Player;
7 | import com.greatspace.proxy.ProxyImage;
8 | import java.awt.Color;
9 | import java.awt.Graphics;
10 | import java.awt.Graphics2D;
11 | import java.awt.Image;
12 | import java.awt.Rectangle;
13 | import java.awt.event.ActionEvent;
14 | import java.awt.event.ActionListener;
15 | import java.awt.event.KeyAdapter;
16 | import java.awt.event.KeyEvent;
17 | import java.util.ArrayList;
18 | import java.util.List;
19 |
20 | import javax.swing.ImageIcon;
21 | import javax.swing.JMenu;
22 | import javax.swing.JMenuBar;
23 | import javax.swing.JMenuItem;
24 | import javax.swing.JOptionPane;
25 | import javax.swing.JPanel;
26 | import javax.swing.Timer;
27 |
28 | /**
29 | * Date: 13/02/2016
30 | */
31 | public class Game extends JPanel implements ActionListener {
32 |
33 | private int recp;
34 | private final Image background;
35 | private Image Inicio;
36 | private final Player nave;
37 | private final Timer timer;
38 | private final Player playeOne;
39 | private final Player playerTwo;
40 |
41 | private boolean p2 = false;
42 | private boolean playing;
43 | private boolean begin;
44 | private boolean isWon;
45 |
46 | private List enemies;
47 |
48 | public Game()
49 | {
50 |
51 | this.nave = new Player();
52 |
53 | setFocusable(true);
54 | setDoubleBuffered(true);
55 | addKeyListener(new TecladoAdapter());
56 |
57 | ImageIcon referencia = new ImageIcon(getClass().getResource("/com/greatspace/sprites/background.png"));
58 | background = referencia.getImage();
59 |
60 | playeOne = (Player) nave.clone();
61 | playeOne.setX(100);
62 | playeOne.setY(100);
63 | playeOne.setControle(Controller.PLAYER_1);
64 |
65 | playerTwo = (Player) nave.clone();
66 | playerTwo.setX(100);
67 | playerTwo.setY(200);
68 | playerTwo.setControle(Controller.PLAYER_2);
69 |
70 | playing = false;
71 | isWon = false;
72 | begin = true;
73 |
74 | initEnemy();
75 |
76 | timer = new Timer(5, this);
77 | timer.start();
78 | }
79 |
80 | public void checkPlayer()
81 | {
82 | try {
83 | recp = Integer.parseInt(JOptionPane.showInputDialog(null, "Type 1 to Singleplayer
"
84 | + "Type 2 to Multiplayer", "Game type", 1));
85 |
86 | if (recp == 2) {
87 | p2 = true;
88 | }
89 | } catch (NumberFormatException e) {
90 | System.out.println("Error: " + e);
91 | System.exit(0);
92 | }
93 |
94 | }
95 |
96 | public JMenuBar criarMenu()
97 | {
98 | // Create a new MenuBar
99 | JMenuBar menub = new JMenuBar();
100 | // Create a new Menu
101 | JMenu game = new JMenu("Game");
102 | // Create a new Menu Item of Jogo menu
103 | JMenuItem close = new JMenuItem("Close");
104 | close.addActionListener((ActionEvent e) -> {
105 | System.exit(0);
106 | });
107 | // Add fechar menu item to the jogo menu
108 | game.add(close);
109 |
110 | JMenu help = new JMenu("Help");
111 |
112 | JMenuItem about = new JMenuItem("About");
113 | about.addActionListener((e) -> {
114 | JOptionPane.showMessageDialog(null, "Great Space
"
115 | + "Developed by Derick Felix!
"
116 | + "What's new:
"
117 | + "- Bug Fixes
"
118 | + "- Changes in game controler
"
119 | + "
", "About", 1);
120 | });
121 | JMenuItem htp = new JMenuItem("How to Play");
122 | htp.addActionListener((e) -> {
123 | JOptionPane.showMessageDialog(null, ""
124 | + "Player 1
"
125 | + "Fire - Space
"
126 | + "Up - W
"
127 | + "Down - S
"
128 | + "Left - A
"
129 | + "Right - D
"
130 | + "Player 2
"
131 | + "Fire - Insert
"
132 | + "Up - UP ARROW
"
133 | + "Down - DOWN ARROW
"
134 | + "Left - LEFT ARROW
"
135 | + "Right - RIGHT ARROW
"
136 | + "", "How to play", JOptionPane.QUESTION_MESSAGE);
137 | });
138 |
139 | help.add(htp);
140 | help.add(about);
141 |
142 | menub.add(game);
143 | menub.add(help);
144 |
145 | return menub;
146 | }
147 |
148 | private void initEnemy()
149 | {
150 | enemies = new ArrayList<>();
151 | Enemy enemy = new Enemy();
152 |
153 | ProxyImage enemyOneImage = new ProxyImage("/com/greatspace/sprites/enemy_1.gif");
154 | ProxyImage enemyTwoImage = new ProxyImage("/com/greatspace/sprites/enemy_2.gif");
155 |
156 | for (int i = 0; i < 100; i++) {
157 | Enemy ini = (Enemy) enemy.clone();
158 | ini.setX(Enemy.GeneratePosX());
159 | ini.setY(Enemy.GeneratePosY());
160 |
161 | if (i % 3 == 0) {
162 | ini.setImage(enemyTwoImage.loadImage().getImage());
163 | } else {
164 | ini.setImage(enemyOneImage.loadImage().getImage());
165 | }
166 |
167 | ini.setHeight(ini.getImage().getHeight(null));
168 | ini.setWidth(ini.getImage().getWidth(null));
169 |
170 | ini.setVisibility(true);
171 | enemies.add(ini);
172 | }
173 | }
174 |
175 | @Override
176 | public void paint(Graphics g)
177 | {
178 |
179 | Graphics2D graficos = (Graphics2D) g;
180 | graficos.drawImage(background, 0, 0, null);
181 |
182 | if (playing) {
183 |
184 | if (playeOne.isDead() == false) {
185 | graficos.drawImage(playeOne.getImage(), playeOne.getX(), playeOne.getY(), this);
186 | }
187 | if (p2 == true) {
188 | if (playerTwo.isDead() == false) {
189 | ImageIcon naveDois_ = new ImageIcon(getClass().getResource("/com/greatspace/sprites/ship2.gif"));
190 | playerTwo.setImage(naveDois_.getImage());
191 | graficos.drawImage(playerTwo.getImage(), playerTwo.getX(), playerTwo.getY(), this);
192 | }
193 | }
194 |
195 | List bullets1 = playeOne.getBullet();
196 | List bullets2 = playerTwo.getBullet();
197 |
198 | for (int i = 0; i < bullets1.size(); i++) {
199 |
200 | Bullet m = (Bullet) bullets1.get(i);
201 | graficos.drawImage(m.getImage(), m.getX(), m.getY(), this);
202 |
203 | }
204 | for (int i = 0; i < bullets2.size(); i++) {
205 |
206 | Bullet m = (Bullet) bullets2.get(i);
207 | graficos.drawImage(m.getImage(), m.getX(), m.getY(), this);
208 |
209 | }
210 |
211 | for (int i = 0; i < enemies.size(); i++) {
212 |
213 | Enemy in = enemies.get(i);
214 | graficos.drawImage(in.getImage(), in.getX(), in.getY(), this);
215 |
216 | }
217 |
218 | graficos.setColor(Color.WHITE);
219 | graficos.drawString("Enemies: " + enemies.size(), 5, 15);
220 |
221 | } else if (isWon) {
222 |
223 | ImageIcon wonImage = new ImageIcon(getClass().getResource("/com/greatspace/sprites/game_won.png"));
224 |
225 | graficos.drawImage(wonImage.getImage(), 0, 0, null);
226 |
227 | } else if (begin) {
228 |
229 | ImageIcon bg_ = new ImageIcon(getClass().getResource("/com/greatspace/sprites/main_menu.png"));
230 | Inicio = bg_.getImage();
231 | graficos.drawImage(Inicio, 0, 0, null);
232 |
233 | } else {
234 | ImageIcon fimJogo = new ImageIcon(getClass().getResource("/com/greatspace/sprites/game_over.png"));
235 |
236 | graficos.drawImage(fimJogo.getImage(), 0, 0, null);
237 | }
238 |
239 | g.dispose();
240 |
241 | }
242 |
243 | @Override
244 | public void actionPerformed(ActionEvent arg0)
245 | {
246 |
247 | try {
248 | Thread.sleep(5);
249 | } catch (InterruptedException e) {
250 | e.printStackTrace();
251 | }
252 | if (enemies.isEmpty()) {
253 | playing = false;
254 | isWon = true;
255 | }
256 |
257 | List bullets1 = playeOne.getBullet();
258 | List bullets2 = playerTwo.getBullet();
259 |
260 | for (int i = 0; i < bullets1.size(); i++) {
261 |
262 | Bullet m = (Bullet) bullets1.get(i);
263 |
264 | if (m.isVisible()) {
265 | m.mexer();
266 | } else {
267 | bullets1.remove(i);
268 | }
269 |
270 | }
271 | for (int i = 0; i < bullets2.size(); i++) {
272 |
273 | Bullet m = (Bullet) bullets2.get(i);
274 |
275 | if (m.isVisible()) {
276 | m.mexer();
277 | } else {
278 | bullets2.remove(i);
279 | }
280 |
281 | }
282 |
283 | for (int i = 0; i < enemies.size(); i++) {
284 |
285 | Enemy in = enemies.get(i);
286 |
287 | if (in.isVisible()) {
288 | in.move(enemies.size());
289 | } else {
290 | enemies.remove(i);
291 | }
292 |
293 | }
294 |
295 | playeOne.mexer();
296 | playerTwo.mexer();
297 | findCollision();
298 | if (p2 == true) {
299 | if (playeOne.isDead() && playerTwo.isDead()) {
300 | playing = false;
301 | }
302 | }
303 | repaint();
304 | }
305 |
306 | public void findCollision()
307 | {
308 |
309 | Rectangle p1Bounds = playeOne.getBounds();
310 | Rectangle p2Bounds = playerTwo.getBounds();
311 | Rectangle formaInimigo;
312 | Rectangle formaMissel;
313 |
314 | for (int i = 0; i < enemies.size(); i++) {
315 |
316 | Enemy tempInimigo = enemies.get(i);
317 | formaInimigo = tempInimigo.getBounds();
318 |
319 | if (p1Bounds.intersects(formaInimigo)) {
320 | playeOne.setVisibility(false);
321 | playeOne.setMorto(true);
322 | if (p2 == false) {
323 | playing = false;
324 | }
325 | }
326 | if (p2Bounds.intersects(formaInimigo)) {
327 | playerTwo.setVisibility(false);
328 | playerTwo.setMorto(true);
329 | }
330 | if (playeOne.isDead() == false && playerTwo.isDead() == false) {
331 | if (p1Bounds.intersects(p2Bounds)) {
332 | playeOne.setDx(0);
333 | playeOne.setDy(0);
334 | }
335 | if (p2Bounds.intersects(p1Bounds)) {
336 | playerTwo.setDx(0);
337 | playerTwo.setDy(0);
338 | }
339 | }
340 |
341 | }
342 |
343 | List bulletsOne = playeOne.getBullet();
344 | List bulletsTwo = playerTwo.getBullet();
345 |
346 | for (int i = 0; i < bulletsOne.size(); i++) {
347 |
348 | Bullet tempMissel = bulletsOne.get(i);
349 | formaMissel = tempMissel.getBounds();
350 |
351 | for (int j = 0; j < enemies.size(); j++) {
352 |
353 | Enemy tempInimigo = enemies.get(j);
354 | formaInimigo = tempInimigo.getBounds();
355 |
356 | if (formaMissel.intersects(formaInimigo)) {
357 |
358 | tempInimigo.setVisibility(false);
359 | tempMissel.setVisibility(false);
360 |
361 | }
362 | if (formaMissel.intersects(p2Bounds)) {
363 |
364 | tempMissel.setVisibility(false);
365 | }
366 |
367 | }
368 |
369 | }
370 | for (int i = 0; i < bulletsTwo.size(); i++) {
371 |
372 | Bullet tempMissel = bulletsTwo.get(i);
373 | formaMissel = tempMissel.getBounds();
374 |
375 | for (int j = 0; j < enemies.size(); j++) {
376 |
377 | Enemy tempInimigo = enemies.get(j);
378 | formaInimigo = tempInimigo.getBounds();
379 |
380 | if (formaMissel.intersects(formaInimigo)) {
381 |
382 | tempInimigo.setVisibility(false);
383 | tempMissel.setVisibility(false);
384 |
385 | }
386 | if (formaMissel.intersects(p1Bounds)) {
387 |
388 | tempMissel.setVisibility(false);
389 | }
390 |
391 | }
392 |
393 | }
394 | }
395 |
396 | public boolean getP2()
397 | {
398 | return this.p2;
399 | }
400 |
401 | private class TecladoAdapter extends KeyAdapter {
402 |
403 | @Override
404 | public void keyPressed(KeyEvent e)
405 | {
406 | if (e.getKeyCode() == KeyEvent.VK_ENTER) {
407 | if (playing == false) {
408 | playing = true;
409 | playeOne.setMorto(false);
410 | playerTwo.setMorto(false);
411 | isWon = false;
412 | if (begin == true) {
413 | begin = false;
414 | }
415 |
416 | playeOne.setX(100);
417 | playeOne.setY(100);
418 |
419 | playerTwo.setX(100);
420 | playerTwo.setY(200);
421 |
422 | initEnemy();
423 | }
424 | }
425 | if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {
426 | playing = false;
427 | }
428 |
429 | playeOne.getControle().keyPressed(playeOne, e);
430 | if (p2) {
431 | playerTwo.getControle().keyPressed(playerTwo, e);
432 | }
433 | }
434 |
435 | @Override
436 | public void keyReleased(KeyEvent e)
437 | {
438 | playeOne.getControle().keyReleased(playeOne, e);
439 | if (p2) {
440 | playerTwo.getControle().keyReleased(playerTwo, e);
441 | }
442 | }
443 |
444 | }
445 | }
446 |
--------------------------------------------------------------------------------
/nbproject/build-impl.xml:
--------------------------------------------------------------------------------
1 |
2 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
254 |
255 |
256 |
257 |
258 |
259 |
260 |
261 |
262 |
263 |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 |
274 |
275 |
276 |
277 |
278 |
279 |
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 |
288 |
289 |
290 |
291 | Must set src.dir
292 | Must set test.src.dir
293 | Must set build.dir
294 | Must set dist.dir
295 | Must set build.classes.dir
296 | Must set dist.javadoc.dir
297 | Must set build.test.classes.dir
298 | Must set build.test.results.dir
299 | Must set build.classes.excludes
300 | Must set dist.jar
301 |
302 |
303 |
304 |
305 |
306 |
307 |
308 |
309 |
310 |
311 |
312 |
313 |
314 |
315 |
316 |
317 |
318 |
319 |
320 |
321 |
322 |
323 |
324 |
325 |
326 |
327 |
328 |
329 |
330 |
331 |
332 |
333 |
334 |
335 |
336 |
337 |
338 |
339 |
340 |
341 |
342 |
343 |
344 |
345 |
346 |
347 |
348 |
349 |
350 |
351 |
352 |
353 |
354 |
355 |
356 |
357 |
358 |
359 |
360 |
361 |
362 |
363 |
364 |
365 |
366 |
367 |
368 |
369 |
370 |
371 |
372 |
373 |
374 |
375 |
376 |
377 |
378 |
379 |
380 |
381 |
382 |
383 |
384 |
385 |
386 |
387 |
388 |
389 |
390 |
391 |
392 |
393 |
394 |
395 |
396 |
397 |
398 |
399 |
400 |
401 |
402 |
403 |
404 |
405 |
406 |
407 |
408 |
409 |
410 |
411 |
412 |
413 |
414 |
415 |
416 |
417 |
418 |
419 |
420 |
421 |
422 |
423 |
424 |
425 |
426 |
427 |
428 |
429 |
430 |
431 |
432 |
433 |
434 |
435 |
436 |
437 |
438 |
439 |
440 |
441 |
442 |
443 |
444 |
445 |
446 |
447 |
448 |
449 |
450 |
451 |
452 |
453 |
454 |
455 |
456 |
457 |
458 |
459 |
460 |
461 |
462 |
463 |
464 |
465 |
466 |
467 |
468 |
469 |
470 |
471 |
472 | Must set javac.includes
473 |
474 |
475 |
476 |
477 |
478 |
479 |
480 |
481 |
482 |
483 |
484 |
485 |
486 |
487 |
488 |
489 |
490 |
491 |
492 |
493 |
494 |
495 |
496 |
497 |
498 |
499 |
500 |
501 |
502 |
503 |
504 |
505 |
506 |
507 |
508 |
509 |
510 |
511 |
512 |
513 |
514 |
515 |
516 |
517 |
518 |
519 |
520 |
521 |
522 |
523 |
524 |
525 |
526 |
527 |
528 |
529 |
530 |
531 |
532 |
533 |
534 |
535 |
536 |
537 |
538 |
539 |
540 |
541 |
542 |
543 |
544 |
545 |
546 |
547 |
548 |
549 |
550 |
551 |
552 |
553 |
554 |
555 |
556 |
557 |
558 |
559 |
560 |
561 |
562 |
563 |
564 |
565 |
566 |
567 |
568 |
569 |
570 |
571 |
572 |
573 |
574 |
575 |
576 |
577 |
578 |
579 |
580 |
581 |
582 |
583 |
584 |
585 |
586 |
587 |
588 |
589 |
590 |
591 |
592 |
593 |
594 |
595 |
596 |
597 |
598 |
599 |
600 |
601 |
602 |
603 |
604 |
605 |
606 |
607 |
608 |
609 |
610 |
611 |
612 |
613 |
614 |
615 |
616 |
617 |
618 |
619 |
620 |
621 |
622 |
623 |
624 |
625 |
626 |
627 |
628 |
629 |
630 |
631 |
632 |
633 |
634 |
635 |
636 |
637 |
638 |
639 |
640 |
641 |
642 |
643 |
644 |
645 | No tests executed.
646 |
647 |
648 |
649 |
650 |
651 |
652 |
653 |
654 |
655 |
656 |
657 |
658 |
659 |
660 |
661 |
662 |
663 |
664 |
665 |
666 |
667 |
668 |
669 |
670 |
671 |
672 |
673 |
674 |
675 |
676 |
677 |
678 |
679 |
680 |
681 |
682 |
683 |
684 |
685 |
686 |
687 |
688 |
689 |
690 |
691 |
692 |
693 |
694 |
695 |
696 |
697 |
698 |
699 |
700 |
701 |
702 |
703 |
704 |
705 |
706 |
707 |
708 |
709 |
710 |
711 |
712 |
713 |
714 |
715 |
716 |
717 |
718 |
719 |
720 |
721 |
722 |
723 |
724 |
725 |
726 |
727 |
728 |
729 |
730 |
731 |
732 |
733 |
734 |
735 |
736 |
737 |
738 |
739 |
740 |
741 |
742 |
743 |
744 |
745 |
746 |
747 |
748 |
749 |
750 |
751 |
752 |
753 |
754 |
755 |
756 |
757 |
758 |
759 |
760 |
761 |
762 |
763 |
764 |
765 |
766 |
767 |
768 |
769 |
770 |
771 |
772 |
773 |
774 |
775 |
776 |
777 |
778 |
779 |
780 |
781 |
782 |
783 |
784 |
785 |
786 |
787 |
788 |
791 |
792 |
793 |
794 |
795 |
796 |
797 |
798 |
799 |
800 |
801 |
802 |
803 |
804 |
805 |
806 |
807 |
808 |
809 |
810 |
811 |
812 |
813 |
814 |
815 |
816 |
817 |
818 |
819 |
820 |
821 |
822 |
823 |
824 |
825 |
826 |
827 |
828 |
829 |
830 |
831 |
832 |
833 | Must set JVM to use for profiling in profiler.info.jvm
834 | Must set profiler agent JVM arguments in profiler.info.jvmargs.agent
835 |
836 |
839 |
840 |
841 |
842 |
843 |
844 |
845 |
846 |
847 |
848 |
849 |
850 |
851 |
852 |
853 |
854 |
855 |
856 |
857 |
858 |
859 |
860 |
861 |
862 |
863 |
864 |
865 |
866 |
867 |
868 |
869 |
870 |
871 |
872 |
873 |
874 |
875 |
876 |
877 |
878 |
879 |
880 |
881 |
882 |
883 |
884 |
885 |
886 |
887 |
888 |
889 |
890 |
891 |
892 |
893 |
894 |
895 |
896 |
897 |
898 |
899 |
900 |
901 |
902 |
903 |
904 |
905 |
906 |
907 |
908 |
909 |
910 |
911 |
912 |
913 |
914 |
915 |
916 |
917 |
918 |
919 |
920 |
921 |
922 |
923 |
924 |
925 |
926 |
927 |
928 |
929 |
930 |
931 |
932 |
933 |
934 |
935 |
936 |
937 |
938 |
939 |
940 |
941 |
942 |
943 |
944 |
945 |
946 |
947 |
948 |
949 |
950 |
951 |
952 |
953 |
954 |
955 |
956 |
957 |
958 |
959 |
960 |
961 |
962 |
963 |
964 |
965 |
966 |
967 |
968 |
969 |
970 |
971 |
972 |
973 |
974 |
975 |
976 |
977 |
978 |
979 |
980 |
981 |
982 |
983 |
984 |
985 |
986 |
987 |
988 |
989 |
990 |
991 |
992 |
993 |
994 |
995 |
996 |
997 |
998 |
999 |
1000 |
1001 |
1002 |
1003 |
1004 |
1005 |
1006 |
1007 |
1008 |
1009 |
1010 |
1011 |
1012 |
1013 |
1014 |
1015 |
1016 |
1017 |
1018 |
1019 |
1020 |
1021 |
1022 |
1023 |
1024 |
1025 |
1026 |
1027 |
1028 |
1029 |
1030 |
1031 |
1032 |
1033 |
1034 |
1035 |
1036 |
1037 |
1038 |
1039 |
1040 |
1041 |
1042 |
1043 |
1044 |
1045 |
1046 |
1047 |
1048 |
1049 |
1050 |
1055 |
1056 |
1057 |
1058 |
1059 |
1060 |
1061 |
1062 |
1063 |
1064 |
1065 |
1066 |
1067 |
1068 |
1069 |
1070 |
1071 |
1072 |
1073 |
1074 |
1075 |
1076 |
1077 |
1078 |
1079 |
1080 |
1081 |
1082 |
1083 |
1084 |
1085 |
1086 |
1087 |
1088 |
1089 |
1090 |
1091 |
1092 |
1093 |
1094 |
1095 |
1096 |
1097 |
1098 |
1099 |
1100 |
1101 |
1102 |
1103 |
1104 |
1105 |
1106 |
1107 |
1108 |
1109 |
1110 |
1111 |
1112 |
1113 |
1114 |
1115 |
1116 |
1117 | Must select some files in the IDE or set javac.includes
1118 |
1119 |
1120 |
1121 |
1122 |
1123 |
1124 |
1125 |
1126 |
1131 |
1132 |
1133 |
1134 |
1135 |
1136 |
1137 |
1138 |
1139 |
1140 |
1141 |
1142 |
1143 |
1144 |
1145 |
1146 |
1147 |
1148 |
1149 |
1150 |
1151 |
1152 |
1153 |
1154 |
1155 |
1156 |
1157 |
1158 |
1159 |
1160 |
1161 |
1162 |
1163 |
1164 |
1165 |
1166 |
1167 |
1168 |
1169 |
1170 |
1171 |
1172 |
1173 |
1174 |
1175 |
1176 |
1177 |
1178 |
1179 |
1180 |
1181 |
1182 |
1183 |
1184 |
1185 |
1186 |
1187 |
1188 |
1189 |
1190 |
1191 |
1192 |
1193 |
1194 |
1195 |
1196 |
1197 |
1198 |
1199 |
1200 | To run this application from the command line without Ant, try:
1201 |
1202 | java -jar "${dist.jar.resolved}"
1203 |
1204 |
1205 |
1206 |
1207 |
1208 |
1209 |
1210 |
1211 |
1212 |
1213 |
1214 |
1215 |
1216 |
1217 |
1218 |
1219 |
1220 |
1221 |
1222 |
1223 |
1224 |
1225 |
1226 |
1227 |
1228 |
1229 |
1230 |
1231 |
1232 |
1233 |
1234 |
1235 |
1236 |
1237 |
1238 |
1239 |
1240 |
1241 |
1242 |
1243 |
1244 |
1245 |
1246 |
1247 |
1248 |
1249 |
1250 |
1251 |
1252 |
1253 |
1254 |
1255 |
1256 |
1257 |
1258 |
1259 |
1264 |
1265 |
1266 |
1267 |
1268 |
1269 |
1270 |
1271 |
1272 |
1273 |
1274 |
1275 |
1276 |
1277 |
1278 |
1279 |
1280 |
1281 |
1282 |
1283 |
1284 |
1285 |
1286 |
1287 |
1288 |
1289 |
1290 |
1291 |
1292 |
1293 |
1294 |
1295 |
1296 |
1297 |
1298 |
1299 |
1300 |
1301 |
1302 |
1303 |
1304 |
1305 |
1306 |
1307 |
1308 |
1309 |
1310 |
1311 |
1312 |
1313 |
1314 |
1315 |
1316 |
1317 |
1318 |
1319 |
1320 |
1321 |
1322 |
1323 |
1324 |
1329 |
1330 |
1331 |
1332 |
1333 |
1334 |
1335 |
1336 |
1337 |
1338 |
1339 |
1340 | Must select one file in the IDE or set run.class
1341 |
1342 |
1343 |
1344 | Must select one file in the IDE or set run.class
1345 |
1346 |
1347 |
1352 |
1353 |
1354 |
1355 |
1356 |
1357 |
1358 |
1359 |
1360 |
1361 |
1362 |
1363 |
1364 |
1365 |
1366 |
1367 |
1368 |
1369 |
1370 |
1371 | Must select one file in the IDE or set debug.class
1372 |
1373 |
1374 |
1375 |
1376 | Must select one file in the IDE or set debug.class
1377 |
1378 |
1379 |
1380 |
1381 | Must set fix.includes
1382 |
1383 |
1384 |
1385 |
1386 |
1387 |
1388 |
1393 |
1396 |
1397 | This target only works when run from inside the NetBeans IDE.
1398 |
1399 |
1400 |
1401 |
1402 |
1403 |
1404 |
1405 |
1406 | Must select one file in the IDE or set profile.class
1407 | This target only works when run from inside the NetBeans IDE.
1408 |
1409 |
1410 |
1411 |
1412 |
1413 |
1414 |
1415 |
1416 | This target only works when run from inside the NetBeans IDE.
1417 |
1418 |
1419 |
1420 |
1421 |
1422 |
1423 |
1424 |
1425 |
1426 |
1427 |
1428 |
1429 | This target only works when run from inside the NetBeans IDE.
1430 |
1431 |
1432 |
1433 |
1434 |
1435 |
1436 |
1437 |
1438 |
1439 |
1440 |
1441 |
1442 |
1443 |
1444 |
1445 |
1446 |
1447 |
1450 |
1451 |
1452 |
1453 |
1454 |
1455 |
1456 |
1457 |
1458 |
1459 |
1460 |
1461 |
1462 |
1463 | Must select one file in the IDE or set run.class
1464 |
1465 |
1466 |
1467 |
1468 |
1469 | Must select some files in the IDE or set test.includes
1470 |
1471 |
1472 |
1473 |
1474 | Must select one file in the IDE or set run.class
1475 |
1476 |
1477 |
1478 |
1479 | Must select one file in the IDE or set applet.url
1480 |
1481 |
1482 |
1483 |
1488 |
1489 |
1490 |
1491 |
1492 |
1493 |
1494 |
1495 |
1496 |
1497 |
1498 |
1499 |
1500 |
1501 |
1502 |
1503 |
1504 |
1505 |
1506 |
1507 |
1508 |
1509 |
1510 |
1511 |
1512 |
1513 |
1514 |
1515 |
1516 |
1517 |
1518 |
1519 |
1520 |
1521 |
1522 |
1523 |
1524 |
1525 |
1526 |
1527 |
1528 |
1529 |
1530 |
1531 |
1532 |
1533 |
1534 |
1539 |
1540 |
1541 |
1542 |
1543 |
1544 |
1545 |
1546 |
1547 |
1548 |
1549 |
1550 |
1551 |
1552 |
1553 |
1554 |
1555 |
1556 |
1557 |
1558 |
1559 |
1560 |
1561 |
1562 |
1563 |
1564 |
1565 |
1566 |
1567 |
1568 |
1569 |
1570 |
1571 |
1572 |
1573 |
1574 |
1575 |
1576 |
1577 |
1578 |
1579 |
1580 |
1581 |
1582 |
1583 |
1584 |
1585 |
1586 |
1587 |
1588 |
1589 |
1590 |
1591 |
1592 |
1593 |
1594 |
1595 |
1596 |
1597 |
1598 |
1599 |
1600 |
1601 |
1602 |
1603 |
1604 |
1605 |
1606 |
1607 |
1608 |
1609 |
1610 |
1611 |
1612 |
1613 |
1614 |
1615 |
1616 |
1617 | Must select some files in the IDE or set javac.includes
1618 |
1619 |
1620 |
1621 |
1622 |
1623 |
1624 |
1625 |
1626 |
1627 |
1628 |
1629 |
1630 |
1631 |
1632 |
1633 |
1638 |
1639 |
1640 |
1641 |
1642 |
1643 |
1644 |
1645 | Some tests failed; see details above.
1646 |
1647 |
1648 |
1649 |
1650 |
1651 |
1652 |
1653 |
1654 | Must select some files in the IDE or set test.includes
1655 |
1656 |
1657 |
1658 | Some tests failed; see details above.
1659 |
1660 |
1661 |
1662 | Must select some files in the IDE or set test.class
1663 | Must select some method in the IDE or set test.method
1664 |
1665 |
1666 |
1667 | Some tests failed; see details above.
1668 |
1669 |
1670 |
1675 |
1676 | Must select one file in the IDE or set test.class
1677 |
1678 |
1679 |
1680 | Must select one file in the IDE or set test.class
1681 | Must select some method in the IDE or set test.method
1682 |
1683 |
1684 |
1685 |
1686 |
1687 |
1688 |
1689 |
1690 |
1691 |
1692 |
1693 |
1698 |
1699 | Must select one file in the IDE or set applet.url
1700 |
1701 |
1702 |
1703 |
1704 |
1705 |
1706 |
1711 |
1712 | Must select one file in the IDE or set applet.url
1713 |
1714 |
1715 |
1716 |
1717 |
1718 |
1719 |
1720 |
1725 |
1726 |
1727 |
1728 |
1729 |
1730 |
1731 |
1732 |
1733 |
1734 |
1735 |
1736 |
1737 |
1738 |
1739 |
1740 |
1741 |
1742 |
1743 |
1744 |
1745 |
1746 |
1747 |
1748 |
1749 |
1750 |
1751 |
1752 |
1753 |
1754 |
1755 |
1756 |
1757 |
1758 |
1759 |
1760 |
1761 |
1762 |
1763 |
1764 |
1765 |
1766 |
1767 |
1768 |
1769 |
1770 |
1771 |
--------------------------------------------------------------------------------