Compare commits
2 Commits
40867c7800
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 8a02a796a8 | |||
| 9fa05786d2 |
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.
+20
-2
@@ -4,6 +4,18 @@ comment0.text=\r\n\ Write\ a\ description\ of\ class\ MyWorld\ here.\r\n\ \r\n\
|
||||
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\ ultiP1()
|
||||
comment11.params=
|
||||
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
|
||||
@@ -14,5 +26,11 @@ comment4.target=void\ gameEnd()
|
||||
comment5.params=
|
||||
comment5.target=void\ lebensAnzeige()
|
||||
comment6.params=
|
||||
comment6.target=void\ charakterP1()
|
||||
numComments=7
|
||||
comment6.target=void\ shakra()
|
||||
comment7.params=
|
||||
comment7.target=void\ updateTimersP1()
|
||||
comment8.params=
|
||||
comment8.target=void\ shootP1()
|
||||
comment9.params=
|
||||
comment9.target=void\ shootP2()
|
||||
numComments=16
|
||||
|
||||
+396
-6
@@ -20,7 +20,26 @@ public class MyWorld extends World
|
||||
int attack2Distance;
|
||||
int attack1Strength;
|
||||
int attack2Strength;
|
||||
int attack1DistanceP2;
|
||||
int attack2DistanceP2;
|
||||
int attack1StrengthP2;
|
||||
int attack2StrengthP2;
|
||||
int var;
|
||||
Picture s1;
|
||||
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.
|
||||
*
|
||||
@@ -53,13 +72,22 @@ public class MyWorld extends World
|
||||
addObject(p1,150,50);
|
||||
p2 = new Picture(2);
|
||||
addObject(p2,450,50);
|
||||
s1 = new Picture(5);
|
||||
addObject(s1,150,50);
|
||||
s2 = new Picture(5);
|
||||
addObject(s2,150,50);
|
||||
charakterP1();
|
||||
charakterP2();
|
||||
}
|
||||
|
||||
public void act(){
|
||||
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);
|
||||
@@ -79,8 +107,12 @@ public class MyWorld extends World
|
||||
}
|
||||
}
|
||||
if(player2.attacke() &! player1.isBlocking){
|
||||
if(player1.getX() - player2.getX() < attack1Distance && player1.getX() - player2.getX() > -attack1Distance && player1.getY() - player2.getY() < 30 && player1.getY() - player2.getY() > -30){
|
||||
player1.leben = player1.leben -attack1Strength;
|
||||
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);
|
||||
@@ -102,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);
|
||||
@@ -121,8 +157,12 @@ public class MyWorld extends World
|
||||
}
|
||||
}
|
||||
if(player2.attacke2() &! player1.isBlocking){
|
||||
if(player1.getX() - player2.getX() < attack2Distance && player1.getX() - player2.getX() > -attack2Distance && player1.getY() - player2.getY() < 30 && player1.getY() - player2.getY() > -30){
|
||||
player1.leben = player1.leben -attack2Strength;
|
||||
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);
|
||||
@@ -145,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);
|
||||
@@ -164,9 +208,13 @@ public class MyWorld extends World
|
||||
}
|
||||
}
|
||||
if(player2.dashAttack()){
|
||||
if(player1.getX() - player2.getX() < attack2Distance && player1.getX() - player2.getX() > -attack2Distance && player1.getY() - player2.getY() < 30 && player1.getY() - player2.getY() > -30){
|
||||
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 -attack2Strength;
|
||||
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);
|
||||
@@ -191,8 +239,140 @@ public class MyWorld extends World
|
||||
l2.leben(player2.leben, player2.maxLeben);
|
||||
l1.setLocation(150 - (int)(100 - ((double)player1.leben/(double)player1.maxLeben)*100), 40);
|
||||
l2.setLocation(450 + (int)(100 - ((double)player2.leben/(double)player2.maxLeben)*100), 40);
|
||||
s1.setLocation(125 - (int)(60 - ((double)player1.shakra/(double)player1.maxShakra)*60),67);
|
||||
s2.setLocation(475 + (int)(60 - ((double)player2.shakra/(double)player2.maxShakra)*60),67);
|
||||
shakra();
|
||||
gameEnd();
|
||||
lebensAnzeige();
|
||||
updateTimersP1();
|
||||
if(player1.shootTimer == 30){
|
||||
shootP1();
|
||||
}
|
||||
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;
|
||||
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;
|
||||
shot = false;
|
||||
}
|
||||
}
|
||||
if(shot2){
|
||||
if(projectile2.hit){
|
||||
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();
|
||||
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;
|
||||
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(){
|
||||
@@ -208,24 +388,234 @@ public class MyWorld extends World
|
||||
|
||||
}
|
||||
|
||||
public void shakra(){
|
||||
if(player1.shakra > 0){
|
||||
s1.setImage("blue.png");
|
||||
GreenfootImage imag = s1.getImage();
|
||||
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)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()
|
||||
{
|
||||
if (player1.shootCooldown > 0) {
|
||||
player1.shootCooldown--;
|
||||
}
|
||||
if (player2.shootCooldown > 0) {
|
||||
player2.shootCooldown--;
|
||||
}
|
||||
if (player1.ultiCooldown > 0) {
|
||||
player1.ultiCooldown--;
|
||||
}
|
||||
if (player2.ultiCooldown > 0) {
|
||||
player2.ultiCooldown--;
|
||||
}
|
||||
}
|
||||
|
||||
public void shootP1()
|
||||
{
|
||||
if (player1.shootCooldown > 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
int direction = player1.schautNachRechts ? 1 : -1;
|
||||
|
||||
projectile1 = new Projectile(direction, player1, player2);
|
||||
projectile1.setImage(shootAnimation);
|
||||
GreenfootImage image = projectile1.getImage();
|
||||
image.scale(100, 100);
|
||||
projectile1.setImage(image);
|
||||
|
||||
int spawnX = player1.getX() + direction * 60;
|
||||
int spawnY = player1.getY() - 10;
|
||||
|
||||
addObject(projectile1, spawnX, spawnY);
|
||||
shot = true;
|
||||
player1.shootCooldown = 40;
|
||||
}
|
||||
|
||||
public void shootP2()
|
||||
{
|
||||
if (player2.shootCooldown > 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
int direction = player2.schautNachRechts ? 1 : -1;
|
||||
|
||||
projectile2 = new Projectile2(direction, player2, player1);
|
||||
projectile2.setImage(shootAnimationP2);
|
||||
GreenfootImage image = projectile2.getImage();
|
||||
image.scale(100, 100);
|
||||
projectile2.setImage(image);
|
||||
|
||||
int spawnX = player2.getX() + direction * 60;
|
||||
int spawnY = player2.getY() - 10;
|
||||
|
||||
addObject(projectile2, spawnX, spawnY);
|
||||
shot2 = true;
|
||||
|
||||
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(){
|
||||
if(charakterP1 == 1){
|
||||
attack1Distance = 95;
|
||||
attack2Distance = 120;
|
||||
attack1Strength = 10;
|
||||
attack2Strength = 20;
|
||||
shootAnimation = "RenProjectile.png";
|
||||
ultiAnimation = "RenUltiProjectile1.png";
|
||||
ultiAnimation2 = "RenUltiProjectile2.png";
|
||||
}
|
||||
else if(charakterP1 == 2){
|
||||
attack1Distance = 95;
|
||||
attack2Distance = 145;
|
||||
attack1Strength = 15;
|
||||
attack2Strength = 30;
|
||||
shootAnimation = "TetsuProjectile.png";
|
||||
ultiAnimation = "TetsuUltiProjectile1.png";
|
||||
ultiAnimation2 = "TetsuUltiProjectile2.png";
|
||||
}
|
||||
else if(charakterP1 == 3){
|
||||
attack1Distance = 95;
|
||||
attack2Distance = 110;
|
||||
attack1Strength = 8;
|
||||
attack2Strength = 15;
|
||||
shootAnimation = "HinataProjectile.png";
|
||||
ultiAnimation = "HinataUltiProjectile1.png";
|
||||
ultiAnimation2 = "HinataUltiProjectile2.png";
|
||||
}
|
||||
}
|
||||
public void charakterP2(){
|
||||
if(charakterP2 == 1){
|
||||
attack1DistanceP2 = 95;
|
||||
attack2DistanceP2 = 120;
|
||||
attack1StrengthP2 = 10;
|
||||
attack2StrengthP2 = 20;
|
||||
shootAnimationP2 = "RenProjectile.png";
|
||||
ultiAnimationP2 = "RenUltiProjectile1.png";
|
||||
ultiAnimation2P2 = "RenUltiProjectile2.png";
|
||||
}
|
||||
else if(charakterP2 == 2){
|
||||
attack1DistanceP2 = 95;
|
||||
attack2DistanceP2 = 145;
|
||||
attack1StrengthP2 = 15;
|
||||
attack2StrengthP2 = 30;
|
||||
shootAnimationP2 = "TetsuProjectile.png";
|
||||
ultiAnimationP2 = "TetsuUltiProjectile1.png";
|
||||
ultiAnimation2P2 = "TetsuUltiProjectile2.png";
|
||||
}
|
||||
else if(charakterP2 == 3){
|
||||
attack1DistanceP2 = 95;
|
||||
attack2DistanceP2 = 110;
|
||||
attack1StrengthP2 = 8;
|
||||
attack2StrengthP2 = 15;
|
||||
shootAnimationP2 = "HinataProjectile.png";
|
||||
ultiAnimationP2 = "HinataUltiProjectile1.png";
|
||||
ultiAnimation2P2 = "HinataUltiProjectile2.png";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -43,5 +43,8 @@ public class Picture extends Actor
|
||||
image.scale(200,67);
|
||||
setImage(image);
|
||||
}
|
||||
if(pictureNumber == 5){
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,13 @@
|
||||
#BlueJ class context
|
||||
comment0.target=Projectile
|
||||
comment1.params=direction\ pOwner\ pEnemy
|
||||
comment1.target=Projectile(int,\ Player1,\ Player2)
|
||||
comment2.params=
|
||||
comment2.target=void\ act()
|
||||
comment3.params=
|
||||
comment3.target=void\ moveProjectile()
|
||||
comment4.params=
|
||||
comment4.target=void\ checkHit()
|
||||
comment5.params=
|
||||
comment5.target=void\ removeProjectile()
|
||||
numComments=6
|
||||
@@ -0,0 +1,67 @@
|
||||
import greenfoot.*;
|
||||
|
||||
public class Projectile extends Actor
|
||||
{
|
||||
Player1 owner;
|
||||
Player2 enemy;
|
||||
int direction;
|
||||
|
||||
int speed = 8;
|
||||
int damage = 10;
|
||||
|
||||
int lifetime = 100;
|
||||
|
||||
|
||||
int currentFrame = 0;
|
||||
int animationTimer = 0;
|
||||
boolean isInWorld = true;
|
||||
boolean hit = false;
|
||||
public Projectile(int direction, Player1 pOwner, Player2 pEnemy)
|
||||
{
|
||||
this.direction = direction;
|
||||
this.owner = pOwner;
|
||||
enemy = pEnemy;
|
||||
|
||||
//Bilder für Schüsse nach links spiegeln
|
||||
if (direction == -1) {
|
||||
getImage().mirrorHorizontally();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void act()
|
||||
{
|
||||
moveProjectile();
|
||||
//animate();
|
||||
checkHit();
|
||||
|
||||
lifetime--;
|
||||
|
||||
}
|
||||
|
||||
private void moveProjectile()
|
||||
{
|
||||
setLocation(getX() + speed * direction, getY());
|
||||
}
|
||||
|
||||
private void checkHit()
|
||||
{
|
||||
if (getX() - enemy.getX() < 70 && getX() - enemy.getX() > -70 && getY() - enemy.getY() < 30 && getY() - enemy.getY() > -30 && isInWorld){
|
||||
hit = true;
|
||||
removeProjectile();
|
||||
}
|
||||
else if(lifetime <= 0 || isAtEdge()){
|
||||
removeProjectile();
|
||||
}
|
||||
}
|
||||
|
||||
private void removeProjectile()
|
||||
{
|
||||
if (getWorld() != null) {
|
||||
isInWorld = false;
|
||||
getWorld().removeObject(this);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,13 @@
|
||||
#BlueJ class context
|
||||
comment0.target=Projectile2
|
||||
comment1.params=direction\ pOwner\ pEnemy
|
||||
comment1.target=Projectile2(int,\ Player2,\ Player1)
|
||||
comment2.params=
|
||||
comment2.target=void\ act()
|
||||
comment3.params=
|
||||
comment3.target=void\ moveProjectile()
|
||||
comment4.params=
|
||||
comment4.target=void\ checkHit()
|
||||
comment5.params=
|
||||
comment5.target=void\ removeProjectile()
|
||||
numComments=6
|
||||
@@ -0,0 +1,67 @@
|
||||
import greenfoot.*;
|
||||
|
||||
public class Projectile2 extends Actor
|
||||
{
|
||||
Player2 owner;
|
||||
Player1 enemy;
|
||||
int direction;
|
||||
|
||||
int speed = 8;
|
||||
int damage = 10;
|
||||
|
||||
int lifetime = 100;
|
||||
|
||||
|
||||
int currentFrame = 0;
|
||||
int animationTimer = 0;
|
||||
boolean isInWorld = true;
|
||||
boolean hit = false;
|
||||
public Projectile2(int direction, Player2 pOwner, Player1 pEnemy)
|
||||
{
|
||||
this.direction = direction;
|
||||
this.owner = pOwner;
|
||||
enemy = pEnemy;
|
||||
|
||||
//Bilder für Schüsse nach links spiegeln
|
||||
if (direction == -1) {
|
||||
getImage().mirrorHorizontally();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void act()
|
||||
{
|
||||
moveProjectile();
|
||||
//animate();
|
||||
checkHit();
|
||||
|
||||
lifetime--;
|
||||
|
||||
}
|
||||
|
||||
private void moveProjectile()
|
||||
{
|
||||
setLocation(getX() + speed * direction, getY());
|
||||
}
|
||||
|
||||
private void checkHit()
|
||||
{
|
||||
if (getX() - enemy.getX() < 70 && getX() - enemy.getX() > -70 && getY() - enemy.getY() < 30 && getY() - enemy.getY() > -30 && isInWorld){
|
||||
hit = true;
|
||||
removeProjectile();
|
||||
}
|
||||
else if(lifetime <= 0 || isAtEdge()){
|
||||
removeProjectile();
|
||||
}
|
||||
}
|
||||
|
||||
private void removeProjectile()
|
||||
{
|
||||
if (getWorld() != null) {
|
||||
isInWorld = false;
|
||||
getWorld().removeObject(this);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 643 B |
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
|
||||
|
||||
+173
-13
@@ -40,6 +40,14 @@ public class Player1 extends Actor
|
||||
String hitAnimation;
|
||||
String dashAttackAnimation;
|
||||
String blockAnimation;
|
||||
String shootAnimation1;
|
||||
String shootAnimation2;
|
||||
String shootAnimation3;
|
||||
String shootAnimation4;
|
||||
String ultiAnimation1;
|
||||
String ultiAnimation2;
|
||||
String ultiAnimation3;
|
||||
String ultiAnimation4;
|
||||
int attack2Duration;
|
||||
int speed;
|
||||
double speedFaktor;
|
||||
@@ -57,6 +65,14 @@ public class Player1 extends Actor
|
||||
boolean isDashAttack = false;
|
||||
long dashAttackTimer2 = 0;
|
||||
boolean isBlocking = false;
|
||||
int shakra;
|
||||
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;
|
||||
@@ -75,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){
|
||||
@@ -89,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){
|
||||
@@ -102,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();
|
||||
}
|
||||
@@ -129,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;
|
||||
@@ -166,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;
|
||||
@@ -202,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;
|
||||
@@ -220,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;
|
||||
@@ -352,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);
|
||||
@@ -462,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();
|
||||
@@ -472,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();
|
||||
@@ -484,6 +612,8 @@ public class Player1 extends Actor
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void charakter(){
|
||||
if(charakter == 1){
|
||||
defaultAnimation = "2Combo1.png";
|
||||
@@ -498,13 +628,23 @@ 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 = 30;
|
||||
shakra = maxShakra;
|
||||
}
|
||||
if(charakter == 2){
|
||||
defaultAnimation = "Tetsu1Combo1.png";
|
||||
@@ -519,13 +659,23 @@ 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 = 30;
|
||||
shakra = maxShakra;
|
||||
}
|
||||
if(charakter == 3){
|
||||
defaultAnimation = "HinataShoot1.png";
|
||||
@@ -540,13 +690,23 @@ 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 = 30;
|
||||
shakra = maxShakra;
|
||||
}
|
||||
setImage(defaultAnimation);
|
||||
GreenfootImage image = getImage();
|
||||
|
||||
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
|
||||
|
||||
+162
-4
@@ -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;
|
||||
@@ -57,6 +65,14 @@ public class Player2 extends Actor
|
||||
boolean isDashAttack = false;
|
||||
long dashAttackTimer2 = 0;
|
||||
boolean isBlocking = false;
|
||||
int shakra;
|
||||
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;
|
||||
@@ -75,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(){
|
||||
@@ -353,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);
|
||||
@@ -448,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);
|
||||
@@ -498,13 +626,23 @@ 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 = 30;
|
||||
shakra = maxShakra;
|
||||
}
|
||||
if(charakter == 2){
|
||||
defaultAnimation = "Tetsu1Combo1.png";
|
||||
@@ -519,13 +657,23 @@ 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 = 30;
|
||||
shakra = maxShakra;
|
||||
}
|
||||
if(charakter == 3){
|
||||
defaultAnimation = "HinataShoot1.png";
|
||||
@@ -540,13 +688,23 @@ 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 = 30;
|
||||
shakra = maxShakra;
|
||||
}
|
||||
setImage(defaultAnimation);
|
||||
GreenfootImage image = getImage();
|
||||
|
||||
@@ -11,8 +11,26 @@ dependency10.from=MyWorld
|
||||
dependency10.to=Picture
|
||||
dependency10.type=UsesDependency
|
||||
dependency11.from=MyWorld
|
||||
dependency11.to=EndWorld
|
||||
dependency11.to=Projectile
|
||||
dependency11.type=UsesDependency
|
||||
dependency12.from=MyWorld
|
||||
dependency12.to=Projectile2
|
||||
dependency12.type=UsesDependency
|
||||
dependency13.from=MyWorld
|
||||
dependency13.to=EndWorld
|
||||
dependency13.type=UsesDependency
|
||||
dependency14.from=Projectile2
|
||||
dependency14.to=Player2
|
||||
dependency14.type=UsesDependency
|
||||
dependency15.from=Projectile2
|
||||
dependency15.to=Player1
|
||||
dependency15.type=UsesDependency
|
||||
dependency16.from=Projectile
|
||||
dependency16.to=Player1
|
||||
dependency16.type=UsesDependency
|
||||
dependency17.from=Projectile
|
||||
dependency17.to=Player2
|
||||
dependency17.type=UsesDependency
|
||||
dependency2.from=StartWorld
|
||||
dependency2.to=Picture
|
||||
dependency2.type=UsesDependency
|
||||
@@ -41,9 +59,9 @@ editor.fx.0.height=686
|
||||
editor.fx.0.width=1294
|
||||
editor.fx.0.x=-7
|
||||
editor.fx.0.y=-7
|
||||
height=686
|
||||
package.numDependencies=11
|
||||
package.numTargets=9
|
||||
height=26
|
||||
package.numDependencies=17
|
||||
package.numTargets=11
|
||||
project.charset=UTF-8
|
||||
publish.hasSource=false
|
||||
publish.locked=true
|
||||
@@ -65,6 +83,20 @@ target1.type=ClassTarget
|
||||
target1.width=120
|
||||
target1.x=0
|
||||
target1.y=0
|
||||
target10.height=70
|
||||
target10.name=MyWorld
|
||||
target10.showInterface=false
|
||||
target10.type=ClassTarget
|
||||
target10.width=120
|
||||
target10.x=0
|
||||
target10.y=0
|
||||
target11.height=70
|
||||
target11.name=Projectile
|
||||
target11.showInterface=false
|
||||
target11.type=ClassTarget
|
||||
target11.width=120
|
||||
target11.x=0
|
||||
target11.y=0
|
||||
target2.height=70
|
||||
target2.name=EndWorld
|
||||
target2.showInterface=false
|
||||
@@ -87,21 +119,21 @@ target4.width=120
|
||||
target4.x=0
|
||||
target4.y=0
|
||||
target5.height=70
|
||||
target5.name=StartWorld
|
||||
target5.name=Projectile2
|
||||
target5.showInterface=false
|
||||
target5.type=ClassTarget
|
||||
target5.width=120
|
||||
target5.x=0
|
||||
target5.y=0
|
||||
target6.height=70
|
||||
target6.name=Player2
|
||||
target6.name=StartWorld
|
||||
target6.showInterface=false
|
||||
target6.type=ClassTarget
|
||||
target6.width=120
|
||||
target6.x=0
|
||||
target6.y=0
|
||||
target7.height=70
|
||||
target7.name=Player1
|
||||
target7.name=Player2
|
||||
target7.showInterface=false
|
||||
target7.type=ClassTarget
|
||||
target7.width=120
|
||||
@@ -115,14 +147,14 @@ target8.width=120
|
||||
target8.x=0
|
||||
target8.y=0
|
||||
target9.height=70
|
||||
target9.name=MyWorld
|
||||
target9.name=Player1
|
||||
target9.showInterface=false
|
||||
target9.type=ClassTarget
|
||||
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