From f2f9aaf1c78fc805cde3db8205a3a7a02284910b Mon Sep 17 00:00:00 2001 From: agreiner Date: Mon, 22 Mar 2021 10:07:15 +0100 Subject: [PATCH] Praktikum 1 Abgabe --- .idea/.gitignore | 8 +++ .idea/misc.xml | 6 ++ .idea/modules.xml | 9 +++ Programmieren 2.iml | 11 ++++ README.md | 1 + SuperPangWorld/SuperPangWorld.iml | 11 ++++ .../src/superpangworld/Position.java | 57 ++++++++++++++++++ SuperPangWorld/src/superpangworld/Start.java | 16 +++++ .../superpangworld/Position.class | Bin 0 -> 1289 bytes .../SuperPangWorld/superpangworld/Start.class | Bin 0 -> 830 bytes 10 files changed, 119 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 Programmieren 2.iml create mode 100644 README.md create mode 100644 SuperPangWorld/SuperPangWorld.iml create mode 100644 SuperPangWorld/src/superpangworld/Position.java create mode 100644 SuperPangWorld/src/superpangworld/Start.java create mode 100644 out/production/SuperPangWorld/superpangworld/Position.class create mode 100644 out/production/SuperPangWorld/superpangworld/Start.class diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..b780272 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Datasource local storage ignored files +/../../../../../../:\Users\andre\IdeaProjects\Programmieren 2\.idea/dataSources/ +/dataSources.local.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..b947fab --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..f620f5b --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/Programmieren 2.iml b/Programmieren 2.iml new file mode 100644 index 0000000..c90834f --- /dev/null +++ b/Programmieren 2.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..90dc4a3 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +Umsetzung des Panic Mode von Super Pang World in Java für den Kurs Programmierung II and der TH Deggendorf. \ No newline at end of file diff --git a/SuperPangWorld/SuperPangWorld.iml b/SuperPangWorld/SuperPangWorld.iml new file mode 100644 index 0000000..c90834f --- /dev/null +++ b/SuperPangWorld/SuperPangWorld.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/SuperPangWorld/src/superpangworld/Position.java b/SuperPangWorld/src/superpangworld/Position.java new file mode 100644 index 0000000..2695d75 --- /dev/null +++ b/SuperPangWorld/src/superpangworld/Position.java @@ -0,0 +1,57 @@ +package superpangworld; + +/** + * Die Position eines Objekts auf einem Fenster anhand zweidimensoinaler Koordinaten + */ +public class Position { + + /** Die x-Koordinate */ + public double x; + /** Die y-Koordinate */ + public double y; + + /** + * Erzeugt eine Position mit den übergebenen Koordinaten + * + * @param x die x-Koordinate des Objekts + * @param y die y-Koordinate des Objekts + */ + public Position(double x, double y) { + this.x = x; + this.y = y; + } + + /** + * Veränderung der Position um einen Pixel nach links + */ + public void left() { + x--; + } + + /** + * Veränderung der Position um einen Pixel nach rechts + */ + public void right() { + x++; + } + + /** + * Veränderung der Position um einen Pixel nach oben + */ + public void up() { + y--; + } + + /** + * Veränderung der Position um einen Pixel nach unten + */ + public void down() { + y++; + } + + @Override + public String toString() { + return "Position(" + (int) Math.round(x) + ", " + (int) Math.round(y) + ')'; + } + +} diff --git a/SuperPangWorld/src/superpangworld/Start.java b/SuperPangWorld/src/superpangworld/Start.java new file mode 100644 index 0000000..813e48b --- /dev/null +++ b/SuperPangWorld/src/superpangworld/Start.java @@ -0,0 +1,16 @@ +package superpangworld; + +public class Start { + public static void main(String[] args) { + System.out.println("Spiel"); + + Position pos1 = new Position(100, 110); + Position pos2 = new Position(200, 300); + + pos2.down(); + pos2.right(); + + System.out.println(pos1); + System.out.println(pos2); + } +} diff --git a/out/production/SuperPangWorld/superpangworld/Position.class b/out/production/SuperPangWorld/superpangworld/Position.class new file mode 100644 index 0000000000000000000000000000000000000000..bf5bf7702a34c2d54c2b314ed16a42037ce7adf9 GIT binary patch literal 1289 zcmaKr?M@R>5Qg8=uPvpeSfGd^Rw=SwkP3c<)EHwMBBrPb1Vj9FXpil}vZvWS1-Sz+ z!OPG@qTz=Z;6)kdbW2*p;*UKuJDu~)%-h-Df6jjaSjW>8B8VD@r4dJhVf=s}^RmO; zR{8DzfoLd(#53Eq)pLfZS=t>z5+epuX^bMxFzt6c!s}4_iS(Ri`JMD_WlNWVeWItP z)5p@t>Rfi3!ZqX!Or$Z1DTc8@tu3zF3~^6(-6liKtd(BpsK4nnu49JE9PvX@m2QKp z_qJ-2=PT|ipCNBQ~G~;Fu#mk}7e}Zneoqx*du&O|5RGwU{>6rWsJ~PMZom- zl1F>dvkCIzxIyPlitZswZ$Q@i0cI_p!LUka$b9QvouxB}7@ZSzPGSU87(*VnC{mz{ zbPaR3O;&rl4C{HiP?Y=vbTM6Kor>t+MyQx;Uc1}*Q1)W(8wrtR{m&quMc15-5)+BTtP;`7%^~ zzkVE!WhBGEXr8h~9;12oA--5B;-+r&7Fjq)N7atelyQU@_5CmAu8oQwMyelP20CfW z#y#ywD>*oiH1(?Hy*vvowwf)t`h@HY zSnY74dfqFkiCS?dyZVpe4tBUe`Xs>lz@WTOt4=Mb)7w`NpW^T?r49p0h5>s9zys{j z%3vQ4>Cwp_iAz#9KEuo{Pm%qK;%Ncp0@ki@qcyW`7qCw2b#00bew)PZOyN+`a{fKJ z!Hp#kN^T2f1r{7`Zw