Final
This commit is contained in:
Binary file not shown.
@@ -25,7 +25,7 @@ public class MenuWorld extends World
|
||||
{
|
||||
// Create a new world with 600x400 cells with a cell size of 1x1 pixels.
|
||||
super(600, 400, 1);
|
||||
showText("Anime Fighters" , 300, 50);
|
||||
showText("Anime Fighter" , 300, 50);
|
||||
showText("select", 300, 103);
|
||||
//showText("press enter to start", 300, 340);
|
||||
showText("player 1 :", 130,100);
|
||||
|
||||
Binary file not shown.
+11
-3
@@ -5,9 +5,17 @@ comment1.params=pCharakterP1\ pCharakterP2
|
||||
comment1.target=MyWorld(int,\ int)
|
||||
comment1.text=\r\n\ Constructor\ for\ objects\ of\ class\ MyWorld.\r\n\ \r\n
|
||||
comment10.params=
|
||||
comment10.target=void\ charakterP1()
|
||||
comment10.target=void\ ultiP1()
|
||||
comment11.params=
|
||||
comment11.target=void\ charakterP2()
|
||||
comment11.target=void\ ultiP2()
|
||||
comment12.params=
|
||||
comment12.target=void\ ultiAnimationP1()
|
||||
comment13.params=
|
||||
comment13.target=void\ ultiAnimationP2()
|
||||
comment14.params=
|
||||
comment14.target=void\ charakterP1()
|
||||
comment15.params=
|
||||
comment15.target=void\ charakterP2()
|
||||
comment2.params=
|
||||
comment2.target=void\ prepare()
|
||||
comment2.text=\r\n\ Prepare\ the\ world\ for\ the\ start\ of\ the\ program.\r\n\ That\ is\:\ create\ the\ initial\ objects\ and\ add\ them\ to\ the\ world.\r\n
|
||||
@@ -25,4 +33,4 @@ comment8.params=
|
||||
comment8.target=void\ shootP1()
|
||||
comment9.params=
|
||||
comment9.target=void\ shootP2()
|
||||
numComments=12
|
||||
numComments=16
|
||||
|
||||
+226
-11
@@ -29,10 +29,17 @@ public class MyWorld extends World
|
||||
Picture s2;
|
||||
String shootAnimation;
|
||||
String shootAnimationP2;
|
||||
String ultiAnimation;
|
||||
String ultiAnimationP2;
|
||||
String ultiAnimation2;
|
||||
String ultiAnimation2P2;
|
||||
Projectile projectile1;
|
||||
Projectile2 projectile2;
|
||||
boolean shot = false;
|
||||
boolean shot2 = false;
|
||||
boolean ulti = false;
|
||||
boolean ulti2 = false;
|
||||
|
||||
/**
|
||||
* Constructor for objects of class MyWorld.
|
||||
*
|
||||
@@ -77,6 +84,10 @@ public class MyWorld extends World
|
||||
if(player1.attacke() &! player2.isBlocking){
|
||||
if(player1.getX() - player2.getX() < attack1Distance && player1.getX() - player2.getX() > -attack1Distance && player1.getY() - player2.getY() < 30 && player1.getY() - player2.getY() > -30){
|
||||
player2.leben = player2.leben -attack1Strength;
|
||||
player1.shakra = player1.shakra +5;
|
||||
if(player1.shakra > player1.maxShakra){
|
||||
player1.shakra = player1.maxShakra;
|
||||
}
|
||||
setPaintOrder(Player1.class,Player2.class);
|
||||
if(player2.schautNachRechts){
|
||||
player2.setImage(player2.hitAnimation);
|
||||
@@ -98,6 +109,10 @@ public class MyWorld extends World
|
||||
if(player2.attacke() &! player1.isBlocking){
|
||||
if(player1.getX() - player2.getX() < attack1DistanceP2 && player1.getX() - player2.getX() > -attack1DistanceP2 && player1.getY() - player2.getY() < 30 && player1.getY() - player2.getY() > -30){
|
||||
player1.leben = player1.leben -attack1StrengthP2;
|
||||
player2.shakra = player2.shakra +5;
|
||||
if(player2.shakra > player2.maxShakra){
|
||||
player2.shakra = player2.maxShakra;
|
||||
}
|
||||
setPaintOrder(Player2.class,Player1.class);
|
||||
if(player1.schautNachRechts){
|
||||
player1.setImage(player1.hitAnimation);
|
||||
@@ -119,6 +134,10 @@ public class MyWorld extends World
|
||||
if(player1.attacke2() &! player2.isBlocking){
|
||||
if(player1.getX() - player2.getX() < attack2Distance && player1.getX() - player2.getX() > -attack2Distance && player1.getY() - player2.getY() < 30 && player1.getY() - player2.getY() > -30){
|
||||
player2.leben = player2.leben -attack2Strength;
|
||||
player1.shakra = player1.shakra +5;
|
||||
if(player1.shakra > player1.maxShakra){
|
||||
player1.shakra = player1.maxShakra;
|
||||
}
|
||||
setPaintOrder(Player1.class,Player2.class);
|
||||
if(player2.schautNachRechts){
|
||||
player2.setImage(player2.hitAnimation);
|
||||
@@ -140,6 +159,10 @@ public class MyWorld extends World
|
||||
if(player2.attacke2() &! player1.isBlocking){
|
||||
if(player1.getX() - player2.getX() < attack2DistanceP2 && player1.getX() - player2.getX() > -attack2DistanceP2 && player1.getY() - player2.getY() < 30 && player1.getY() - player2.getY() > -30){
|
||||
player1.leben = player1.leben -attack2StrengthP2;
|
||||
player2.shakra = player2.shakra +5;
|
||||
if(player2.shakra > player2.maxShakra){
|
||||
player2.shakra = player2.maxShakra;
|
||||
}
|
||||
setPaintOrder(Player2.class,Player1.class);
|
||||
if(player1.schautNachRechts){
|
||||
player1.setImage(player1.hitAnimation);
|
||||
@@ -162,6 +185,10 @@ public class MyWorld extends World
|
||||
if(player1.getX() - player2.getX() < attack2Distance && player1.getX() - player2.getX() > -attack2Distance && player1.getY() - player2.getY() < 30 && player1.getY() - player2.getY() > -30){
|
||||
player2.isBlocking = false;
|
||||
player2.leben = player2.leben -attack2Strength;
|
||||
player1.shakra = player1.shakra +5;
|
||||
if(player1.shakra > player1.maxShakra){
|
||||
player1.shakra = player1.maxShakra;
|
||||
}
|
||||
setPaintOrder(Player1.class,Player2.class);
|
||||
if(player2.schautNachRechts){
|
||||
player2.setImage(player2.hitAnimation);
|
||||
@@ -184,6 +211,10 @@ public class MyWorld extends World
|
||||
if(player1.getX() - player2.getX() < attack2DistanceP2 && player1.getX() - player2.getX() > -attack2DistanceP2 && player1.getY() - player2.getY() < 30 && player1.getY() - player2.getY() > -30){
|
||||
player1.isBlocking = false;
|
||||
player1.leben = player1.leben -attack2StrengthP2;
|
||||
player2.shakra = player2.shakra +5;
|
||||
if(player2.shakra > player2.maxShakra){
|
||||
player2.shakra = player2.maxShakra;
|
||||
}
|
||||
setPaintOrder(Player2.class,Player1.class);
|
||||
if(player1.schautNachRechts){
|
||||
player1.setImage(player1.hitAnimation);
|
||||
@@ -214,15 +245,25 @@ public class MyWorld extends World
|
||||
gameEnd();
|
||||
lebensAnzeige();
|
||||
updateTimersP1();
|
||||
if(Greenfoot.isKeyDown("y")){
|
||||
shootP1();
|
||||
if(player1.shootTimer == 30){
|
||||
shootP1();
|
||||
}
|
||||
if(Greenfoot.isKeyDown("m")){
|
||||
if(Greenfoot.isKeyDown("t")){
|
||||
player1.isShooting = true;
|
||||
}
|
||||
if(player2.shootTimer == 30){
|
||||
shootP2();
|
||||
}
|
||||
if(Greenfoot.isKeyDown("z")){
|
||||
player2.isShooting = true;
|
||||
}
|
||||
if(shot){
|
||||
if(projectile1.hit){
|
||||
player2.leben = player2.leben -20;
|
||||
player2.leben = player2.leben -20;
|
||||
player1.shakra = player1.shakra +5;
|
||||
if(player1.shakra > player1.maxShakra){
|
||||
player1.shakra = player1.maxShakra;
|
||||
}
|
||||
if(player2.schautNachRechts){
|
||||
player2.setImage(player2.hitAnimation);
|
||||
GreenfootImage image = player2.getImage();
|
||||
@@ -243,7 +284,11 @@ public class MyWorld extends World
|
||||
}
|
||||
if(shot2){
|
||||
if(projectile2.hit){
|
||||
player1.leben = player1.leben -20;
|
||||
player1.leben = player1.leben -20;
|
||||
player2.shakra = player2.shakra +5;
|
||||
if(player2.shakra > player2.maxShakra){
|
||||
player2.shakra = player2.maxShakra;
|
||||
}
|
||||
if(player1.schautNachRechts){
|
||||
player1.setImage(player1.hitAnimation);
|
||||
GreenfootImage image = player1.getImage();
|
||||
@@ -262,6 +307,72 @@ public class MyWorld extends World
|
||||
shot2 = false;
|
||||
}
|
||||
}
|
||||
if(player1.ultiTimer == 30){
|
||||
ultiP1();
|
||||
}
|
||||
if(Greenfoot.isKeyDown("g") && player1.shakra >= 30 && player1.isUlti == false){
|
||||
player1.isUlti = true;
|
||||
player1.shakra = player1.shakra-30;
|
||||
}
|
||||
if(player2.ultiTimer == 30){
|
||||
ultiP2();
|
||||
}
|
||||
if(Greenfoot.isKeyDown("h") && player2.shakra >= 30 && player2.isUlti == false){
|
||||
player2.isUlti = true;
|
||||
player2.shakra = player2.shakra-30;
|
||||
}
|
||||
if(ulti){
|
||||
if(projectile1.hit){
|
||||
player2.leben = player2.leben -40;
|
||||
player1.shakra = player1.shakra +5;
|
||||
if(player1.shakra > player1.maxShakra){
|
||||
player1.shakra = player1.maxShakra;
|
||||
}
|
||||
if(player2.schautNachRechts){
|
||||
player2.setImage(player2.hitAnimation);
|
||||
GreenfootImage image = player2.getImage();
|
||||
image.scale(250, 250);
|
||||
player2.setImage(image);
|
||||
}
|
||||
else{
|
||||
player2.setImage(player2.hitAnimation);
|
||||
GreenfootImage image = player2.getImage();
|
||||
image.scale(250, 250);
|
||||
player2.setImage(image);
|
||||
player2.getImage().mirrorHorizontally();
|
||||
}
|
||||
player2.hitTimer = System.currentTimeMillis() + 250;
|
||||
player2.gotHit = true;
|
||||
ulti = false;
|
||||
}
|
||||
}
|
||||
if(ulti2){
|
||||
if(projectile2.hit){
|
||||
player1.leben = player1.leben -40;
|
||||
player2.shakra = player2.shakra +5;
|
||||
if(player2.shakra > player2.maxShakra){
|
||||
player2.shakra = player2.maxShakra;
|
||||
}
|
||||
if(player1.schautNachRechts){
|
||||
player1.setImage(player1.hitAnimation);
|
||||
GreenfootImage image = player1.getImage();
|
||||
image.scale(250, 250);
|
||||
player1.setImage(image);
|
||||
}
|
||||
else{
|
||||
player1.setImage(player1.hitAnimation);
|
||||
GreenfootImage image = player1.getImage();
|
||||
image.scale(250, 250);
|
||||
player1.setImage(image);
|
||||
player1.getImage().mirrorHorizontally();
|
||||
}
|
||||
player1.hitTimer = System.currentTimeMillis() + 250;
|
||||
player1.gotHit = true;
|
||||
ulti2 = false;
|
||||
}
|
||||
}
|
||||
ultiAnimationP1();
|
||||
ultiAnimationP2();
|
||||
}
|
||||
|
||||
public void gameEnd(){
|
||||
@@ -284,13 +395,24 @@ public class MyWorld extends World
|
||||
imag.scale((int)(120 * ((double)player1.shakra/(double)player1.maxShakra)),5);
|
||||
s1.setImage(imag);
|
||||
}
|
||||
else{
|
||||
s1.setImage("blue.png");
|
||||
GreenfootImage imag = s1.getImage();
|
||||
imag.scale(1,1);
|
||||
s1.setImage(imag);
|
||||
}
|
||||
if(player2.shakra > 0){
|
||||
s2.setImage("blue.png");
|
||||
GreenfootImage imag2 = s2.getImage();
|
||||
imag2.scale((int)(120 * ((double)player2.shakra/(double)player1.maxShakra)),5);
|
||||
imag2.scale((int)(120 * ((double)player2.shakra/(double)player2.maxShakra)),5);
|
||||
s2.setImage(imag2);
|
||||
}
|
||||
|
||||
else{
|
||||
s2.setImage("blue.png");
|
||||
GreenfootImage imag = s2.getImage();
|
||||
imag.scale(1,1);
|
||||
s2.setImage(imag);
|
||||
}
|
||||
}
|
||||
|
||||
protected void updateTimersP1()
|
||||
@@ -317,7 +439,7 @@ public class MyWorld extends World
|
||||
|
||||
|
||||
int direction = player1.schautNachRechts ? 1 : -1;
|
||||
|
||||
|
||||
projectile1 = new Projectile(direction, player1, player2);
|
||||
projectile1.setImage(shootAnimation);
|
||||
GreenfootImage image = projectile1.getImage();
|
||||
@@ -329,8 +451,7 @@ public class MyWorld extends World
|
||||
|
||||
addObject(projectile1, spawnX, spawnY);
|
||||
shot = true;
|
||||
|
||||
player1.shootCooldown = 60;
|
||||
player1.shootCooldown = 40;
|
||||
}
|
||||
|
||||
public void shootP2()
|
||||
@@ -354,7 +475,89 @@ public class MyWorld extends World
|
||||
addObject(projectile2, spawnX, spawnY);
|
||||
shot2 = true;
|
||||
|
||||
player2.shootCooldown = 60;
|
||||
player2.shootCooldown = 40;
|
||||
}
|
||||
|
||||
public void ultiP1()
|
||||
{
|
||||
if (player1.ultiCooldown > 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
int direction = player1.schautNachRechts ? 1 : -1;
|
||||
|
||||
projectile1 = new Projectile(direction, player1, player2);
|
||||
|
||||
|
||||
int spawnX = player1.getX() + direction * 60;
|
||||
int spawnY = player1.getY() - 10;
|
||||
|
||||
addObject(projectile1, spawnX, spawnY);
|
||||
ulti = true;
|
||||
player1.ultiCooldown = 40;
|
||||
}
|
||||
|
||||
public void ultiP2()
|
||||
{
|
||||
if (player2.ultiCooldown > 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
int direction = player2.schautNachRechts ? 1 : -1;
|
||||
|
||||
projectile2 = new Projectile2(direction, player2, player1);
|
||||
|
||||
|
||||
int spawnX = player2.getX() + direction * 60;
|
||||
int spawnY = player2.getY() - 10;
|
||||
|
||||
addObject(projectile2, spawnX, spawnY);
|
||||
ulti2 = true;
|
||||
player2.ultiCooldown = 40;
|
||||
}
|
||||
|
||||
public void ultiAnimationP1(){
|
||||
if(player1.ultiCooldown > 35){
|
||||
projectile1.setImage(ultiAnimation);
|
||||
GreenfootImage image = projectile1.getImage();
|
||||
image.scale(400, 400);
|
||||
projectile1.setImage(image);
|
||||
if(!player1.schautNachRechts){
|
||||
projectile1.getImage().mirrorHorizontally();
|
||||
}
|
||||
}
|
||||
if(player1.ultiCooldown > 0 && player1.ultiCooldown < 35){
|
||||
projectile1.setImage(ultiAnimation2);
|
||||
GreenfootImage image = projectile1.getImage();
|
||||
image.scale(400, 400);
|
||||
projectile1.setImage(image);
|
||||
if(!player1.schautNachRechts){
|
||||
projectile1.getImage().mirrorHorizontally();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void ultiAnimationP2(){
|
||||
if(player2.ultiCooldown > 35){
|
||||
projectile2.setImage(ultiAnimationP2);
|
||||
GreenfootImage image = projectile2.getImage();
|
||||
image.scale(400, 400);
|
||||
projectile2.setImage(image);
|
||||
if(!player2.schautNachRechts){
|
||||
projectile2.getImage().mirrorHorizontally();
|
||||
}
|
||||
}
|
||||
if(player2.ultiCooldown > 0 && player2.ultiCooldown < 35){
|
||||
projectile2.setImage(ultiAnimation2P2);
|
||||
GreenfootImage image = projectile2.getImage();
|
||||
image.scale(400, 400);
|
||||
projectile2.setImage(image);
|
||||
if(!player2.schautNachRechts){
|
||||
projectile2.getImage().mirrorHorizontally();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void charakterP1(){
|
||||
@@ -364,6 +567,8 @@ public class MyWorld extends World
|
||||
attack1Strength = 10;
|
||||
attack2Strength = 20;
|
||||
shootAnimation = "RenProjectile.png";
|
||||
ultiAnimation = "RenUltiProjectile1.png";
|
||||
ultiAnimation2 = "RenUltiProjectile2.png";
|
||||
}
|
||||
else if(charakterP1 == 2){
|
||||
attack1Distance = 95;
|
||||
@@ -371,6 +576,8 @@ public class MyWorld extends World
|
||||
attack1Strength = 15;
|
||||
attack2Strength = 30;
|
||||
shootAnimation = "TetsuProjectile.png";
|
||||
ultiAnimation = "TetsuUltiProjectile1.png";
|
||||
ultiAnimation2 = "TetsuUltiProjectile2.png";
|
||||
}
|
||||
else if(charakterP1 == 3){
|
||||
attack1Distance = 95;
|
||||
@@ -378,6 +585,8 @@ public class MyWorld extends World
|
||||
attack1Strength = 8;
|
||||
attack2Strength = 15;
|
||||
shootAnimation = "HinataProjectile.png";
|
||||
ultiAnimation = "HinataUltiProjectile1.png";
|
||||
ultiAnimation2 = "HinataUltiProjectile2.png";
|
||||
}
|
||||
}
|
||||
public void charakterP2(){
|
||||
@@ -387,6 +596,8 @@ public class MyWorld extends World
|
||||
attack1StrengthP2 = 10;
|
||||
attack2StrengthP2 = 20;
|
||||
shootAnimationP2 = "RenProjectile.png";
|
||||
ultiAnimationP2 = "RenUltiProjectile1.png";
|
||||
ultiAnimation2P2 = "RenUltiProjectile2.png";
|
||||
}
|
||||
else if(charakterP2 == 2){
|
||||
attack1DistanceP2 = 95;
|
||||
@@ -394,6 +605,8 @@ public class MyWorld extends World
|
||||
attack1StrengthP2 = 15;
|
||||
attack2StrengthP2 = 30;
|
||||
shootAnimationP2 = "TetsuProjectile.png";
|
||||
ultiAnimationP2 = "TetsuUltiProjectile1.png";
|
||||
ultiAnimation2P2 = "TetsuUltiProjectile2.png";
|
||||
}
|
||||
else if(charakterP2 == 3){
|
||||
attack1DistanceP2 = 95;
|
||||
@@ -401,6 +614,8 @@ public class MyWorld extends World
|
||||
attack1StrengthP2 = 8;
|
||||
attack2StrengthP2 = 15;
|
||||
shootAnimationP2 = "HinataProjectile.png";
|
||||
ultiAnimationP2 = "HinataUltiProjectile1.png";
|
||||
ultiAnimation2P2 = "HinataUltiProjectile2.png";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -6,7 +6,7 @@ public class Projectile extends Actor
|
||||
Player2 enemy;
|
||||
int direction;
|
||||
|
||||
int speed = 10;
|
||||
int speed = 8;
|
||||
int damage = 10;
|
||||
|
||||
int lifetime = 100;
|
||||
|
||||
Binary file not shown.
@@ -6,7 +6,7 @@ public class Projectile2 extends Actor
|
||||
Player1 enemy;
|
||||
int direction;
|
||||
|
||||
int speed = 10;
|
||||
int speed = 8;
|
||||
int damage = 10;
|
||||
|
||||
int lifetime = 100;
|
||||
|
||||
Binary file not shown.
@@ -12,13 +12,17 @@ comment12.target=void\ dashAnimation(int)
|
||||
comment13.params=
|
||||
comment13.target=void\ animation1()
|
||||
comment14.params=
|
||||
comment14.target=void\ animationLaufen()
|
||||
comment14.target=void\ animationShoot()
|
||||
comment15.params=
|
||||
comment15.target=void\ gotHit()
|
||||
comment15.target=void\ animationUlti()
|
||||
comment16.params=
|
||||
comment16.target=void\ block()
|
||||
comment16.target=void\ animationLaufen()
|
||||
comment17.params=
|
||||
comment17.target=void\ charakter()
|
||||
comment17.target=void\ gotHit()
|
||||
comment18.params=
|
||||
comment18.target=void\ block()
|
||||
comment19.params=
|
||||
comment19.target=void\ charakter()
|
||||
comment2.params=
|
||||
comment2.target=void\ act()
|
||||
comment3.params=
|
||||
@@ -35,4 +39,4 @@ comment8.params=
|
||||
comment8.target=boolean\ attacke2()
|
||||
comment9.params=
|
||||
comment9.target=void\ dash()
|
||||
numComments=18
|
||||
numComments=20
|
||||
|
||||
+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);
|
||||
|
||||
Binary file not shown.
@@ -14,11 +14,15 @@ comment13.target=void\ animation1()
|
||||
comment14.params=
|
||||
comment14.target=void\ animationLaufen()
|
||||
comment15.params=
|
||||
comment15.target=void\ gotHit()
|
||||
comment15.target=void\ animationShoot()
|
||||
comment16.params=
|
||||
comment16.target=void\ block()
|
||||
comment16.target=void\ animationUlti()
|
||||
comment17.params=
|
||||
comment17.target=void\ charakter()
|
||||
comment17.target=void\ gotHit()
|
||||
comment18.params=
|
||||
comment18.target=void\ block()
|
||||
comment19.params=
|
||||
comment19.target=void\ charakter()
|
||||
comment2.params=
|
||||
comment2.target=void\ act()
|
||||
comment3.params=
|
||||
@@ -35,4 +39,4 @@ comment8.params=
|
||||
comment8.target=boolean\ attacke2()
|
||||
comment9.params=
|
||||
comment9.target=void\ dash()
|
||||
numComments=18
|
||||
numComments=20
|
||||
|
||||
+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);
|
||||
|
||||
@@ -59,7 +59,7 @@ editor.fx.0.height=686
|
||||
editor.fx.0.width=1294
|
||||
editor.fx.0.x=-7
|
||||
editor.fx.0.y=-7
|
||||
height=686
|
||||
height=26
|
||||
package.numDependencies=17
|
||||
package.numTargets=11
|
||||
project.charset=UTF-8
|
||||
@@ -154,7 +154,7 @@ target9.width=120
|
||||
target9.x=0
|
||||
target9.y=0
|
||||
version=3.1.0
|
||||
width=1294
|
||||
width=158
|
||||
world.lastInstantiated=StartWorld
|
||||
xPosition=0
|
||||
yPosition=0
|
||||
|
||||
Reference in New Issue
Block a user