33 lines
735 B
Java
33 lines
735 B
Java
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
|
|
|
|
/**
|
|
* Write a description of class BreakingPlattform here.
|
|
*
|
|
* @author (your name)
|
|
* @version (a version number or a date)
|
|
*/
|
|
public class BreakingPlattform extends Plattform
|
|
{
|
|
boolean IsBreaking= false;
|
|
/**
|
|
* Act - do whatever the BreakingPlattform wants to do. This method is called whenever
|
|
* the 'Act' or 'Run' button gets pressed in the environment.
|
|
*/
|
|
public void act()
|
|
{
|
|
super.act();
|
|
if(this.PlayerOnPlattform() && IsBreaking==false)
|
|
{
|
|
IsBreaking= true;
|
|
}
|
|
}
|
|
|
|
public void breakPlattform()
|
|
{
|
|
if(this.PlayerOnPlattform())
|
|
{
|
|
|
|
}
|
|
}
|
|
}
|