diff --git a/SMIMS-Game/MyWorld.class b/SMIMS-Game/MyWorld.class
index e1c9b02..88b854f 100644
Binary files a/SMIMS-Game/MyWorld.class and b/SMIMS-Game/MyWorld.class differ
diff --git a/SMIMS-Game/MyWorld.ctxt b/SMIMS-Game/MyWorld.ctxt
index 5d845cc..2a6810e 100644
--- a/SMIMS-Game/MyWorld.ctxt
+++ b/SMIMS-Game/MyWorld.ctxt
@@ -13,4 +13,6 @@ comment4.params=
comment4.target=void\ projectile()
comment5.params=
comment5.target=void\ targetingProjectile()
-numComments=6
+comment6.params=
+comment6.target=void\ showScore()
+numComments=7
diff --git a/SMIMS-Game/MyWorld.java b/SMIMS-Game/MyWorld.java
index 2d78cda..df59608 100644
--- a/SMIMS-Game/MyWorld.java
+++ b/SMIMS-Game/MyWorld.java
@@ -9,9 +9,11 @@ import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
public class MyWorld extends World
{
int PlattformCountdown;
- int timer = 200; //Zeit, bevor das erste Projektil auftaucht
+ int timer = 300; //Zeit, bevor das erste Projektil auftaucht
//kann später noch beliebig angepasst werden
- int targetTimer = 100;
+ int targetTimer = 1000;
+ int time = 0;
+ int score = 0;
/**
* Constructor for objects of class MyWorld.
*
@@ -32,7 +34,11 @@ public class MyWorld extends World
Player player = new Player();
addObject(player,302,320);
Score score = new Score();
- addObject(score, 200, 50);
+ addObject(score, 200, 30);
+ score.setImage("Score1.png");
+ Score score1 = new Score();
+ addObject(score1, 200, 60);
+ score1.setImage("Score2.png");
Plattform plattform = new Plattform();
addObject(plattform,285,577);
plattform.setLocation(286,492);
@@ -54,6 +60,13 @@ public class MyWorld extends World
public void act()
{
+ Score score = new Score();
+ addObject(score, 200, 30);
+ score.setImage("Score1.png");
+ Score score1 = new Score();
+ addObject(score1, 200, 60);
+ score1.setImage("Score2.png");
+ showScore();
projectile();
targetingProjectile();
if(PlattformCountdown==0) //Damit in regelmäßigen Abständen auf jeden Fall eine Plattform auftaucht
@@ -89,7 +102,7 @@ public class MyWorld extends World
if(timer == 0){
Projectile projectile = new Projectile();
addObject(projectile,Greenfoot.getRandomNumber(300)+50,0);
- timer = 200; //zeitlicher Abstand
+ timer = 300; //zeitlicher Abstand
}
else{
timer = timer - 1;
@@ -100,10 +113,16 @@ public class MyWorld extends World
if(targetTimer == 0){
TargetingProjectile targetingProjectile = new TargetingProjectile();
addObject(targetingProjectile, Greenfoot.getRandomNumber(300)+50,0);
- targetTimer = 100;
+ targetTimer = 1000;
}
else{
targetTimer = targetTimer - 1;
}
}
+
+ public void showScore(){
+ time++;
+ score = time/60;
+ showText("" + score, 200, 60);
+ }
}
diff --git a/SMIMS-Game/Score.class b/SMIMS-Game/Score.class
index 2d6ec6b..68d900b 100644
Binary files a/SMIMS-Game/Score.class and b/SMIMS-Game/Score.class differ
diff --git a/SMIMS-Game/Score.ctxt b/SMIMS-Game/Score.ctxt
index 79e8783..1d6d801 100644
--- a/SMIMS-Game/Score.ctxt
+++ b/SMIMS-Game/Score.ctxt
@@ -4,8 +4,4 @@ comment0.text=\r\n\ Write\ a\ description\ of\ class\ UI\ here.\r\n\ \r\n\ @auth
comment1.params=
comment1.target=void\ act()
comment1.text=\r\n\ Act\ -\ do\ whatever\ the\ UI\ wants\ to\ do.\ This\ method\ is\ called\ whenever\r\n\ the\ 'Act'\ or\ 'Run'\ button\ gets\ pressed\ in\ the\ environment.\r\n
-comment2.params=
-comment2.target=void\ draw_score()
-comment3.params=
-comment3.target=int\ calculate_score()
-numComments=4
+numComments=2
diff --git a/SMIMS-Game/Score.java b/SMIMS-Game/Score.java
index bec09ba..8370b6f 100644
--- a/SMIMS-Game/Score.java
+++ b/SMIMS-Game/Score.java
@@ -8,22 +8,13 @@ import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
*/
public class Score extends Actor
{
- int timer;
+
/**
* Act - do whatever the UI wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
- timer++;
- draw_score();
}
- public void draw_score(){
- setImage(new GreenfootImage("Score:" + calculate_score(), 24, Color.WHITE, Color.BLACK));
- }
-
- public int calculate_score(){
- return timer/60;
- }
}
diff --git a/SMIMS-Game/doc/Score.html b/SMIMS-Game/doc/Score.html
new file mode 100644
index 0000000..df55b5a
--- /dev/null
+++ b/SMIMS-Game/doc/Score.html
@@ -0,0 +1,148 @@
+
+
+
+
+Score
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+public class Score
+extends greenfoot.Actor
+Write a description of class UI here.
+
+- Version:
+- (a version number or a date)
+- Autor:
+- (your name)
+
+
+
+
+
+-
+
+
Konstruktorübersicht
+Konstruktoren
+
+
+
+
+-
+
+
Methodenübersicht
+
+
+
+
+
+
+
+
void
+
+
+
Act - do whatever the UI wants to do.
+
+
int
+
+
+
void
+
+
+
+
+
+
+
+addedToWorld, getImage, getIntersectingObjects, getNeighbours, getObjectsAtOffset, getObjectsInRange, getOneIntersectingObject, getOneObjectAtOffset, getRotation, getWorld, getWorldOfType, getX, getY, intersects, isAtEdge, isTouching, move, removeTouching, setImage, setImage, setLocation, setRotation, sleepFor, turn, turnTowards
+
+
+
+
+
+
+
+
+-
+
+
+
+-
+
+
Methodendetails
+
+-
+
+
act
+public void act()
+Act - do whatever the UI wants to do. This method is called whenever
+ the 'Act' or 'Run' button gets pressed in the environment.
+
+- Setzt außer Kraft:
+act in Klasse greenfoot.Actor
+
+
+
+-
+
+
draw_score
+public void draw_score()
+
+
+-
+
+
calculate_score
+public int calculate_score()
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SMIMS-Game/doc/index.html b/SMIMS-Game/doc/index.html
index 0dddb70..3043857 100644
--- a/SMIMS-Game/doc/index.html
+++ b/SMIMS-Game/doc/index.html
@@ -1,11 +1,11 @@
-
+
Generierte Dokumentation (unbenannt)
-
+
diff --git a/SMIMS-Game/doc/logfile.txt b/SMIMS-Game/doc/logfile.txt
index 5b07d5f..0718a54 100644
--- a/SMIMS-Game/doc/logfile.txt
+++ b/SMIMS-Game/doc/logfile.txt
@@ -20,16 +20,16 @@ C:\Users\Marlie\Documents\Workspace\SMIMS_2026_2\SMIMS-Game\doc
UTF-8
-charset
UTF-8
-C:\Users\Marlie\Documents\Workspace\SMIMS_2026_2\SMIMS-Game\StartWorld.java
+C:\Users\Marlie\Documents\Workspace\SMIMS_2026_2\SMIMS-Game\Score.java
<---- end of javadoc command ---->
-Quelldatei C:\Users\Marlie\Documents\Workspace\SMIMS_2026_2\SMIMS-Game\StartWorld.java wird geladen...
+Quelldatei C:\Users\Marlie\Documents\Workspace\SMIMS_2026_2\SMIMS-Game\Score.java wird geladen...
Javadoc-Informationen werden erstellt...
Warnung: Unbekannte Enum-Konstante Tag.Any
Grund: Klassendatei für threadchecker.Tag nicht gefunden
Warnung: Unbekannte Enum-Konstante Tag.Any
Standard-Doclet-Version 21.0.4+7-LTS
Baum für alle Packages und Klassen wird erstellt...
-C:\Users\Marlie\Documents\Workspace\SMIMS_2026_2\SMIMS-Game\doc\StartWorld.html wird generiert...
+C:\Users\Marlie\Documents\Workspace\SMIMS_2026_2\SMIMS-Game\doc\Score.html wird generiert...
C:\Users\Marlie\Documents\Workspace\SMIMS_2026_2\SMIMS-Game\doc\package-summary.html wird generiert...
C:\Users\Marlie\Documents\Workspace\SMIMS_2026_2\SMIMS-Game\doc\index.html wird generiert...
2 Warnungen
diff --git a/SMIMS-Game/doc/package-summary.html b/SMIMS-Game/doc/package-summary.html
index 240d066..b78e4c0 100644
--- a/SMIMS-Game/doc/package-summary.html
+++ b/SMIMS-Game/doc/package-summary.html
@@ -1,11 +1,11 @@
-
+
Unbenanntes Package
-
+
@@ -31,9 +31,9 @@
-
+
-
Write a description of class StartWorld here.
+
Write a description of class UI here.
diff --git a/SMIMS-Game/images/Platform1.png b/SMIMS-Game/images/Platform1.png
new file mode 100644
index 0000000..dce9155
Binary files /dev/null and b/SMIMS-Game/images/Platform1.png differ
diff --git a/SMIMS-Game/images/Player.png b/SMIMS-Game/images/Player.png
new file mode 100644
index 0000000..110ffd3
Binary files /dev/null and b/SMIMS-Game/images/Player.png differ
diff --git a/SMIMS-Game/images/Score1.png b/SMIMS-Game/images/Score1.png
new file mode 100644
index 0000000..1923130
Binary files /dev/null and b/SMIMS-Game/images/Score1.png differ
diff --git a/SMIMS-Game/images/Score2.png b/SMIMS-Game/images/Score2.png
new file mode 100644
index 0000000..9178e78
Binary files /dev/null and b/SMIMS-Game/images/Score2.png differ
diff --git a/SMIMS-Game/images/greenfoot.png b/SMIMS-Game/images/greenfoot.png
new file mode 100644
index 0000000..265bfbc
Binary files /dev/null and b/SMIMS-Game/images/greenfoot.png differ
diff --git a/SMIMS-Game/project.greenfoot b/SMIMS-Game/project.greenfoot
index 8426964..78f8d91 100644
--- a/SMIMS-Game/project.greenfoot
+++ b/SMIMS-Game/project.greenfoot
@@ -1,22 +1,19 @@
#Greenfoot project file
class.BreakingPlattform.image=Unbenannt2.png
class.Button.image=button-red.png
-class.Enemy.image=bee.png
-class.EnemyProjectile.image=yellow-draught.png
class.GameOverWorld.image=GameOverBackground.png
class.Ground.image=weave.jpg
class.JumpBoostItem.image=mushroom.png
class.MovingPlattform.image=Unbenannt.png
class.MyWorld.image=GameBackground.png
-class.Plattform.image=Plattform.png
-class.Player.image=ppl2.png
-class.PlayerProjectile.image=beeper.png
+class.Plattform.image=Platform1.png
+class.Player.image=Player.png
class.Projectile.image=Projectile1.png
class.Spike.image=Spike.png
class.SpikedPlattform.image=SpikedPlattform.png
class.StartWorld.image=StartBackground.png
class.TargetingProjectile.image=blue-draught.png
-class.UnactiveSpike.image=Spike_Copy.png
+class.UnactiveSpike.image=SpikeUnactive.png
dependency1.from=GameOverWorld
dependency1.to=Button
dependency1.type=UsesDependency
@@ -138,7 +135,7 @@ editor.fx.0.height=737
editor.fx.0.width=814
editor.fx.0.x=360
editor.fx.0.y=26
-height=581
+height=830
package.numDependencies=39
package.numTargets=21
project.charset=UTF-8
@@ -306,4 +303,4 @@ version=3.1.0
width=1550
world.lastInstantiated=MyWorld
xPosition=0
-yPosition=123
+yPosition=0