Merge remote-tracking branch 'origin/main'

# Conflicts:
#	SMIMS-Game/project.greenfoot
This commit is contained in:
2026-09-15 10:31:22 +02:00
27 changed files with 275 additions and 28 deletions
+21 -1
View File
@@ -1,5 +1,11 @@
import greenfoot.*;
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class Player here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Player extends Actor
{
private int speed = 6;
@@ -11,6 +17,8 @@ public class Player extends Actor
public void act()
{
player_movement();
collision();
moveLeftAndRight();
jump();
fall();
@@ -82,4 +90,16 @@ public class Player extends Actor
onGround = false;
}
}
public boolean collision(){
if (getIntersectingObjects(Projectile.class).size()>0)
{
Greenfoot.setWorld(new GameOverWorld());
return true;
}
else
{
return false;
}
}
}