Final
This commit is contained in:
+155
-7
@@ -36,6 +36,14 @@ public class Player2 extends Actor
|
||||
String walk2;
|
||||
String walk3;
|
||||
String walk4;
|
||||
String shootAnimation1;
|
||||
String shootAnimation2;
|
||||
String shootAnimation3;
|
||||
String shootAnimation4;
|
||||
String ultiAnimation1;
|
||||
String ultiAnimation2;
|
||||
String ultiAnimation3;
|
||||
String ultiAnimation4;
|
||||
String dashAnimation;
|
||||
String hitAnimation;
|
||||
String dashAttackAnimation;
|
||||
@@ -61,6 +69,10 @@ public class Player2 extends Actor
|
||||
int maxShakra;
|
||||
int shootCooldown = 0;
|
||||
int ultiCooldown = 0;
|
||||
int shootTimer = 0;
|
||||
boolean isShooting = false;
|
||||
int ultiTimer = 0;
|
||||
boolean isUlti = false;
|
||||
|
||||
Player2(int pCharakter){
|
||||
charakter = pCharakter;
|
||||
@@ -79,6 +91,20 @@ public class Player2 extends Actor
|
||||
dashAttackAnimation();
|
||||
gotHit();
|
||||
block();
|
||||
animationShoot();
|
||||
animationUlti();
|
||||
if(isShooting){
|
||||
shootTimer++;
|
||||
}
|
||||
else{
|
||||
shootTimer = 0;
|
||||
}
|
||||
if(isUlti){
|
||||
ultiTimer++;
|
||||
}
|
||||
else{
|
||||
ultiTimer = 0;
|
||||
}
|
||||
}
|
||||
|
||||
public void bewegung(){
|
||||
@@ -357,7 +383,7 @@ public class Player2 extends Actor
|
||||
}
|
||||
|
||||
public void animationLaufen(){
|
||||
if(laeuft &! attacking &! attacking2){
|
||||
if(laeuft &! attacking &! attacking2 &! isShooting &! isUlti){
|
||||
if(schautNachRechts){
|
||||
if(laufPhase == 0){
|
||||
setImage(walk1);
|
||||
@@ -452,6 +478,104 @@ public class Player2 extends Actor
|
||||
}
|
||||
}
|
||||
|
||||
public void animationShoot(){
|
||||
if(shootTimer > 0){
|
||||
setImage(shootAnimation1);
|
||||
GreenfootImage image = getImage();
|
||||
image.scale(250, 250);
|
||||
setImage(image);
|
||||
if(!schautNachRechts){
|
||||
getImage().mirrorHorizontally();
|
||||
}
|
||||
}
|
||||
if(shootTimer > 10){
|
||||
setImage(shootAnimation2);
|
||||
GreenfootImage image = getImage();
|
||||
image.scale(250, 250);
|
||||
setImage(image);
|
||||
if(!schautNachRechts){
|
||||
getImage().mirrorHorizontally();
|
||||
}
|
||||
}
|
||||
if(shootTimer > 20){
|
||||
setImage(shootAnimation3);
|
||||
GreenfootImage image = getImage();
|
||||
image.scale(250, 250);
|
||||
setImage(image);
|
||||
if(!schautNachRechts){
|
||||
getImage().mirrorHorizontally();
|
||||
}
|
||||
}
|
||||
if(shootTimer > 30){
|
||||
setImage(shootAnimation4);
|
||||
GreenfootImage image = getImage();
|
||||
image.scale(250, 250);
|
||||
setImage(image);
|
||||
if(!schautNachRechts){
|
||||
getImage().mirrorHorizontally();
|
||||
}
|
||||
}
|
||||
if(shootTimer > 40){
|
||||
setImage(defaultAnimation);
|
||||
GreenfootImage image = getImage();
|
||||
image.scale(250, 250);
|
||||
setImage(image);
|
||||
isShooting = false;
|
||||
if(!schautNachRechts){
|
||||
getImage().mirrorHorizontally();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void animationUlti(){
|
||||
if(ultiTimer > 0){
|
||||
setImage(ultiAnimation1);
|
||||
GreenfootImage image = getImage();
|
||||
image.scale(250, 250);
|
||||
setImage(image);
|
||||
if(!schautNachRechts){
|
||||
getImage().mirrorHorizontally();
|
||||
}
|
||||
}
|
||||
if(ultiTimer > 10){
|
||||
setImage(ultiAnimation2);
|
||||
GreenfootImage image = getImage();
|
||||
image.scale(250, 250);
|
||||
setImage(image);
|
||||
if(!schautNachRechts){
|
||||
getImage().mirrorHorizontally();
|
||||
}
|
||||
}
|
||||
if(ultiTimer > 20){
|
||||
setImage(ultiAnimation3);
|
||||
GreenfootImage image = getImage();
|
||||
image.scale(250, 250);
|
||||
setImage(image);
|
||||
if(!schautNachRechts){
|
||||
getImage().mirrorHorizontally();
|
||||
}
|
||||
}
|
||||
if(ultiTimer > 30){
|
||||
setImage(ultiAnimation4);
|
||||
GreenfootImage image = getImage();
|
||||
image.scale(250, 250);
|
||||
setImage(image);
|
||||
if(!schautNachRechts){
|
||||
getImage().mirrorHorizontally();
|
||||
}
|
||||
}
|
||||
if(ultiTimer > 40){
|
||||
setImage(defaultAnimation);
|
||||
GreenfootImage image = getImage();
|
||||
image.scale(250, 250);
|
||||
setImage(image);
|
||||
isUlti = false;
|
||||
if(!schautNachRechts){
|
||||
getImage().mirrorHorizontally();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void gotHit(){
|
||||
if(System.currentTimeMillis() >= hitTimer && gotHit){
|
||||
setImage(defaultAnimation);
|
||||
@@ -502,14 +626,22 @@ public class Player2 extends Actor
|
||||
hitAnimation = "RenHit.png";
|
||||
dashAttackAnimation = "RenDashForwardAttack.png";
|
||||
blockAnimation = "RenBlock.png";
|
||||
shootAnimation1 = "RenShoot1.png";
|
||||
shootAnimation2 = shootAnimation1;
|
||||
shootAnimation3 = "RenShoot2.png";
|
||||
shootAnimation4 = shootAnimation3;
|
||||
ultiAnimation1 = "RenUlti1.png";
|
||||
ultiAnimation2 = "RenUlti2.png";
|
||||
ultiAnimation3 = "RenUlti3.png";
|
||||
ultiAnimation4 = "RenUlti4.png";
|
||||
attack2Duration = 1;
|
||||
speed = 6;
|
||||
maxLeben = 100;
|
||||
maxLeben = 250;
|
||||
leben = maxLeben;
|
||||
speedFaktor = 1;
|
||||
speedFaktor2 = speedFaktor;
|
||||
vDashSpeedCharakter = 12;
|
||||
maxShakra = 80;
|
||||
maxShakra = 30;
|
||||
shakra = maxShakra;
|
||||
}
|
||||
if(charakter == 2){
|
||||
@@ -525,14 +657,22 @@ public class Player2 extends Actor
|
||||
hitAnimation = "TetsuHit.png";
|
||||
dashAttackAnimation = "TetsuDashForwardAttack.png";
|
||||
blockAnimation = "TetsuBlock.png";
|
||||
shootAnimation1 = "TetsuShoot1.png";
|
||||
shootAnimation2 = "TetsuShoot2.png";
|
||||
shootAnimation3 = "TetsuShoot3.png";
|
||||
shootAnimation4 = "TetsuShoot4.png";
|
||||
ultiAnimation1 = "TetsuUlti1.png";
|
||||
ultiAnimation2 = "TetsuUlti2.png";
|
||||
ultiAnimation3 = "TetsuUlti3.png";
|
||||
ultiAnimation4 = "TetsuUlti4.png";
|
||||
attack2Duration = 2;
|
||||
speed = 4;
|
||||
maxLeben = 130;
|
||||
maxLeben = 300;
|
||||
leben = maxLeben;
|
||||
speedFaktor = 0.5;
|
||||
speedFaktor2 = 0.75;
|
||||
vDashSpeedCharakter = 10;
|
||||
maxShakra = 100;
|
||||
maxShakra = 30;
|
||||
shakra = maxShakra;
|
||||
}
|
||||
if(charakter == 3){
|
||||
@@ -548,14 +688,22 @@ public class Player2 extends Actor
|
||||
hitAnimation = "HinataHit.png";
|
||||
dashAttackAnimation = "HinataDashForwardAttack.png";
|
||||
blockAnimation = "HinataBlock.png";
|
||||
shootAnimation1 = "HinataShoot1.png";
|
||||
shootAnimation2 = "HinataShoot2.png";
|
||||
shootAnimation3 = "HinataShoot3.png";
|
||||
shootAnimation4 = "HinataShoot4.png";
|
||||
ultiAnimation1 = "HinataUlti1.png";
|
||||
ultiAnimation2 = "HinataUlti2.png";
|
||||
ultiAnimation3 = "HinataUlti3.png";
|
||||
ultiAnimation4 = "HinataUlti4.png";
|
||||
attack2Duration = 1;
|
||||
speed = 8;
|
||||
maxLeben = 80;
|
||||
maxLeben = 200;
|
||||
leben = maxLeben;
|
||||
speedFaktor = 2;
|
||||
speedFaktor2 = 8;
|
||||
vDashSpeedCharakter = 14;
|
||||
maxShakra = 60;
|
||||
maxShakra = 30;
|
||||
shakra = maxShakra;
|
||||
}
|
||||
setImage(defaultAnimation);
|
||||
|
||||
Reference in New Issue
Block a user