- Spieler Attacke, Animation
This commit is contained in:
+23
-1
@@ -6,12 +6,19 @@ import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
|
||||
* @author (your name)
|
||||
* @version (a version number or a date)
|
||||
*/
|
||||
public class player2 extends Actor
|
||||
public class Player2 extends Actor
|
||||
{
|
||||
/**
|
||||
* Act - do whatever the player wants to do. This method is called whenever
|
||||
* the 'Act' or 'Run' button gets pressed in the environment.
|
||||
*/
|
||||
|
||||
public int leben;
|
||||
long c;
|
||||
|
||||
Player2(){
|
||||
leben = 100;
|
||||
}
|
||||
public void act()
|
||||
{
|
||||
bewegung();
|
||||
@@ -42,6 +49,21 @@ public class player2 extends Actor
|
||||
}
|
||||
}
|
||||
|
||||
public boolean attacke(){
|
||||
if(Greenfoot.isKeyDown("e")){
|
||||
if(System.currentTimeMillis() >= c){
|
||||
c = System.currentTimeMillis() + 2000;
|
||||
return true;
|
||||
}
|
||||
else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void gravitation(){
|
||||
if(this.getY() < 370){
|
||||
setRotation(90);
|
||||
|
||||
Reference in New Issue
Block a user