Merge remote-tracking branch 'origin/main'

# Conflicts:
#	SMIMS-Game/MyWorld.class
#	SMIMS-Game/MyWorld.java
#	SMIMS-Game/project.greenfoot
This commit is contained in:
2026-09-15 11:55:52 +02:00
24 changed files with 232 additions and 93 deletions
+1 -28
View File
@@ -8,7 +8,7 @@ import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
*/
public class MyWorld extends World
{
int PlattformCountdown=20;
/**
* Constructor for objects of class MyWorld.
*
@@ -19,7 +19,6 @@ public class MyWorld extends World
super(400, 600, 1);
prepare();
}
/**
* Prepare the world for the start of the program.
* That is: create the initial objects and add them to the world.
@@ -29,30 +28,4 @@ public class MyWorld extends World
Player player = new Player();
addObject(player,302,320);
}
public void act()
{
if(PlattformCountdown==0) //Damit in regelmäßigen Abständen auf jeden Fall eine Plattform auftaucht
{
addObject(new Plattform(), Greenfoot.getRandomNumber(400), 5);
PlattformCountdown=100;
}
PlattformCountdown--;
if(Greenfoot.getRandomNumber(100000)>=99800)
{
addObject(new Plattform(), Greenfoot.getRandomNumber(400), 5);
}
if(Greenfoot.getRandomNumber(100000)>=99900)
{
addObject(new MovingPlattform(2), Greenfoot.getRandomNumber(400), 6); //Nach Rechts bewegende Plattform
}
if(Greenfoot.getRandomNumber(100000)>=99900)
{
addObject(new MovingPlattform(-2), Greenfoot.getRandomNumber(400), 6); //Nach Links bewegende Plattform
}
if(Greenfoot.getRandomNumber(100000)>=99750)
{
addObject(new BreakingPlattform(50), Greenfoot.getRandomNumber(400), 6); //Nach Links bewegende Plattform
}
}
}