diff options
author | mafaldo <mafaldo@heavyhammer.home> | 2018-02-10 15:12:05 +0100 |
---|---|---|
committer | mafaldo <mafaldo@heavyhammer.home> | 2018-02-10 15:12:05 +0100 |
commit | 0e8ebd8803718b37e9141649c6d8eb7036ec85ed (patch) | |
tree | 5b952c80b9d0616cf0bc7ba4243561352482e957 /src/main/java/Subconscious.java | |
parent | Switch to gradle, update gitignore (diff) | |
download | Subconscious-old-0e8ebd8803718b37e9141649c6d8eb7036ec85ed.tar.gz Subconscious-old-0e8ebd8803718b37e9141649c6d8eb7036ec85ed.zip |
Implement actor, create player
Diffstat (limited to '')
-rw-r--r-- | src/main/java/Subconscious.java | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/main/java/Subconscious.java b/src/main/java/Subconscious.java index b63eb23..8ce6b15 100644 --- a/src/main/java/Subconscious.java +++ b/src/main/java/Subconscious.java @@ -5,8 +5,11 @@ import java.awt.Graphics; import java.awt.Image; import java.awt.Dimension; +import java.awt.event.MouseListener; +import java.awt.event.MouseEvent; -public class Subconscious extends JPanel { + +public class Subconscious extends JPanel implements MouseListener { public static final String TITLE = "Subconscious"; @@ -26,6 +29,7 @@ public class Subconscious extends JPanel { // TODO remove demo currentScene = new WorldScene(new Dimension(200, 200), 50); + addMouseListener(this); } public void createWindow() { @@ -71,6 +75,16 @@ public class Subconscious extends JPanel { currentScene.render(g); } + /* listener */ + public void mouseClicked(MouseEvent e) { + int x = e.getX(); + int y = e.getY(); + } + public void mousePressed(MouseEvent e) {} + public void mouseReleased(MouseEvent e) {} + public void mouseEntered(MouseEvent e) {} + public void mouseExited(MouseEvent e) {} + /* main */ public static void main(String args[]) { Subconscious game = new Subconscious(); |