Compare commits

..

4 Commits

Author SHA1 Message Date
Max 8a02a796a8 Final 2026-09-17 20:00:38 +02:00
Max 9fa05786d2 Beta1 2026-09-17 17:02:54 +02:00
Max 40867c7800 Files2 2026-09-17 11:16:32 +02:00
Max 0c0e0f39da -Dash
-DashAttack
-neue Springenmethode
-block
2026-09-17 11:14:29 +02:00
47 changed files with 1496 additions and 97 deletions
Binary file not shown.
+1 -1
View File
@@ -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
View File
@@ -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
+502 -8
View File
@@ -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,32 +72,165 @@ 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()){
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);
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;
}
}
if(player2.attacke()){
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(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);
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;
}
}
if(player1.attacke2()){
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);
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;
}
}
if(player2.attacke2()){
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(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);
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;
}
}
if(player1.dashAttack()){
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);
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;
}
}
if(player2.dashAttack()){
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);
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;
}
}
showText(String.valueOf(player2.leben),450,40);
@@ -87,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(){
@@ -104,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.
+3
View File
@@ -43,5 +43,8 @@ public class Picture extends Actor
image.scale(200,67);
setImage(image);
}
if(pictureNumber == 5){
}
}
}
Binary file not shown.
+13
View File
@@ -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
+67
View File
@@ -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.
+13
View File
@@ -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
+67
View File
@@ -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: 112 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 291 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 177 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 153 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 252 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 141 KiB

After

Width:  |  Height:  |  Size: 180 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 643 B

Binary file not shown.
+25 -7
View File
@@ -4,7 +4,25 @@ comment0.text=\r\n\ Write\ a\ description\ of\ class\ player\ here.\r\n\ \r\n\ @
comment1.params=pCharakter
comment1.target=Player1(int)
comment10.params=
comment10.target=void\ charakter()
comment10.target=boolean\ dashAttack()
comment11.params=
comment11.target=void\ dashAttackAnimation()
comment12.params=pRechts
comment12.target=void\ dashAnimation(int)
comment13.params=
comment13.target=void\ animation1()
comment14.params=
comment14.target=void\ animationShoot()
comment15.params=
comment15.target=void\ animationUlti()
comment16.params=
comment16.target=void\ animationLaufen()
comment17.params=
comment17.target=void\ gotHit()
comment18.params=
comment18.target=void\ block()
comment19.params=
comment19.target=void\ charakter()
comment2.params=
comment2.target=void\ act()
comment3.params=
@@ -12,13 +30,13 @@ comment3.target=void\ bewegung()
comment4.params=
comment4.target=void\ springen()
comment5.params=
comment5.target=boolean\ attacke()
comment5.target=void\ gravitation()
comment6.params=
comment6.target=boolean\ attacke2()
comment6.target=void\ fall()
comment7.params=
comment7.target=void\ animation1()
comment7.target=boolean\ attacke()
comment8.params=
comment8.target=void\ animationLaufen()
comment8.target=boolean\ attacke2()
comment9.params=
comment9.target=void\ gravitation()
numComments=11
comment9.target=void\ dash()
numComments=20
+354 -25
View File
@@ -19,6 +19,7 @@ public class Player1 extends Actor
long d = 0;
long e = 0;
boolean schautNachRechts;
int schautNachRechts2;
long attackTimer = 0;
int attackPhase = 0;
boolean attacking = false;
@@ -35,10 +36,43 @@ public class Player1 extends Actor
String walk2;
String walk3;
String walk4;
String dashAnimation;
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;
double speedFaktor2;
long dashTimer;
long jumpTimer = 0;
int vSpeed = 0;
int meereshoehe = 289;
int vDashSpeed = 0;
int vDashSpeedCharakter;
boolean gotHit = false;
long hitTimer = 0;
long dashAttackTimer = 0;
boolean isDash = false;
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;
@@ -52,10 +86,29 @@ public class Player1 extends Actor
springen();
animation1();
animationLaufen();
dash();
dashAnimation(schautNachRechts2);
dashAttackAnimation();
gotHit();
block();
animationShoot();
animationUlti();
if(isShooting){
shootTimer++;
}
else{
shootTimer = 0;
}
if(isUlti){
ultiTimer++;
}
else{
ultiTimer = 0;
}
}
public void bewegung(){
if(Greenfoot.isKeyDown("d")){
if(Greenfoot.isKeyDown("e") &! isBlocking){
setRotation(0);
move(speed);
if(!schautNachRechts && attackPhase == 0){
@@ -66,7 +119,7 @@ public class Player1 extends Actor
attacke();
attacke2();
}
if(Greenfoot.isKeyDown("a")){
if(Greenfoot.isKeyDown("q") &! isBlocking){
setRotation(0);
move(-speed);
if(schautNachRechts && attackPhase == 0){
@@ -78,24 +131,35 @@ public class Player1 extends Actor
attacke2();
}
}
public void springen() {
if(Greenfoot.isKeyDown("space") && this.getY() > 289 ){
for(int i = 12; i > -12; i--){
setRotation(270);
move(i);
setRotation(0);
Greenfoot.delay(1);
bewegung();
attacke();
attacke2();
if (Greenfoot.isKeyDown("w") && getY() >= meereshoehe &! isBlocking) {
vSpeed = -15;
fall();
}
}
public void gravitation() {
if (getY() < meereshoehe || vSpeed < 0) {
fall();
} else {
vSpeed = 0;
setLocation(getX(), meereshoehe);
}
}
private void fall() {
setLocation(getX(), getY() + vSpeed);
vSpeed += 1;
}
public boolean attacke(){
if(System.currentTimeMillis() >= c){
if(Greenfoot.isKeyDown("e")){
if(System.currentTimeMillis() >= c &! isBlocking){
GreenfootImage img = getImage();
setImage(dashAnimation);
GreenfootImage img2 = getImage();
setImage(img);
if(Greenfoot.isKeyDown("f") &! isDash){
if (!attacking && !attacking2) {
attacking = true;
attackPhase = 1;
@@ -131,8 +195,8 @@ public class Player1 extends Actor
}
public boolean attacke2(){
if(System.currentTimeMillis() >= c){
if(Greenfoot.isKeyDown("q")){
if(System.currentTimeMillis() >= c &! isBlocking){
if(Greenfoot.isKeyDown("v")){
if (!attacking2 && !attacking) {
attacking2 = true;
attackPhase = 1;
@@ -167,6 +231,97 @@ public class Player1 extends Actor
}
}
public void dash(){
if(Greenfoot.isKeyDown("r") && System.currentTimeMillis() >= dashTimer &! isBlocking){
if(schautNachRechts){
vDashSpeed = vDashSpeedCharakter;
schautNachRechts2 = 1;
dashAnimation(schautNachRechts2);
}
else{
vDashSpeed = -vDashSpeedCharakter;
schautNachRechts2 = 0;
dashAnimation(schautNachRechts2);
}
isDash = true;
dashTimer = System.currentTimeMillis() + 1000;
}
}
public boolean dashAttack(){
if(isDash && Greenfoot.isKeyDown("f") && System.currentTimeMillis() >= dashAttackTimer &! isBlocking){
dashAttackTimer = System.currentTimeMillis() + 300;
dashAttackTimer2 = System.currentTimeMillis() + 300;
isDashAttack = true;
return true;
}
else{
return false;
}
}
public void dashAttackAnimation(){
if(isDashAttack){
setImage(dashAttackAnimation);
GreenfootImage image = getImage();
image.scale(250, 250);
setImage(image);
if(schautNachRechts2 == 0){
getImage().mirrorHorizontally();
}
if(System.currentTimeMillis() >= dashAttackTimer2){
setImage(defaultAnimation);
image = getImage();
image.scale(250, 250);
setImage(image);
if(schautNachRechts2 == 0){
getImage().mirrorHorizontally();
}
isDashAttack = false;
}
}
}
public void dashAnimation(int pRechts){
if(vDashSpeed != 0){
if(pRechts == 1){
setImage(dashAnimation);
GreenfootImage image = getImage();
image.scale(250, 250);
setImage(image);
setLocation(getX() + vDashSpeed, getY());
vDashSpeed -= 1;
if(vDashSpeed == 0){
setImage(defaultAnimation);
image = getImage();
image.scale(250, 250);
setImage(image);
}
}
if(pRechts == 0){
setImage(dashAnimation);
GreenfootImage image = getImage();
image.scale(250, 250);
setImage(image);
getImage().mirrorHorizontally();
setLocation(getX() + vDashSpeed, getY());
vDashSpeed += 1;
if(vDashSpeed == 0){
setImage(defaultAnimation);
image = getImage();
image.scale(250, 250);
setImage(image);
getImage().mirrorHorizontally();
}
}
}
else{
isDash = false;
}
}
public void animation1(){
if (attacking && attackPhase == 1 && System.currentTimeMillis() - attackTimer >= (int)(200/speedFaktor)) {
if(schautNachRechts){
@@ -227,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);
@@ -323,14 +576,43 @@ public class Player1 extends Actor
}
}
public void gravitation(){
if(this.getY() < 290){
setRotation(90);
move(4);
setRotation(0);
public void gotHit(){
if(System.currentTimeMillis() >= hitTimer && gotHit){
setImage(defaultAnimation);
GreenfootImage image = getImage();
image.scale(250, 250);
setImage(image);
if(!schautNachRechts){
getImage().mirrorHorizontally();
}
gotHit = false;
}
}
public void block(){
if(Greenfoot.isKeyDown("d")){
isBlocking = true;
setImage(blockAnimation);
GreenfootImage image = getImage();
image.scale(250, 250);
setImage(image);
if(!schautNachRechts){
getImage().mirrorHorizontally();
}
}
if(isBlocking &! Greenfoot.isKeyDown("d")){
isBlocking = false;
setImage(defaultAnimation);
GreenfootImage image = getImage();
image.scale(250, 250);
setImage(image);
if(!schautNachRechts){
getImage().mirrorHorizontally();
}
}
}
public void charakter(){
if(charakter == 1){
@@ -342,12 +624,27 @@ public class Player1 extends Actor
walk2 = "RenRun2.png";
walk3 = "RenRun3.png";
walk4 = "RenRun4.png";
dashAnimation = "RenDashForward.png";
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";
@@ -358,12 +655,27 @@ public class Player1 extends Actor
walk2 = "TetsuRun2.png";
walk3 = "TetsuRun3.png";
walk4 = "TetsuRun4.png";
dashAnimation = "TetsuDashForward.png";
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";
@@ -374,16 +686,33 @@ public class Player1 extends Actor
walk2 = "HinataRun2.png";
walk3 = "HinataRun3.png";
walk4 = "HinataRun4.png";
dashAnimation = "HinataDashForward.png";
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();
image.scale(250,250);
setImage(image);
}
}
Binary file not shown.
+25 -7
View File
@@ -4,7 +4,25 @@ comment0.text=\r\n\ Write\ a\ description\ of\ class\ player\ here.\r\n\ \r\n\ @
comment1.params=pCharakter
comment1.target=Player2(int)
comment10.params=
comment10.target=void\ charakter()
comment10.target=boolean\ dashAttack()
comment11.params=
comment11.target=void\ dashAttackAnimation()
comment12.params=pRechts
comment12.target=void\ dashAnimation(int)
comment13.params=
comment13.target=void\ animation1()
comment14.params=
comment14.target=void\ animationLaufen()
comment15.params=
comment15.target=void\ animationShoot()
comment16.params=
comment16.target=void\ animationUlti()
comment17.params=
comment17.target=void\ gotHit()
comment18.params=
comment18.target=void\ block()
comment19.params=
comment19.target=void\ charakter()
comment2.params=
comment2.target=void\ act()
comment3.params=
@@ -12,13 +30,13 @@ comment3.target=void\ bewegung()
comment4.params=
comment4.target=void\ springen()
comment5.params=
comment5.target=boolean\ attacke()
comment5.target=void\ gravitation()
comment6.params=
comment6.target=boolean\ attacke2()
comment6.target=void\ fall()
comment7.params=
comment7.target=void\ animation1()
comment7.target=boolean\ attacke()
comment8.params=
comment8.target=void\ animationLaufen()
comment8.target=boolean\ attacke2()
comment9.params=
comment9.target=void\ gravitation()
numComments=11
comment9.target=void\ dash()
numComments=20
+352 -25
View File
@@ -19,6 +19,7 @@ public class Player2 extends Actor
long d = 0;
long e = 0;
boolean schautNachRechts;
int schautNachRechts2;
long attackTimer = 0;
int attackPhase = 0;
boolean attacking = false;
@@ -35,10 +36,43 @@ 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;
String blockAnimation;
int attack2Duration;
int speed;
double speedFaktor;
double speedFaktor2;
long dashTimer;
long jumpTimer = 0;
int vSpeed = 0;
int meereshoehe = 289;
int vDashSpeed = 0;
int vDashSpeedCharakter;
boolean gotHit = false;
long hitTimer = 0;
long dashAttackTimer = 0;
boolean isDash = false;
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;
@@ -52,10 +86,29 @@ public class Player2 extends Actor
springen();
animation1();
animationLaufen();
dash();
dashAnimation(schautNachRechts2);
dashAttackAnimation();
gotHit();
block();
animationShoot();
animationUlti();
if(isShooting){
shootTimer++;
}
else{
shootTimer = 0;
}
if(isUlti){
ultiTimer++;
}
else{
ultiTimer = 0;
}
}
public void bewegung(){
if(Greenfoot.isKeyDown("l")){
if(Greenfoot.isKeyDown("p") &! isBlocking){
setRotation(0);
move(speed);
if(!schautNachRechts && attackPhase == 0){
@@ -66,7 +119,7 @@ public class Player2 extends Actor
attacke();
attacke2();
}
if(Greenfoot.isKeyDown("j")){
if(Greenfoot.isKeyDown("i") &! isBlocking){
setRotation(0);
move(-speed);
if(schautNachRechts && attackPhase == 0){
@@ -78,24 +131,35 @@ public class Player2 extends Actor
attacke2();
}
}
public void springen() {
if(Greenfoot.isKeyDown("i") && this.getY() > 289 ){
for(int i = 12; i > -12; i--){
setRotation(270);
move(i);
setRotation(0);
Greenfoot.delay(1);
bewegung();
attacke();
attacke2();
if (Greenfoot.isKeyDown("o") && getY() >= meereshoehe &! isBlocking) {
vSpeed = -15;
fall();
}
}
public void gravitation() {
if (getY() < meereshoehe || vSpeed < 0) {
fall();
} else {
vSpeed = 0;
setLocation(getX(), meereshoehe);
}
}
private void fall() {
setLocation(getX(), getY() + vSpeed);
vSpeed += 1;
}
public boolean attacke(){
if(System.currentTimeMillis() >= c){
if(Greenfoot.isKeyDown("o")){
if(System.currentTimeMillis() >= c &! isBlocking){
GreenfootImage img = getImage();
setImage(dashAnimation);
GreenfootImage img2 = getImage();
setImage(img);
if(Greenfoot.isKeyDown("j") &! isDash){
if (!attacking && !attacking2) {
attacking = true;
attackPhase = 1;
@@ -131,8 +195,8 @@ public class Player2 extends Actor
}
public boolean attacke2(){
if(System.currentTimeMillis() >= c){
if(Greenfoot.isKeyDown("u")){
if(System.currentTimeMillis() >= c &! isBlocking){
if(Greenfoot.isKeyDown("n")){
if (!attacking2 && !attacking) {
attacking2 = true;
attackPhase = 1;
@@ -167,6 +231,97 @@ public class Player2 extends Actor
}
}
public void dash(){
if(Greenfoot.isKeyDown("u") && System.currentTimeMillis() >= dashTimer &! isBlocking){
if(schautNachRechts){
vDashSpeed = vDashSpeedCharakter;
schautNachRechts2 = 1;
dashAnimation(schautNachRechts2);
}
else{
vDashSpeed = -vDashSpeedCharakter;
schautNachRechts2 = 0;
dashAnimation(schautNachRechts2);
}
isDash = true;
dashTimer = System.currentTimeMillis() + 1000;
}
}
public boolean dashAttack(){
if(isDash && Greenfoot.isKeyDown("j") && System.currentTimeMillis() >= dashAttackTimer &! isBlocking){
dashAttackTimer = System.currentTimeMillis() + 300;
dashAttackTimer2 = System.currentTimeMillis() + 300;
isDashAttack = true;
return true;
}
else{
return false;
}
}
public void dashAttackAnimation(){
if(isDashAttack){
setImage(dashAttackAnimation);
GreenfootImage image = getImage();
image.scale(250, 250);
setImage(image);
if(schautNachRechts2 == 0){
getImage().mirrorHorizontally();
}
if(System.currentTimeMillis() >= dashAttackTimer2){
setImage(defaultAnimation);
image = getImage();
image.scale(250, 250);
setImage(image);
if(schautNachRechts2 == 0){
getImage().mirrorHorizontally();
}
isDashAttack = false;
}
}
}
public void dashAnimation(int pRechts){
if(vDashSpeed != 0){
if(pRechts == 1){
setImage(dashAnimation);
GreenfootImage image = getImage();
image.scale(250, 250);
setImage(image);
setLocation(getX() + vDashSpeed, getY());
vDashSpeed -= 1;
if(vDashSpeed == 0){
setImage(defaultAnimation);
image = getImage();
image.scale(250, 250);
setImage(image);
}
}
if(pRechts == 0){
setImage(dashAnimation);
GreenfootImage image = getImage();
image.scale(250, 250);
setImage(image);
getImage().mirrorHorizontally();
setLocation(getX() + vDashSpeed, getY());
vDashSpeed += 1;
if(vDashSpeed == 0){
setImage(defaultAnimation);
image = getImage();
image.scale(250, 250);
setImage(image);
getImage().mirrorHorizontally();
}
}
}
else{
isDash = false;
}
}
public void animation1(){
if (attacking && attackPhase == 1 && System.currentTimeMillis() - attackTimer >= (int)(200/speedFaktor)) {
if(schautNachRechts){
@@ -228,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);
@@ -323,12 +478,137 @@ public class Player2 extends Actor
}
}
public void gravitation(){
if(this.getY() < 290){
setRotation(90);
move(4);
setRotation(0);
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);
GreenfootImage image = getImage();
image.scale(250, 250);
setImage(image);
if(!schautNachRechts){
getImage().mirrorHorizontally();
}
gotHit = false;
}
}
public void block(){
if(Greenfoot.isKeyDown("k")){
isBlocking = true;
setImage(blockAnimation);
GreenfootImage image = getImage();
image.scale(250, 250);
setImage(image);
if(!schautNachRechts){
getImage().mirrorHorizontally();
}
}
if(isBlocking &! Greenfoot.isKeyDown("k")){
isBlocking = false;
setImage(defaultAnimation);
GreenfootImage image = getImage();
image.scale(250, 250);
setImage(image);
if(!schautNachRechts){
getImage().mirrorHorizontally();
}
}
}
@@ -342,12 +622,27 @@ public class Player2 extends Actor
walk2 = "RenRun2.png";
walk3 = "RenRun3.png";
walk4 = "RenRun4.png";
dashAnimation = "RenDashForward.png";
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";
@@ -358,12 +653,27 @@ public class Player2 extends Actor
walk2 = "TetsuRun2.png";
walk3 = "TetsuRun3.png";
walk4 = "TetsuRun4.png";
dashAnimation = "TetsuDashForward.png";
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";
@@ -374,12 +684,27 @@ public class Player2 extends Actor
walk2 = "HinataRun2.png";
walk3 = "HinataRun3.png";
walk4 = "HinataRun4.png";
dashAnimation = "HinataDashForward.png";
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();
@@ -387,4 +712,6 @@ public class Player2 extends Actor
setImage(image);
getImage().mirrorHorizontally();
}
}
+45 -13
View File
@@ -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
@@ -37,13 +55,13 @@ dependency8.type=UsesDependency
dependency9.from=MyWorld
dependency9.to=Lebensanzeige
dependency9.type=UsesDependency
editor.fx.0.height=678
editor.fx.0.width=604
editor.fx.0.x=682
editor.fx.0.y=0
height=686
package.numDependencies=11
package.numTargets=9
editor.fx.0.height=686
editor.fx.0.width=1294
editor.fx.0.x=-7
editor.fx.0.y=-7
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