aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Info/10/2/Baelle/Baelle.json35
1 files changed, 35 insertions, 0 deletions
diff --git a/Info/10/2/Baelle/Baelle.json b/Info/10/2/Baelle/Baelle.json
new file mode 100644
index 00000000..abcc0dcf
--- /dev/null
+++ b/Info/10/2/Baelle/Baelle.json
@@ -0,0 +1,35 @@
+{
+ "name": "Baelle",
+ "id": 982460,
+ "modules": [
+ {
+ "name": "Ball",
+ "text": "public class Ball extends Kreis {\n static final double BESCHLEUNIGUNG = 5;\n double geschwindigkeit = 0;\n \n public Ball(int x, int y, int radius) {\n super(x, y, radius);\n }\n \n public void act() {\n double x = getCenterX();\n double y = getCenterY();\n\n // Der Ball liegt\n if(y == 600 - this.getRadius()) {\n return;\n }\n\n // Der Ball faellt\n geschwindigkeit += BESCHLEUNIGUNG; // Beschleunigung\n double ny = y + geschwindigkeit;\n if(ny >= 600 - getRadius()) { // Der Ball ist aufgeschlagen\n ny = 600 - getRadius();\n geschwindigkeit = 0;\n }\n\n super.SetzePosition(x, ny);\n }\n}\n\nnew Ball(100, 40, 40);\nnew Flummi(150, 10, 1);\n",
+ "identical_to_repository_version": true,
+ "is_copy_of_id": null,
+ "repository_file_version": null,
+ "isFolder": false
+ },
+ {
+ "name": "Kreis",
+ "text": "public class Kreis extends Circle\n{\n String farbe;\n\n public Kreis(int xPosNeu, int yPosNeu, int radiusNeu) {\n super(xPosNeu, yPosNeu, radiusNeu);\n this.FarbeSetzen(\"red\");\n }\n\n public void FarbeSetzen(String neueFarbe) {\n farbe = neueFarbe;\n this.setFillColor(farbe);\n }\n\n public String GibFarbe() {\n return farbe;\n }\n\n public void SetzePosition(double xPosNeu, double yPosNeu) {\n this.moveTo(xPosNeu, yPosNeu);\n } \n}\n",
+ "identical_to_repository_version": true,
+ "is_copy_of_id": null,
+ "repository_file_version": null,
+ "isFolder": false
+ },
+ {
+ "name": "Flummi",
+ "text": "public class Flummi extends Ball {\n double bounceFaktor;\n \n public Flummi(int x, int y, double neuerBounceFaktor) {\n super(x, y, 20);\n bounceFaktor = neuerBounceFaktor;\n super.FarbeSetzen(\"green\");\n }\n \n public void act() {\n double x = getCenterX();\n double y = getCenterY();\n\n // Der Flummi liegt\n if(y == 600 - getRadius() && geschwindigkeit > 0) {\n return;\n }\n // Der Flummi faellt\n geschwindigkeit += BESCHLEUNIGUNG; // Beschleunigung\n double ny = y + (int)geschwindigkeit;\n if(ny >= 600 - getRadius()) { // Der Flummi ist aufgeschlagen\n ny = 600 - getRadius();\n geschwindigkeit = -1 * bounceFaktor * geschwindigkeit;\n }\n\n super.SetzePosition(x, ny);\n }\n}\n",
+ "identical_to_repository_version": true,
+ "is_copy_of_id": null,
+ "repository_file_version": null,
+ "isFolder": false
+ }
+ ],
+ "settings": {
+ "libraries": []
+ },
+ "parent_folder_id": 897857,
+ "isFolder": false
+} \ No newline at end of file