Final
This commit is contained in:
+162
-17
@@ -42,6 +42,12 @@ public class Player1 extends Actor
|
||||
String blockAnimation;
|
||||
String shootAnimation1;
|
||||
String shootAnimation2;
|
||||
String shootAnimation3;
|
||||
String shootAnimation4;
|
||||
String ultiAnimation1;
|
||||
String ultiAnimation2;
|
||||
String ultiAnimation3;
|
||||
String ultiAnimation4;
|
||||
int attack2Duration;
|
||||
int speed;
|
||||
double speedFaktor;
|
||||
@@ -63,7 +69,10 @@ public class Player1 extends Actor
|
||||
int maxShakra;
|
||||
int shootCooldown = 0;
|
||||
int ultiCooldown = 0;
|
||||
|
||||
int shootTimer = 0;
|
||||
boolean isShooting = false;
|
||||
int ultiTimer = 0;
|
||||
boolean isUlti = false;
|
||||
|
||||
Player1(int pCharakter){
|
||||
charakter = pCharakter;
|
||||
@@ -82,10 +91,24 @@ public class Player1 extends Actor
|
||||
dashAttackAnimation();
|
||||
gotHit();
|
||||
block();
|
||||
animationShoot();
|
||||
animationUlti();
|
||||
if(isShooting){
|
||||
shootTimer++;
|
||||
}
|
||||
else{
|
||||
shootTimer = 0;
|
||||
}
|
||||
if(isUlti){
|
||||
ultiTimer++;
|
||||
}
|
||||
else{
|
||||
ultiTimer = 0;
|
||||
}
|
||||
}
|
||||
|
||||
public void bewegung(){
|
||||
if(Greenfoot.isKeyDown("d") &! isBlocking){
|
||||
if(Greenfoot.isKeyDown("e") &! isBlocking){
|
||||
setRotation(0);
|
||||
move(speed);
|
||||
if(!schautNachRechts && attackPhase == 0){
|
||||
@@ -96,7 +119,7 @@ public class Player1 extends Actor
|
||||
attacke();
|
||||
attacke2();
|
||||
}
|
||||
if(Greenfoot.isKeyDown("a") &! isBlocking){
|
||||
if(Greenfoot.isKeyDown("q") &! isBlocking){
|
||||
setRotation(0);
|
||||
move(-speed);
|
||||
if(schautNachRechts && attackPhase == 0){
|
||||
@@ -109,7 +132,7 @@ public class Player1 extends Actor
|
||||
}
|
||||
}
|
||||
public void springen() {
|
||||
if (Greenfoot.isKeyDown("space") && getY() >= meereshoehe &! isBlocking) {
|
||||
if (Greenfoot.isKeyDown("w") && getY() >= meereshoehe &! isBlocking) {
|
||||
vSpeed = -15;
|
||||
fall();
|
||||
}
|
||||
@@ -136,7 +159,7 @@ public class Player1 extends Actor
|
||||
setImage(dashAnimation);
|
||||
GreenfootImage img2 = getImage();
|
||||
setImage(img);
|
||||
if(Greenfoot.isKeyDown("e") &! isDash){
|
||||
if(Greenfoot.isKeyDown("f") &! isDash){
|
||||
if (!attacking && !attacking2) {
|
||||
attacking = true;
|
||||
attackPhase = 1;
|
||||
@@ -173,7 +196,7 @@ public class Player1 extends Actor
|
||||
|
||||
public boolean attacke2(){
|
||||
if(System.currentTimeMillis() >= c &! isBlocking){
|
||||
if(Greenfoot.isKeyDown("q")){
|
||||
if(Greenfoot.isKeyDown("v")){
|
||||
if (!attacking2 && !attacking) {
|
||||
attacking2 = true;
|
||||
attackPhase = 1;
|
||||
@@ -209,7 +232,7 @@ public class Player1 extends Actor
|
||||
}
|
||||
|
||||
public void dash(){
|
||||
if(Greenfoot.isKeyDown("f") && System.currentTimeMillis() >= dashTimer &! isBlocking){
|
||||
if(Greenfoot.isKeyDown("r") && System.currentTimeMillis() >= dashTimer &! isBlocking){
|
||||
if(schautNachRechts){
|
||||
vDashSpeed = vDashSpeedCharakter;
|
||||
schautNachRechts2 = 1;
|
||||
@@ -227,7 +250,7 @@ public class Player1 extends Actor
|
||||
}
|
||||
|
||||
public boolean dashAttack(){
|
||||
if(isDash && Greenfoot.isKeyDown("e") && System.currentTimeMillis() >= dashAttackTimer &! isBlocking){
|
||||
if(isDash && Greenfoot.isKeyDown("f") && System.currentTimeMillis() >= dashAttackTimer &! isBlocking){
|
||||
dashAttackTimer = System.currentTimeMillis() + 300;
|
||||
dashAttackTimer2 = System.currentTimeMillis() + 300;
|
||||
isDashAttack = true;
|
||||
@@ -359,8 +382,106 @@ public class Player1 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 animationLaufen(){
|
||||
if(laeuft &! attacking &! attacking2){
|
||||
if(laeuft &! attacking &! attacking2 &! isShooting &! isUlti){
|
||||
if(schautNachRechts){
|
||||
if(laufPhase == 0){
|
||||
setImage(walk1);
|
||||
@@ -469,7 +590,7 @@ public class Player1 extends Actor
|
||||
}
|
||||
|
||||
public void block(){
|
||||
if(Greenfoot.isKeyDown("r")){
|
||||
if(Greenfoot.isKeyDown("d")){
|
||||
isBlocking = true;
|
||||
setImage(blockAnimation);
|
||||
GreenfootImage image = getImage();
|
||||
@@ -479,7 +600,7 @@ public class Player1 extends Actor
|
||||
getImage().mirrorHorizontally();
|
||||
}
|
||||
}
|
||||
if(isBlocking &! Greenfoot.isKeyDown("r")){
|
||||
if(isBlocking &! Greenfoot.isKeyDown("d")){
|
||||
isBlocking = false;
|
||||
setImage(defaultAnimation);
|
||||
GreenfootImage image = getImage();
|
||||
@@ -507,14 +628,22 @@ public class Player1 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){
|
||||
@@ -530,14 +659,22 @@ public class Player1 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){
|
||||
@@ -553,14 +690,22 @@ public class Player1 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