SpikedPlattforms2
This commit is contained in:
@@ -12,11 +12,16 @@ public class SpikedPlattform extends Plattform
|
||||
boolean spikesActivated=false;
|
||||
boolean isSpiked=false;
|
||||
Spike[] hasSpikes= new Spike[5];
|
||||
public SpikedPlattform(int pSpikeCountdown)
|
||||
{
|
||||
SpikeCountdown=pSpikeCountdown;
|
||||
}
|
||||
|
||||
/**
|
||||
* Act - do whatever the SpikedPlattform wants to do. This method is called whenever
|
||||
* the 'Act' or 'Run' button gets pressed in the environment.
|
||||
*/
|
||||
public void act(int pSpikeCountdown)
|
||||
public void act()
|
||||
{
|
||||
// Add your action code here.
|
||||
if(this.PlayerOnPlattform() && spikesActivated== false)
|
||||
@@ -41,6 +46,11 @@ public class SpikedPlattform extends Plattform
|
||||
public void activateSpikes()
|
||||
{
|
||||
spikesActivated=true;
|
||||
MyWorld theWorld= (MyWorld) this.getWorld();
|
||||
for(int i=-6; i<7; i++)
|
||||
{
|
||||
theWorld.addObject(new UnactiveSpike(2,SpikeCountdown, this ), this.getX()+i* (this.getImage().getWidth()/13), this.getY()-(this.getImage().getHeight()/2));
|
||||
}
|
||||
//Sound
|
||||
//setImage
|
||||
|
||||
@@ -49,12 +59,8 @@ public class SpikedPlattform extends Plattform
|
||||
public void spikeTheSurface()
|
||||
{
|
||||
isSpiked=true;
|
||||
MyWorld theWorld= (MyWorld) this.getWorld();
|
||||
for(int i=0; i<3; i++)
|
||||
{
|
||||
theWorld.addObject(new Spike(2), this.getX()-this.getImage().getWidth()+ i*this.getImage().getWidth()/3, this.getX()-this.getImage().getHeight()/2);
|
||||
}
|
||||
//Sound
|
||||
|
||||
//Soun)
|
||||
//setImage
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user