Merge remote-tracking branch 'origin/main'
# Conflicts: # SMIMS-Game/MyWorld.class # SMIMS-Game/project.greenfoot
@@ -9,7 +9,7 @@ import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
|
|||||||
public class MyWorld extends World
|
public class MyWorld extends World
|
||||||
{
|
{
|
||||||
int PlattformCountdown;
|
int PlattformCountdown;
|
||||||
int timer = 300; //Zeit, bevor das erste Projektil auftaucht
|
int timer = 600; //Zeit, bevor das erste Projektil auftaucht
|
||||||
//kann später noch beliebig angepasst werden
|
//kann später noch beliebig angepasst werden
|
||||||
int targetTimer = 1000;
|
int targetTimer = 1000;
|
||||||
int time = 0;
|
int time = 0;
|
||||||
@@ -58,8 +58,6 @@ public class MyWorld extends World
|
|||||||
plattform2.setLocation(320,367);
|
plattform2.setLocation(320,367);
|
||||||
plattform2.setLocation(312,371);
|
plattform2.setLocation(312,371);
|
||||||
plattform2.setLocation(308,382);
|
plattform2.setLocation(308,382);
|
||||||
//Healthbar healthbar = new Healthbar();
|
|
||||||
//addObject(healthbar,50,50);
|
|
||||||
Heart heart = new Heart();
|
Heart heart = new Heart();
|
||||||
addObject(heart,371,27);
|
addObject(heart,371,27);
|
||||||
Heart heart2 = new Heart();
|
Heart heart2 = new Heart();
|
||||||
@@ -148,7 +146,7 @@ public class MyWorld extends World
|
|||||||
if(timer == 0){
|
if(timer == 0){
|
||||||
Projectile projectile = new Projectile();
|
Projectile projectile = new Projectile();
|
||||||
addObject(projectile,Greenfoot.getRandomNumber(300)+50,0);
|
addObject(projectile,Greenfoot.getRandomNumber(300)+50,0);
|
||||||
timer = 300; //zeitlicher Abstand
|
timer = 600; //zeitlicher Abstand
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
timer = timer - 1;
|
timer = timer - 1;
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ comment0.target=Player
|
|||||||
comment0.text=\r\n\ Write\ a\ description\ of\ class\ Player\ here.\r\n\ \r\n\ @author\ (your\ name)\ \r\n\ @version\ (a\ version\ number\ or\ a\ date)\r\n
|
comment0.text=\r\n\ Write\ a\ description\ of\ class\ Player\ here.\r\n\ \r\n\ @author\ (your\ name)\ \r\n\ @version\ (a\ version\ number\ or\ a\ date)\r\n
|
||||||
comment1.params=
|
comment1.params=
|
||||||
comment1.target=void\ act()
|
comment1.target=void\ act()
|
||||||
|
comment10.params=
|
||||||
|
comment10.target=void\ playerRotation()
|
||||||
comment2.params=
|
comment2.params=
|
||||||
comment2.target=void\ moveLeftAndRight()
|
comment2.target=void\ moveLeftAndRight()
|
||||||
comment3.params=
|
comment3.params=
|
||||||
@@ -19,4 +21,4 @@ comment8.params=
|
|||||||
comment8.target=void\ handlePowerUps()
|
comment8.target=void\ handlePowerUps()
|
||||||
comment9.params=duration\ type
|
comment9.params=duration\ type
|
||||||
comment9.target=void\ receivePowerUp(int,\ java.lang.String)
|
comment9.target=void\ receivePowerUp(int,\ java.lang.String)
|
||||||
numComments=10
|
numComments=11
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ public class Player extends Actor
|
|||||||
handlePowerUps();
|
handlePowerUps();
|
||||||
shootProjectile();
|
shootProjectile();
|
||||||
checkHealth();
|
checkHealth();
|
||||||
|
playerRotation();
|
||||||
|
|
||||||
//Check ob der Spieler am unteren Fensterrand ist
|
//Check ob der Spieler am unteren Fensterrand ist
|
||||||
if (getY()+1 >= getWorld().getHeight()){
|
if (getY()+1 >= getWorld().getHeight()){
|
||||||
@@ -177,4 +178,13 @@ public class Player extends Actor
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void playerRotation(){
|
||||||
|
if(Greenfoot.isKeyDown("a")){
|
||||||
|
setImage("PlayerLeft.png");
|
||||||
|
}
|
||||||
|
if(Greenfoot.isKeyDown("d")){
|
||||||
|
setImage("Player.png");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,14 +41,14 @@ public class TemporaryGround extends Plattform
|
|||||||
|
|
||||||
public void warning()
|
public void warning()
|
||||||
{
|
{
|
||||||
this.setImage("TemporaryIsBreaking.png");
|
this.setImage("BreakingGround.png");
|
||||||
warningHasHappend=true;
|
warningHasHappend=true;
|
||||||
deWarningHasHappend=false;
|
deWarningHasHappend=false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void noMoreWarning()
|
public void noMoreWarning()
|
||||||
{
|
{
|
||||||
this.setImage("TemporaryGround.png");
|
this.setImage("Ground.png");
|
||||||
warningHasHappend=false;
|
warningHasHappend=false;
|
||||||
deWarningHasHappend=true;
|
deWarningHasHappend=true;
|
||||||
}
|
}
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 8.1 KiB |
|
After Width: | Height: | Size: 58 KiB |
|
After Width: | Height: | Size: 139 B |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 40 KiB |
|
After Width: | Height: | Size: 4.8 KiB |
|
After Width: | Height: | Size: 707 B |
|
After Width: | Height: | Size: 2.4 KiB |
@@ -1,8 +1,7 @@
|
|||||||
#Greenfoot project file
|
#Greenfoot project file
|
||||||
class.BreakingPlattform.image=Breaking1.png
|
class.BreakingPlattform.image=Breaking1.png
|
||||||
class.Button.image=Start.png
|
class.Button.image=button-red.png
|
||||||
class.Enemy.image=bee.png
|
class.Enemy.image=bee.png
|
||||||
class.EnemyProjectile.image=Projectile1.png
|
|
||||||
class.GameOverWorld.image=GameOverBackground.png
|
class.GameOverWorld.image=GameOverBackground.png
|
||||||
class.Ground.image=weave.jpg
|
class.Ground.image=weave.jpg
|
||||||
class.Groundflower.image=flower2.png
|
class.Groundflower.image=flower2.png
|
||||||
@@ -13,13 +12,13 @@ class.MovingPlattform.image=Platform1.png
|
|||||||
class.MyWorld.image=GameBackground.png
|
class.MyWorld.image=GameBackground.png
|
||||||
class.Plattform.image=Platform1.png
|
class.Plattform.image=Platform1.png
|
||||||
class.Player.image=Player.png
|
class.Player.image=Player.png
|
||||||
class.Score.image=Score1.png
|
class.PlayerProjectile.image=beeper.png
|
||||||
|
class.Projectile.image=Projectile1.png
|
||||||
class.Spike.image=singleSpike.png
|
class.Spike.image=singleSpike.png
|
||||||
class.SpikedPlattform.image=Spikes.png
|
class.SpikedPlattform.image=Spikes2.png
|
||||||
class.StartWorld.image=StartBackground.png
|
class.StartWorld.image=StartBackground.png
|
||||||
class.TargetingProjectile.image=yellow-draught.png
|
class.TargetingProjectile.image=blue-draught.png
|
||||||
class.TemporaryGround.image=TemporaryGround.png
|
class.UnactiveSpike.image=inactiveSpike.png
|
||||||
class.UnactiveSpike.image=Spike_Copy.png
|
|
||||||
dependency1.from=PlayerTestWorld
|
dependency1.from=PlayerTestWorld
|
||||||
dependency1.to=Ground
|
dependency1.to=Ground
|
||||||
dependency1.type=UsesDependency
|
dependency1.type=UsesDependency
|
||||||
@@ -27,91 +26,91 @@ dependency10.from=MyWorld
|
|||||||
dependency10.to=BreakingPlattform
|
dependency10.to=BreakingPlattform
|
||||||
dependency10.type=UsesDependency
|
dependency10.type=UsesDependency
|
||||||
dependency11.from=MyWorld
|
dependency11.from=MyWorld
|
||||||
dependency11.to=Groundflower
|
dependency11.to=SpikedPlattform
|
||||||
dependency11.type=UsesDependency
|
dependency11.type=UsesDependency
|
||||||
dependency12.from=MyWorld
|
dependency12.from=MyWorld
|
||||||
dependency12.to=HealthItem
|
dependency12.to=Groundflower
|
||||||
dependency12.type=UsesDependency
|
dependency12.type=UsesDependency
|
||||||
dependency13.from=MyWorld
|
dependency13.from=MyWorld
|
||||||
dependency13.to=JumpBoostItem
|
dependency13.to=Enemy
|
||||||
dependency13.type=UsesDependency
|
dependency13.type=UsesDependency
|
||||||
dependency14.from=MyWorld
|
dependency14.from=MyWorld
|
||||||
dependency14.to=Enemy
|
dependency14.to=Projectile
|
||||||
dependency14.type=UsesDependency
|
dependency14.type=UsesDependency
|
||||||
dependency15.from=MyWorld
|
dependency15.from=MyWorld
|
||||||
dependency15.to=Projectile
|
dependency15.to=TargetingProjectile
|
||||||
dependency15.type=UsesDependency
|
dependency15.type=UsesDependency
|
||||||
dependency16.from=MyWorld
|
dependency16.from=GameOverWorld
|
||||||
dependency16.to=TargetingProjectile
|
dependency16.to=Button
|
||||||
dependency16.type=UsesDependency
|
dependency16.type=UsesDependency
|
||||||
dependency17.from=GameOverWorld
|
dependency17.from=StartWorld
|
||||||
dependency17.to=Button
|
dependency17.to=Button
|
||||||
dependency17.type=UsesDependency
|
dependency17.type=UsesDependency
|
||||||
dependency18.from=StartWorld
|
dependency18.from=UnactiveSpike
|
||||||
dependency18.to=Button
|
dependency18.to=SpikedPlattform
|
||||||
dependency18.type=UsesDependency
|
dependency18.type=UsesDependency
|
||||||
dependency19.from=UnactiveSpike
|
dependency19.from=UnactiveSpike
|
||||||
dependency19.to=SpikedPlattform
|
dependency19.to=MyWorld
|
||||||
dependency19.type=UsesDependency
|
dependency19.type=UsesDependency
|
||||||
dependency2.from=PlayerTestWorld
|
dependency2.from=PlayerTestWorld
|
||||||
dependency2.to=Player
|
dependency2.to=Player
|
||||||
dependency2.type=UsesDependency
|
dependency2.type=UsesDependency
|
||||||
dependency20.from=UnactiveSpike
|
dependency20.from=UnactiveSpike
|
||||||
dependency20.to=MyWorld
|
dependency20.to=Spike
|
||||||
dependency20.type=UsesDependency
|
dependency20.type=UsesDependency
|
||||||
dependency21.from=UnactiveSpike
|
dependency21.from=Button
|
||||||
dependency21.to=Spike
|
dependency21.to=MyWorld
|
||||||
dependency21.type=UsesDependency
|
dependency21.type=UsesDependency
|
||||||
dependency22.from=Button
|
dependency22.from=PowerUps
|
||||||
dependency22.to=MyWorld
|
dependency22.to=Player
|
||||||
dependency22.type=UsesDependency
|
dependency22.type=UsesDependency
|
||||||
dependency23.from=PowerUps
|
dependency23.from=HealthItem
|
||||||
dependency23.to=Player
|
dependency23.to=Player
|
||||||
dependency23.type=UsesDependency
|
dependency23.type=UsesDependency
|
||||||
dependency24.from=HealthItem
|
dependency24.from=JumpBoostItem
|
||||||
dependency24.to=Player
|
dependency24.to=Player
|
||||||
dependency24.type=UsesDependency
|
dependency24.type=UsesDependency
|
||||||
dependency25.from=JumpBoostItem
|
dependency25.from=Groundflower
|
||||||
dependency25.to=Player
|
dependency25.to=Player
|
||||||
dependency25.type=UsesDependency
|
dependency25.type=UsesDependency
|
||||||
dependency26.from=Groundflower
|
dependency26.from=Enemy
|
||||||
dependency26.to=Player
|
dependency26.to=Player
|
||||||
dependency26.type=UsesDependency
|
dependency26.type=UsesDependency
|
||||||
dependency27.from=Enemy
|
dependency27.from=Enemy
|
||||||
dependency27.to=Player
|
dependency27.to=EnemyProjectile
|
||||||
dependency27.type=UsesDependency
|
dependency27.type=UsesDependency
|
||||||
dependency28.from=Enemy
|
dependency28.from=Spike
|
||||||
dependency28.to=EnemyProjectile
|
dependency28.to=MyWorld
|
||||||
dependency28.type=UsesDependency
|
dependency28.type=UsesDependency
|
||||||
dependency29.from=Spike
|
dependency29.from=Player
|
||||||
dependency29.to=MyWorld
|
dependency29.to=GameOverWorld
|
||||||
dependency29.type=UsesDependency
|
dependency29.type=UsesDependency
|
||||||
dependency3.from=PlayerTestWorld
|
dependency3.from=PlayerTestWorld
|
||||||
dependency3.to=JumpBoostItem
|
dependency3.to=JumpBoostItem
|
||||||
dependency3.type=UsesDependency
|
dependency3.type=UsesDependency
|
||||||
dependency30.from=Player
|
dependency30.from=Player
|
||||||
dependency30.to=GameOverWorld
|
dependency30.to=Plattform
|
||||||
dependency30.type=UsesDependency
|
dependency30.type=UsesDependency
|
||||||
dependency31.from=Player
|
dependency31.from=Player
|
||||||
dependency31.to=Plattform
|
dependency31.to=PlayerProjectile
|
||||||
dependency31.type=UsesDependency
|
dependency31.type=UsesDependency
|
||||||
dependency32.from=Player
|
dependency32.from=Player
|
||||||
dependency32.to=PlayerProjectile
|
dependency32.to=TemporaryGround
|
||||||
dependency32.type=UsesDependency
|
dependency32.type=UsesDependency
|
||||||
dependency33.from=Player
|
dependency33.from=Player
|
||||||
dependency33.to=TemporaryGround
|
dependency33.to=Projectile
|
||||||
dependency33.type=UsesDependency
|
dependency33.type=UsesDependency
|
||||||
dependency34.from=Player
|
dependency34.from=Player
|
||||||
dependency34.to=Projectile
|
dependency34.to=Enemy
|
||||||
dependency34.type=UsesDependency
|
dependency34.type=UsesDependency
|
||||||
dependency35.from=Player
|
dependency35.from=Player
|
||||||
dependency35.to=Enemy
|
dependency35.to=Spike
|
||||||
dependency35.type=UsesDependency
|
dependency35.type=UsesDependency
|
||||||
dependency36.from=Player
|
dependency36.from=Player
|
||||||
dependency36.to=Spike
|
dependency36.to=Heart
|
||||||
dependency36.type=UsesDependency
|
dependency36.type=UsesDependency
|
||||||
dependency37.from=Player
|
dependency37.from=Healthbar
|
||||||
dependency37.to=Heart
|
dependency37.to=Player
|
||||||
dependency37.type=UsesDependency
|
dependency37.type=UsesDependency
|
||||||
dependency38.from=Plattform
|
dependency38.from=Plattform
|
||||||
dependency38.to=MyWorld
|
dependency38.to=MyWorld
|
||||||
@@ -164,13 +163,13 @@ dependency8.type=UsesDependency
|
|||||||
dependency9.from=MyWorld
|
dependency9.from=MyWorld
|
||||||
dependency9.to=MovingPlattform
|
dependency9.to=MovingPlattform
|
||||||
dependency9.type=UsesDependency
|
dependency9.type=UsesDependency
|
||||||
editor.fx.0.height=739
|
editor.fx.0.height=737
|
||||||
editor.fx.0.width=816
|
editor.fx.0.width=814
|
||||||
editor.fx.0.x=734
|
editor.fx.0.x=386
|
||||||
editor.fx.0.y=336
|
editor.fx.0.y=48
|
||||||
height=1048
|
height=830
|
||||||
package.numDependencies=48
|
package.numDependencies=48
|
||||||
package.numTargets=25
|
package.numTargets=26
|
||||||
project.charset=UTF-8
|
project.charset=UTF-8
|
||||||
publish.hasSource=false
|
publish.hasSource=false
|
||||||
publish.locked=true
|
publish.locked=true
|
||||||
@@ -184,7 +183,7 @@ readme.name=@README
|
|||||||
readme.width=49
|
readme.width=49
|
||||||
readme.x=10
|
readme.x=10
|
||||||
readme.y=10
|
readme.y=10
|
||||||
simulation.speed=52
|
simulation.speed=50
|
||||||
target1.height=70
|
target1.height=70
|
||||||
target1.name=Heart
|
target1.name=Heart
|
||||||
target1.showInterface=false
|
target1.showInterface=false
|
||||||
@@ -242,21 +241,21 @@ target16.width=120
|
|||||||
target16.x=0
|
target16.x=0
|
||||||
target16.y=0
|
target16.y=0
|
||||||
target17.height=70
|
target17.height=70
|
||||||
target17.name=BreakingPlattform
|
target17.name=Healthbar
|
||||||
target17.showInterface=false
|
target17.showInterface=false
|
||||||
target17.type=ClassTarget
|
target17.type=ClassTarget
|
||||||
target17.width=120
|
target17.width=120
|
||||||
target17.x=0
|
target17.x=0
|
||||||
target17.y=0
|
target17.y=0
|
||||||
target18.height=70
|
target18.height=70
|
||||||
target18.name=GameOverWorld
|
target18.name=BreakingPlattform
|
||||||
target18.showInterface=false
|
target18.showInterface=false
|
||||||
target18.type=ClassTarget
|
target18.type=ClassTarget
|
||||||
target18.width=120
|
target18.width=120
|
||||||
target18.x=0
|
target18.x=0
|
||||||
target18.y=0
|
target18.y=0
|
||||||
target19.height=70
|
target19.height=70
|
||||||
target19.name=StartWorld
|
target19.name=GameOverWorld
|
||||||
target19.showInterface=false
|
target19.showInterface=false
|
||||||
target19.type=ClassTarget
|
target19.type=ClassTarget
|
||||||
target19.width=120
|
target19.width=120
|
||||||
@@ -270,47 +269,54 @@ target2.width=120
|
|||||||
target2.x=0
|
target2.x=0
|
||||||
target2.y=0
|
target2.y=0
|
||||||
target20.height=70
|
target20.height=70
|
||||||
target20.name=Plattform
|
target20.name=StartWorld
|
||||||
target20.showInterface=false
|
target20.showInterface=false
|
||||||
target20.type=ClassTarget
|
target20.type=ClassTarget
|
||||||
target20.width=120
|
target20.width=120
|
||||||
target20.x=0
|
target20.x=0
|
||||||
target20.y=0
|
target20.y=0
|
||||||
target21.height=70
|
target21.height=70
|
||||||
target21.name=Projectile
|
target21.name=Plattform
|
||||||
target21.showInterface=false
|
target21.showInterface=false
|
||||||
target21.type=ClassTarget
|
target21.type=ClassTarget
|
||||||
target21.width=120
|
target21.width=120
|
||||||
target21.x=0
|
target21.x=0
|
||||||
target21.y=0
|
target21.y=0
|
||||||
target22.height=70
|
target22.height=70
|
||||||
target22.name=Score
|
target22.name=Projectile
|
||||||
target22.showInterface=false
|
target22.showInterface=false
|
||||||
target22.type=ClassTarget
|
target22.type=ClassTarget
|
||||||
target22.width=120
|
target22.width=120
|
||||||
target22.x=0
|
target22.x=0
|
||||||
target22.y=0
|
target22.y=0
|
||||||
target23.height=70
|
target23.height=70
|
||||||
target23.name=EnemyProjectile
|
target23.name=Score
|
||||||
target23.showInterface=false
|
target23.showInterface=false
|
||||||
target23.type=ClassTarget
|
target23.type=ClassTarget
|
||||||
target23.width=120
|
target23.width=120
|
||||||
target23.x=0
|
target23.x=0
|
||||||
target23.y=0
|
target23.y=0
|
||||||
target24.height=70
|
target24.height=70
|
||||||
target24.name=PlayerProjectile
|
target24.name=EnemyProjectile
|
||||||
target24.showInterface=false
|
target24.showInterface=false
|
||||||
target24.type=ClassTarget
|
target24.type=ClassTarget
|
||||||
target24.width=120
|
target24.width=120
|
||||||
target24.x=0
|
target24.x=0
|
||||||
target24.y=0
|
target24.y=0
|
||||||
target25.height=70
|
target25.height=70
|
||||||
target25.name=SpikedPlattform
|
target25.name=PlayerProjectile
|
||||||
target25.showInterface=false
|
target25.showInterface=false
|
||||||
target25.type=ClassTarget
|
target25.type=ClassTarget
|
||||||
target25.width=120
|
target25.width=120
|
||||||
target25.x=0
|
target25.x=0
|
||||||
target25.y=0
|
target25.y=0
|
||||||
|
target26.height=70
|
||||||
|
target26.name=SpikedPlattform
|
||||||
|
target26.showInterface=false
|
||||||
|
target26.type=ClassTarget
|
||||||
|
target26.width=120
|
||||||
|
target26.x=0
|
||||||
|
target26.y=0
|
||||||
target3.height=70
|
target3.height=70
|
||||||
target3.name=Ground
|
target3.name=Ground
|
||||||
target3.showInterface=false
|
target3.showInterface=false
|
||||||
@@ -361,7 +367,7 @@ target9.width=120
|
|||||||
target9.x=0
|
target9.x=0
|
||||||
target9.y=0
|
target9.y=0
|
||||||
version=3.1.0
|
version=3.1.0
|
||||||
width=1936
|
width=1550
|
||||||
world.lastInstantiated=StartWorld
|
world.lastInstantiated=StartWorld
|
||||||
xPosition=0
|
xPosition=0
|
||||||
yPosition=0
|
yPosition=0
|
||||||
|
|||||||