Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 988c8196f6 | |||
| 8f4f730c72 | |||
| 700eef1064 |
@@ -18,13 +18,14 @@ public class EndWorld extends World
|
||||
// Create a new world with 600x400 cells with a cell size of 1x1 pixels.
|
||||
super(600, 400, 1);
|
||||
|
||||
showText("GAME OVER", 300, 60);
|
||||
showText("the winner is " + pSieger, 300, 200);
|
||||
showText("Drücke R für einen Neustart", 300, 220);
|
||||
showText("GAME OVER", 300, 70);
|
||||
showText("the winner is " + pSieger, 300, 220);
|
||||
showText("Drücke R für einen Neustart", 300, 340);
|
||||
setBackground(new GreenfootImage("GameOverSreen.png"));
|
||||
}
|
||||
public void act(){
|
||||
if (Greenfoot.isKeyDown("r")){
|
||||
Greenfoot.setWorld(new StartWorld());
|
||||
Greenfoot.setWorld(new MenuWorld());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,6 @@ comment1.target=Lebensanzeige()
|
||||
comment1.text=\r\n\ Act\ -\ do\ whatever\ the\ LebensanzeigeP1\ wants\ to\ do.\ This\ method\ is\ called\ whenever\r\n\ the\ 'Act'\ or\ 'Run'\ button\ gets\ pressed\ in\ the\ environment.\r\n
|
||||
comment2.params=
|
||||
comment2.target=void\ act()
|
||||
comment3.params=pLeben
|
||||
comment3.target=void\ leben(double)
|
||||
comment3.params=pLeben\ pMaxLeben
|
||||
comment3.target=void\ leben(double,\ double)
|
||||
numComments=4
|
||||
|
||||
@@ -15,7 +15,7 @@ public class Lebensanzeige extends Actor
|
||||
Lebensanzeige(){
|
||||
setImage("green.png");
|
||||
GreenfootImage image = getImage();
|
||||
image.scale(200,40);
|
||||
image.scale(200,15);
|
||||
setImage(image);
|
||||
}
|
||||
|
||||
@@ -24,11 +24,11 @@ public class Lebensanzeige extends Actor
|
||||
|
||||
}
|
||||
|
||||
public void leben(double pLeben){
|
||||
if(pLeben != 0){
|
||||
public void leben(double pLeben, double pMaxLeben){
|
||||
if(pLeben > 0){
|
||||
setImage("green.png");
|
||||
GreenfootImage image = getImage();
|
||||
image.scale((int)(200 * (pLeben/100)),40);
|
||||
image.scale((int)(200 * (pLeben/pMaxLeben)),15);
|
||||
setImage(image);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
#BlueJ class context
|
||||
comment0.target=MenuWorld
|
||||
comment0.text=\r\n\ Write\ a\ description\ of\ class\ StartWorld\ here.\r\n\ \r\n\ @author\ (your\ name)\ \r\n\ @version\ (a\ version\ number\ or\ a\ date)\r\n
|
||||
comment1.params=
|
||||
comment1.target=MenuWorld()
|
||||
comment10.params=
|
||||
comment10.target=void\ act()
|
||||
comment2.params=
|
||||
comment2.target=void\ pfeilA()
|
||||
comment3.params=
|
||||
comment3.target=void\ pfeilB()
|
||||
comment4.params=
|
||||
comment4.target=void\ pfeilC()
|
||||
comment5.params=
|
||||
comment5.target=void\ pfeil1()
|
||||
comment6.params=
|
||||
comment6.target=void\ pfeil2()
|
||||
comment7.params=
|
||||
comment7.target=void\ pfeil3()
|
||||
comment8.params=
|
||||
comment8.target=void\ SpielerWahl1()
|
||||
comment9.params=
|
||||
comment9.target=void\ SpielerWahl2()
|
||||
numComments=11
|
||||
@@ -0,0 +1,133 @@
|
||||
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
|
||||
|
||||
/**
|
||||
* Write a description of class StartWorld here.
|
||||
*
|
||||
* @author (your name)
|
||||
* @version (a version number or a date)
|
||||
*/
|
||||
public class MenuWorld extends World
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor for objects of class StartWorld.
|
||||
*
|
||||
*/
|
||||
public int aktuellerSpieler1;
|
||||
public int aktuellerSpieler2;
|
||||
public Pfeil cursor1;
|
||||
public Pfeil cursor2;
|
||||
long timer;
|
||||
long x;
|
||||
Picture p4;
|
||||
|
||||
public MenuWorld()
|
||||
{
|
||||
// Create a new world with 600x400 cells with a cell size of 1x1 pixels.
|
||||
super(600, 400, 1);
|
||||
showText("Anime Fighters" , 300, 50);
|
||||
showText("select", 300, 103);
|
||||
//showText("press enter to start", 300, 340);
|
||||
showText("player 1 :", 130,100);
|
||||
showText("player 2 :", 470,100);
|
||||
|
||||
showText("1 Ren ", 470,170);
|
||||
showText("2 Tetsu ", 470,233);
|
||||
showText("3 Hinata ", 470,296);
|
||||
|
||||
showText("a Ren ", 180,170);
|
||||
showText("b Tetsu ", 180,233);
|
||||
showText("c Hinata ", 180,296);
|
||||
|
||||
cursor1 = new Pfeil();
|
||||
cursor1.setImage("IMG_7887.png");
|
||||
GreenfootImage image = cursor1.getImage();
|
||||
image.scale(220,70);
|
||||
cursor1.setImage(image);
|
||||
cursor1.getImage().mirrorHorizontally();
|
||||
|
||||
cursor2 = new Pfeil();
|
||||
cursor2.setImage("IMG_7886.png");
|
||||
GreenfootImage image2 = cursor2.getImage();
|
||||
image2.scale(220,70);
|
||||
cursor2.setImage(image2);
|
||||
|
||||
setBackground(new GreenfootImage("MenuScreen.png"));
|
||||
setPaintOrder(Pfeil.class);
|
||||
}
|
||||
|
||||
public void pfeilA(){
|
||||
if(Greenfoot.isKeyDown("a")){
|
||||
aktuellerSpieler1 = 1;
|
||||
addObject(cursor1, 200, 100);
|
||||
cursor1.setLocation(150,170);
|
||||
}
|
||||
}
|
||||
public void pfeilB(){
|
||||
if(Greenfoot.isKeyDown("b")){
|
||||
aktuellerSpieler1 = 2;
|
||||
addObject(cursor1, 200, 100);
|
||||
cursor1.setLocation(150,232);
|
||||
}
|
||||
}
|
||||
public void pfeilC(){
|
||||
if(Greenfoot.isKeyDown("c")){
|
||||
aktuellerSpieler1 = 3;
|
||||
addObject(cursor1, 200, 100);
|
||||
cursor1.setLocation(150,298);
|
||||
}
|
||||
}
|
||||
|
||||
public void pfeil1(){
|
||||
if(Greenfoot.isKeyDown("1")){
|
||||
aktuellerSpieler2 = 1;
|
||||
addObject(cursor2, 200, 100);
|
||||
cursor2.setLocation(446,170);
|
||||
}
|
||||
}
|
||||
public void pfeil2(){
|
||||
if(Greenfoot.isKeyDown("2")){
|
||||
aktuellerSpieler2 = 2;
|
||||
addObject(cursor2, 200, 0);
|
||||
cursor2.setLocation(446,232);
|
||||
}
|
||||
}
|
||||
public void pfeil3(){
|
||||
if(Greenfoot.isKeyDown("3")){
|
||||
aktuellerSpieler2 = 3;
|
||||
addObject(cursor2, 200, 100);
|
||||
cursor2.setLocation(446,298);
|
||||
}
|
||||
}
|
||||
|
||||
public void SpielerWahl1(){
|
||||
pfeilA();
|
||||
pfeilB();
|
||||
pfeilC();
|
||||
}
|
||||
|
||||
public void SpielerWahl2(){
|
||||
pfeil1();
|
||||
pfeil2();
|
||||
pfeil3();
|
||||
}
|
||||
|
||||
public void act(){
|
||||
SpielerWahl1();
|
||||
SpielerWahl2();
|
||||
if (Greenfoot.isKeyDown("enter")){
|
||||
if(aktuellerSpieler1 > 0 && aktuellerSpieler2 > 0){
|
||||
Greenfoot.setWorld(new MyWorld(aktuellerSpieler1, aktuellerSpieler2));
|
||||
}
|
||||
}
|
||||
if(System.currentTimeMillis() >= timer && aktuellerSpieler1 > 0 && aktuellerSpieler2 > 0){
|
||||
p4 = new Picture(4);
|
||||
addObject(p4,300,370);
|
||||
x = System.currentTimeMillis() + 500;
|
||||
timer = System.currentTimeMillis() + 1000;
|
||||
}
|
||||
if(System.currentTimeMillis() >= x){
|
||||
removeObject(p4);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,4 +13,6 @@ comment4.params=
|
||||
comment4.target=void\ gameEnd()
|
||||
comment5.params=
|
||||
comment5.target=void\ lebensAnzeige()
|
||||
numComments=6
|
||||
comment6.params=
|
||||
comment6.target=void\ charakterP1()
|
||||
numComments=7
|
||||
|
||||
@@ -14,6 +14,13 @@ public class MyWorld extends World
|
||||
int charakterP2;
|
||||
Lebensanzeige l1;
|
||||
Lebensanzeige l2;
|
||||
Picture p1;
|
||||
Picture p2;
|
||||
int attack1Distance;
|
||||
int attack2Distance;
|
||||
int attack1Strength;
|
||||
int attack2Strength;
|
||||
int var;
|
||||
/**
|
||||
* Constructor for objects of class MyWorld.
|
||||
*
|
||||
@@ -39,36 +46,56 @@ public class MyWorld extends World
|
||||
player2 = new Player2(charakterP2);
|
||||
addObject(player2,429,152);
|
||||
l1 = new Lebensanzeige();
|
||||
addObject(l1,150,50);
|
||||
addObject(l1,150,40);
|
||||
l2 = new Lebensanzeige();
|
||||
addObject(l2,450,50);
|
||||
addObject(l2,450,40);
|
||||
p1 = new Picture(1);
|
||||
addObject(p1,150,50);
|
||||
p2 = new Picture(2);
|
||||
addObject(p2,450,50);
|
||||
charakterP1();
|
||||
}
|
||||
|
||||
public void act(){
|
||||
if(player1.attacke()){
|
||||
if(player1.getX() - player2.getX() < 50 && player1.getX() - player2.getX() > -50 && player1.getY() - player2.getY() < 30 && player1.getY() - player2.getY() > -30){
|
||||
player2.leben = player2.leben -10;
|
||||
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;
|
||||
setPaintOrder(Player1.class,Player2.class);
|
||||
}
|
||||
}
|
||||
if(player2.attacke()){
|
||||
if(player1.getX() - player2.getX() < 50 && player1.getX() - player2.getX() > -50 && player1.getY() - player2.getY() < 30 && player1.getY() - player2.getY() > -30){
|
||||
player1.leben = player1.leben -10;
|
||||
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;
|
||||
setPaintOrder(Player2.class,Player1.class);
|
||||
}
|
||||
}
|
||||
showText(String.valueOf(player2.leben),450,50);
|
||||
showText(String.valueOf(player1.leben),150,50);
|
||||
l1.leben(player1.leben);
|
||||
l2.leben(player2.leben);
|
||||
l1.setLocation(150 - (100 - player1.leben), 50);
|
||||
l2.setLocation(450 - (100 - player2.leben), 50);
|
||||
if(player1.attacke2()){
|
||||
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;
|
||||
setPaintOrder(Player1.class,Player2.class);
|
||||
}
|
||||
}
|
||||
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;
|
||||
setPaintOrder(Player2.class,Player1.class);
|
||||
}
|
||||
}
|
||||
showText(String.valueOf(player2.leben),450,40);
|
||||
showText(String.valueOf(player1.leben),150,40);
|
||||
l1.leben(player1.leben, player1.maxLeben);
|
||||
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);
|
||||
gameEnd();
|
||||
lebensAnzeige();
|
||||
}
|
||||
|
||||
public void gameEnd(){
|
||||
if(player1.leben == 0){
|
||||
if(player1.leben <= 0){
|
||||
Greenfoot.setWorld(new EndWorld("Player Two"));
|
||||
}
|
||||
if(player2.leben == 0){
|
||||
if(player2.leben <= 0){
|
||||
Greenfoot.setWorld(new EndWorld("Player One"));
|
||||
}
|
||||
}
|
||||
@@ -76,4 +103,25 @@ public class MyWorld extends World
|
||||
public void lebensAnzeige(){
|
||||
|
||||
}
|
||||
|
||||
public void charakterP1(){
|
||||
if(charakterP1 == 1){
|
||||
attack1Distance = 95;
|
||||
attack2Distance = 120;
|
||||
attack1Strength = 10;
|
||||
attack2Strength = 20;
|
||||
}
|
||||
else if(charakterP1 == 2){
|
||||
attack1Distance = 95;
|
||||
attack2Distance = 145;
|
||||
attack1Strength = 15;
|
||||
attack2Strength = 30;
|
||||
}
|
||||
else if(charakterP1 == 3){
|
||||
attack1Distance = 95;
|
||||
attack2Distance = 110;
|
||||
attack1Strength = 8;
|
||||
attack2Strength = 15;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
#BlueJ class context
|
||||
comment0.target=Picture
|
||||
comment0.text=\r\n\ Write\ a\ description\ of\ class\ Picture\ here.\r\n\ \r\n\ @author\ (your\ name)\ \r\n\ @version\ (a\ version\ number\ or\ a\ date)\r\n
|
||||
comment1.params=pNumber
|
||||
comment1.target=Picture(int)
|
||||
comment2.params=
|
||||
comment2.target=void\ act()
|
||||
numComments=3
|
||||
@@ -0,0 +1,47 @@
|
||||
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
|
||||
|
||||
/**
|
||||
* Write a description of class Picture here.
|
||||
*
|
||||
* @author (your name)
|
||||
* @version (a version number or a date)
|
||||
*/
|
||||
public class Picture extends Actor
|
||||
{
|
||||
/**
|
||||
* Act - do whatever the Picture wants to do. This method is called whenever
|
||||
* the 'Act' or 'Run' button gets pressed in the environment.
|
||||
*/
|
||||
int pictureNumber;
|
||||
Picture(int pNumber){
|
||||
pictureNumber = pNumber;
|
||||
}
|
||||
|
||||
public void act()
|
||||
{
|
||||
if(pictureNumber == 1){
|
||||
setImage("HealthbarLeft.png");
|
||||
GreenfootImage image = getImage();
|
||||
image.scale(230,53);
|
||||
setImage(image);
|
||||
}
|
||||
if(pictureNumber == 2){
|
||||
setImage("HealthbarRight.png");
|
||||
GreenfootImage image = getImage();
|
||||
image.scale(230,53);
|
||||
setImage(image);
|
||||
}
|
||||
if(pictureNumber == 3){
|
||||
setImage("press.png");
|
||||
GreenfootImage image = getImage();
|
||||
image.scale(400,133);
|
||||
setImage(image);
|
||||
}
|
||||
if(pictureNumber == 4){
|
||||
setImage("press.png");
|
||||
GreenfootImage image = getImage();
|
||||
image.scale(200,67);
|
||||
setImage(image);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,22 +3,7 @@ comment0.target=StartWorld
|
||||
comment0.text=\r\n\ Write\ a\ description\ of\ class\ StartWorld\ here.\r\n\ \r\n\ @author\ (your\ name)\ \r\n\ @version\ (a\ version\ number\ or\ a\ date)\r\n
|
||||
comment1.params=
|
||||
comment1.target=StartWorld()
|
||||
comment10.params=
|
||||
comment10.target=void\ act()
|
||||
comment1.text=\r\n\ Constructor\ for\ objects\ of\ class\ StartWorld.\r\n\ \r\n
|
||||
comment2.params=
|
||||
comment2.target=void\ pfeilA()
|
||||
comment3.params=
|
||||
comment3.target=void\ pfeilB()
|
||||
comment4.params=
|
||||
comment4.target=void\ pfeilC()
|
||||
comment5.params=
|
||||
comment5.target=void\ pfeil1()
|
||||
comment6.params=
|
||||
comment6.target=void\ pfeil2()
|
||||
comment7.params=
|
||||
comment7.target=void\ pfeil3()
|
||||
comment8.params=
|
||||
comment8.target=void\ SpielerWahl1()
|
||||
comment9.params=
|
||||
comment9.target=void\ SpielerWahl2()
|
||||
numComments=11
|
||||
comment2.target=void\ act()
|
||||
numComments=3
|
||||
|
||||
@@ -8,101 +8,32 @@ import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
|
||||
*/
|
||||
public class StartWorld extends World
|
||||
{
|
||||
|
||||
long x= 0;
|
||||
long timer = 0;
|
||||
Picture p3;
|
||||
/**
|
||||
* Constructor for objects of class StartWorld.
|
||||
*
|
||||
*/
|
||||
public int aktuellerSpieler1;
|
||||
public int aktuellerSpieler2;
|
||||
public Pfeil cursor1;
|
||||
public Pfeil cursor2;
|
||||
|
||||
public StartWorld()
|
||||
{
|
||||
// Create a new world with 600x400 cells with a cell size of 1x1 pixels.
|
||||
super(600, 400, 1);
|
||||
showText("Spiel Name" , 300, 20);
|
||||
showText("select a character", 300, 70);
|
||||
showText("press enter to start", 300, 340);
|
||||
showText("player 1 :", 100,100);
|
||||
showText("player 2 :", 500,100);
|
||||
|
||||
showText("1 character 1", 500,150);
|
||||
showText("2 character 2", 500,200);
|
||||
showText("3 character 3", 500,250);
|
||||
|
||||
showText("a character 1", 100,150);
|
||||
showText("b character 2", 100,200);
|
||||
showText("c character 3", 100,250);
|
||||
|
||||
cursor1 = new Pfeil();
|
||||
cursor1.setImage("cursor.png");
|
||||
addObject(cursor1, 50, 100);
|
||||
|
||||
cursor2 = new Pfeil();
|
||||
cursor2.setImage("cursor.png");
|
||||
addObject(cursor2 , 450, 100);
|
||||
|
||||
}
|
||||
|
||||
public void pfeilA(){
|
||||
if(Greenfoot.isKeyDown("a")){
|
||||
aktuellerSpieler1 = 1;
|
||||
cursor1.setLocation(50,160);
|
||||
}
|
||||
}
|
||||
public void pfeilB(){
|
||||
if(Greenfoot.isKeyDown("b")){
|
||||
aktuellerSpieler1 = 2;
|
||||
cursor1.setLocation(50,210);
|
||||
}
|
||||
}
|
||||
public void pfeilC(){
|
||||
if(Greenfoot.isKeyDown("c")){
|
||||
aktuellerSpieler1 = 3;
|
||||
cursor1.setLocation(50,260);
|
||||
}
|
||||
}
|
||||
|
||||
public void pfeil1(){
|
||||
if(Greenfoot.isKeyDown("1")){
|
||||
aktuellerSpieler2 = 1;
|
||||
cursor2.setLocation(450,160);
|
||||
}
|
||||
}
|
||||
public void pfeil2(){
|
||||
if(Greenfoot.isKeyDown("2")){
|
||||
aktuellerSpieler2 = 2;
|
||||
cursor2.setLocation(450,210);
|
||||
}
|
||||
}
|
||||
public void pfeil3(){
|
||||
if(Greenfoot.isKeyDown("3")){
|
||||
aktuellerSpieler2 = 3;
|
||||
cursor2.setLocation(450,260);
|
||||
}
|
||||
}
|
||||
|
||||
public void SpielerWahl1(){
|
||||
pfeilA();
|
||||
pfeilB();
|
||||
pfeilC();
|
||||
}
|
||||
|
||||
public void SpielerWahl2(){
|
||||
pfeil1();
|
||||
pfeil2();
|
||||
pfeil3();
|
||||
super(600, 400, 1);
|
||||
|
||||
}
|
||||
|
||||
public void act(){
|
||||
SpielerWahl1();
|
||||
SpielerWahl2();
|
||||
if (Greenfoot.isKeyDown("enter")){
|
||||
if(aktuellerSpieler1 > 0 && aktuellerSpieler2 > 0){
|
||||
Greenfoot.setWorld(new MyWorld(aktuellerSpieler1, aktuellerSpieler2));
|
||||
if(System.currentTimeMillis() >= timer){
|
||||
p3 = new Picture(3);
|
||||
addObject(p3,300,350);
|
||||
x = System.currentTimeMillis() + 500;
|
||||
timer = System.currentTimeMillis() + 1000;
|
||||
}
|
||||
if(System.currentTimeMillis() >= x){
|
||||
removeObject(p3);
|
||||
}
|
||||
if (Greenfoot.isKeyDown("enter")){
|
||||
Greenfoot.setWorld(new MenuWorld());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
After Width: | Height: | Size: 414 KiB |
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 175 KiB |
|
After Width: | Height: | Size: 205 KiB |
|
After Width: | Height: | Size: 223 KiB |
|
After Width: | Height: | Size: 120 KiB |
|
After Width: | Height: | Size: 94 KiB |
|
After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 121 KiB |
|
After Width: | Height: | Size: 102 KiB |
|
After Width: | Height: | Size: 120 KiB |
|
After Width: | Height: | Size: 111 KiB |
|
After Width: | Height: | Size: 127 KiB |
|
After Width: | Height: | Size: 131 KiB |
|
After Width: | Height: | Size: 133 KiB |
|
After Width: | Height: | Size: 140 KiB |
|
After Width: | Height: | Size: 120 KiB |
|
After Width: | Height: | Size: 133 KiB |
|
After Width: | Height: | Size: 205 KiB |
|
After Width: | Height: | Size: 108 KiB |
|
After Width: | Height: | Size: 168 KiB |
|
After Width: | Height: | Size: 82 KiB |
|
After Width: | Height: | Size: 147 KiB |
|
After Width: | Height: | Size: 469 KiB |
|
After Width: | Height: | Size: 31 KiB |
|
After Width: | Height: | Size: 31 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 439 KiB |
|
After Width: | Height: | Size: 128 KiB |
|
After Width: | Height: | Size: 116 KiB |
|
After Width: | Height: | Size: 116 KiB |
|
After Width: | Height: | Size: 120 KiB |
|
After Width: | Height: | Size: 130 KiB |
|
After Width: | Height: | Size: 118 KiB |
|
After Width: | Height: | Size: 102 KiB |
|
After Width: | Height: | Size: 141 KiB |
|
After Width: | Height: | Size: 115 KiB |
|
After Width: | Height: | Size: 100 KiB |
|
After Width: | Height: | Size: 59 KiB |
|
After Width: | Height: | Size: 116 KiB |
|
After Width: | Height: | Size: 114 KiB |
|
After Width: | Height: | Size: 105 KiB |
|
After Width: | Height: | Size: 123 KiB |
|
After Width: | Height: | Size: 106 KiB |
|
After Width: | Height: | Size: 115 KiB |
|
After Width: | Height: | Size: 143 KiB |
|
After Width: | Height: | Size: 126 KiB |
|
After Width: | Height: | Size: 112 KiB |
|
After Width: | Height: | Size: 130 KiB |
|
After Width: | Height: | Size: 177 KiB |
|
After Width: | Height: | Size: 153 KiB |
|
After Width: | Height: | Size: 216 KiB |
|
After Width: | Height: | Size: 124 KiB |
|
After Width: | Height: | Size: 145 KiB |
|
After Width: | Height: | Size: 624 KiB |
@@ -3,6 +3,8 @@ comment0.target=Player1
|
||||
comment0.text=\r\n\ Write\ a\ description\ of\ class\ player\ here.\r\n\ \r\n\ @author\ (your\ name)\ \r\n\ @version\ (a\ version\ number\ or\ a\ date)\r\n
|
||||
comment1.params=pCharakter
|
||||
comment1.target=Player1(int)
|
||||
comment10.params=
|
||||
comment10.target=void\ charakter()
|
||||
comment2.params=
|
||||
comment2.target=void\ act()
|
||||
comment3.params=
|
||||
@@ -12,11 +14,11 @@ comment4.target=void\ springen()
|
||||
comment5.params=
|
||||
comment5.target=boolean\ attacke()
|
||||
comment6.params=
|
||||
comment6.target=void\ animation1()
|
||||
comment6.target=boolean\ attacke2()
|
||||
comment7.params=
|
||||
comment7.target=void\ anitmationLaufen()
|
||||
comment7.target=void\ animation1()
|
||||
comment8.params=
|
||||
comment8.target=void\ gravitation()
|
||||
comment8.target=void\ animationLaufen()
|
||||
comment9.params=
|
||||
comment9.target=void\ charakter()
|
||||
numComments=10
|
||||
comment9.target=void\ gravitation()
|
||||
numComments=11
|
||||
|
||||
@@ -14,7 +14,10 @@ public class Player1 extends Actor
|
||||
*/
|
||||
|
||||
public int leben;
|
||||
int maxLeben;
|
||||
long c;
|
||||
long d = 0;
|
||||
long e = 0;
|
||||
boolean schautNachRechts;
|
||||
long attackTimer = 0;
|
||||
int attackPhase = 0;
|
||||
@@ -23,10 +26,22 @@ public class Player1 extends Actor
|
||||
long laufTimer = 0;
|
||||
boolean laeuft = false;
|
||||
int charakter;
|
||||
boolean attacking2 = false;
|
||||
String attacke1Animation;
|
||||
String attacke2Animation1;
|
||||
String attacke2Animation2;
|
||||
String defaultAnimation;
|
||||
String walk1;
|
||||
String walk2;
|
||||
String walk3;
|
||||
String walk4;
|
||||
int attack2Duration;
|
||||
int speed;
|
||||
double speedFaktor;
|
||||
double speedFaktor2;
|
||||
|
||||
Player1(int pCharakter){
|
||||
charakter = pCharakter;
|
||||
leben = 100;
|
||||
schautNachRechts = true;
|
||||
charakter();
|
||||
}
|
||||
@@ -36,27 +51,31 @@ public class Player1 extends Actor
|
||||
gravitation();
|
||||
springen();
|
||||
animation1();
|
||||
anitmationLaufen();
|
||||
animationLaufen();
|
||||
}
|
||||
|
||||
public void bewegung(){
|
||||
if(Greenfoot.isKeyDown("d")){
|
||||
setRotation(0);
|
||||
move(5);
|
||||
move(speed);
|
||||
if(!schautNachRechts && attackPhase == 0){
|
||||
getImage().mirrorHorizontally();
|
||||
schautNachRechts = true;
|
||||
}
|
||||
laeuft = true;
|
||||
attacke();
|
||||
attacke2();
|
||||
}
|
||||
if(Greenfoot.isKeyDown("a")){
|
||||
setRotation(0);
|
||||
move(-5);
|
||||
move(-speed);
|
||||
if(schautNachRechts && attackPhase == 0){
|
||||
getImage().mirrorHorizontally();
|
||||
schautNachRechts = false;
|
||||
}
|
||||
laeuft = true;
|
||||
attacke();
|
||||
attacke2();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,29 +87,30 @@ public class Player1 extends Actor
|
||||
setRotation(0);
|
||||
Greenfoot.delay(1);
|
||||
bewegung();
|
||||
attacke();
|
||||
attacke2();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean attacke(){
|
||||
if(Greenfoot.isKeyDown("e")){
|
||||
if(System.currentTimeMillis() >= c){
|
||||
|
||||
if (!attacking) {
|
||||
if(System.currentTimeMillis() >= c){
|
||||
if(Greenfoot.isKeyDown("e")){
|
||||
if (!attacking && !attacking2) {
|
||||
attacking = true;
|
||||
attackPhase = 1;
|
||||
attackTimer = System.currentTimeMillis();
|
||||
|
||||
if(schautNachRechts){
|
||||
setImage("1Combo2.png");
|
||||
setImage(attacke1Animation);
|
||||
GreenfootImage image = getImage();
|
||||
image.scale(160, 160);
|
||||
image.scale(250, 250);
|
||||
setImage(image);
|
||||
}
|
||||
else{
|
||||
setImage("1Combo2.png");
|
||||
setImage(attacke1Animation);
|
||||
GreenfootImage image = getImage();
|
||||
image.scale(160, 160);
|
||||
image.scale(250, 250);
|
||||
setImage(image);
|
||||
getImage().mirrorHorizontally();
|
||||
}
|
||||
@@ -98,81 +118,154 @@ public class Player1 extends Actor
|
||||
}
|
||||
|
||||
|
||||
c = System.currentTimeMillis() + 500;
|
||||
return true;
|
||||
c = System.currentTimeMillis() + (int)(500/speedFaktor);
|
||||
}
|
||||
else{
|
||||
return false;
|
||||
}
|
||||
if(attacking && attackPhase == 1 && System.currentTimeMillis() >= d){
|
||||
d = System.currentTimeMillis() + (int)(300/speedFaktor);
|
||||
return true;
|
||||
}
|
||||
else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean attacke2(){
|
||||
if(System.currentTimeMillis() >= c){
|
||||
if(Greenfoot.isKeyDown("q")){
|
||||
if (!attacking2 && !attacking) {
|
||||
attacking2 = true;
|
||||
attackPhase = 1;
|
||||
attackTimer = System.currentTimeMillis();
|
||||
|
||||
if(schautNachRechts){
|
||||
setImage(attacke2Animation1);
|
||||
GreenfootImage image = getImage();
|
||||
image.scale(250, 250);
|
||||
setImage(image);
|
||||
}
|
||||
else{
|
||||
setImage(attacke2Animation1);
|
||||
GreenfootImage image = getImage();
|
||||
image.scale(250, 250);
|
||||
setImage(image);
|
||||
getImage().mirrorHorizontally();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
c = System.currentTimeMillis() + (int)(800/speedFaktor);
|
||||
}
|
||||
}
|
||||
if(attacking2 && attackPhase == attack2Duration && System.currentTimeMillis() >= System.currentTimeMillis()+e){
|
||||
e = (int)(1000/speedFaktor2);
|
||||
return true;
|
||||
}
|
||||
else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void animation1(){
|
||||
if (attacking && attackPhase == 1 && System.currentTimeMillis() - attackTimer >= 200) {
|
||||
if (attacking && attackPhase == 1 && System.currentTimeMillis() - attackTimer >= (int)(200/speedFaktor)) {
|
||||
if(schautNachRechts){
|
||||
attackPhase = 2;
|
||||
setImage("2Combo1.png");
|
||||
setImage(defaultAnimation);
|
||||
GreenfootImage image = getImage();
|
||||
image.scale(160, 160);
|
||||
image.scale(250, 250);
|
||||
setImage(image);
|
||||
}
|
||||
else{
|
||||
attackPhase = 2;
|
||||
setImage("2Combo1.png");
|
||||
setImage(defaultAnimation);
|
||||
GreenfootImage image = getImage();
|
||||
image.scale(160, 160);
|
||||
image.scale(250, 250);
|
||||
setImage(image);
|
||||
getImage().mirrorHorizontally();
|
||||
}
|
||||
}
|
||||
if (attacking && attackPhase == 2 && System.currentTimeMillis() - attackTimer >= 300) {
|
||||
if (attacking && attackPhase == 2 && System.currentTimeMillis() - attackTimer >= (int)(500/speedFaktor)) {
|
||||
attacking = false;
|
||||
attackPhase = 0;
|
||||
d = 0;
|
||||
}
|
||||
if (attacking2 && attackPhase == 1 && System.currentTimeMillis() - attackTimer >= (int)(550/speedFaktor2)) {
|
||||
if(schautNachRechts){
|
||||
attackPhase = 2;
|
||||
setImage(attacke2Animation2);
|
||||
GreenfootImage image = getImage();
|
||||
image.scale(250, 250);
|
||||
setImage(image);
|
||||
}
|
||||
else{
|
||||
attackPhase = 2;
|
||||
setImage(attacke2Animation2);
|
||||
GreenfootImage image = getImage();
|
||||
image.scale(250, 250);
|
||||
setImage(image);
|
||||
getImage().mirrorHorizontally();
|
||||
}
|
||||
}
|
||||
if (attacking2 && attackPhase == 2 && System.currentTimeMillis() - attackTimer >= (int)(800/speedFaktor2)) {
|
||||
attacking2 = false;
|
||||
attackPhase = 0;
|
||||
e = 0;
|
||||
if(schautNachRechts){
|
||||
setImage(defaultAnimation);
|
||||
GreenfootImage image = getImage();
|
||||
image.scale(250, 250);
|
||||
setImage(image);
|
||||
}
|
||||
else{
|
||||
setImage(defaultAnimation);
|
||||
GreenfootImage image = getImage();
|
||||
image.scale(250, 250);
|
||||
setImage(image);
|
||||
getImage().mirrorHorizontally();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void anitmationLaufen(){
|
||||
if(laeuft){
|
||||
public void animationLaufen(){
|
||||
if(laeuft &! attacking &! attacking2){
|
||||
if(schautNachRechts){
|
||||
if(laufPhase == 0){
|
||||
setImage("RenRun1.png");
|
||||
setImage(walk1);
|
||||
GreenfootImage image = getImage();
|
||||
image.scale(160, 160);
|
||||
image.scale(250, 250);
|
||||
setImage(image);
|
||||
laufPhase = 1;
|
||||
laufTimer = System.currentTimeMillis();
|
||||
}
|
||||
if(laufPhase == 1 && System.currentTimeMillis() - laufTimer >= 100){
|
||||
setImage("RenRun2.png");
|
||||
if(laufPhase == 1 && System.currentTimeMillis() - laufTimer >= 200){
|
||||
setImage(walk2);
|
||||
GreenfootImage image = getImage();
|
||||
image.scale(160, 160);
|
||||
image.scale(250, 250);
|
||||
setImage(image);
|
||||
laufPhase = 2;
|
||||
laufTimer = System.currentTimeMillis();
|
||||
}
|
||||
if(laufPhase == 2 && System.currentTimeMillis() - laufTimer >= 100){
|
||||
setImage("RenRun3.png");
|
||||
if(laufPhase == 2 && System.currentTimeMillis() - laufTimer >= 200){
|
||||
setImage(walk3);
|
||||
GreenfootImage image = getImage();
|
||||
image.scale(160, 160);
|
||||
image.scale(250, 250);
|
||||
setImage(image);
|
||||
laufPhase = 3;
|
||||
laufTimer = System.currentTimeMillis();
|
||||
}
|
||||
if(laufPhase == 3 && System.currentTimeMillis() - laufTimer >= 100){
|
||||
setImage("RenRun4.png");
|
||||
if(laufPhase == 3 && System.currentTimeMillis() - laufTimer >= 200){
|
||||
setImage(walk4);
|
||||
GreenfootImage image = getImage();
|
||||
image.scale(160, 160);
|
||||
image.scale(250, 250);
|
||||
setImage(image);
|
||||
laufPhase = 4;
|
||||
laufTimer = System.currentTimeMillis();
|
||||
}
|
||||
if(laufPhase == 4 && System.currentTimeMillis() - laufTimer >= 100){
|
||||
setImage("2Combo1.png");
|
||||
if(laufPhase == 4 && System.currentTimeMillis() - laufTimer >= 200){
|
||||
setImage(defaultAnimation);
|
||||
GreenfootImage image = getImage();
|
||||
image.scale(160, 160);
|
||||
image.scale(250, 250);
|
||||
setImage(image);
|
||||
laufPhase = 0;
|
||||
laufTimer = System.currentTimeMillis();
|
||||
@@ -181,45 +274,45 @@ public class Player1 extends Actor
|
||||
}
|
||||
else{
|
||||
if(laufPhase == 0){
|
||||
setImage("RenRun1.png");
|
||||
setImage(walk1);
|
||||
GreenfootImage image = getImage();
|
||||
image.scale(160, 160);
|
||||
image.scale(250, 250);
|
||||
setImage(image);
|
||||
getImage().mirrorHorizontally();
|
||||
laufPhase = 1;
|
||||
laufTimer = System.currentTimeMillis();
|
||||
}
|
||||
if(laufPhase == 1 && System.currentTimeMillis() - laufTimer >= 100){
|
||||
setImage("RenRun2.png");
|
||||
if(laufPhase == 1 && System.currentTimeMillis() - laufTimer >= 200){
|
||||
setImage(walk2);
|
||||
GreenfootImage image = getImage();
|
||||
image.scale(160, 160);
|
||||
image.scale(250, 250);
|
||||
setImage(image);
|
||||
getImage().mirrorHorizontally();
|
||||
laufPhase = 2;
|
||||
laufTimer = System.currentTimeMillis();
|
||||
}
|
||||
if(laufPhase == 2 && System.currentTimeMillis() - laufTimer >= 100){
|
||||
setImage("RenRun3.png");
|
||||
if(laufPhase == 2 && System.currentTimeMillis() - laufTimer >= 200){
|
||||
setImage(walk3);
|
||||
GreenfootImage image = getImage();
|
||||
image.scale(160, 160);
|
||||
image.scale(250, 250);
|
||||
setImage(image);
|
||||
getImage().mirrorHorizontally();
|
||||
laufPhase = 3;
|
||||
laufTimer = System.currentTimeMillis();
|
||||
}
|
||||
if(laufPhase == 3 && System.currentTimeMillis() - laufTimer >= 100){
|
||||
setImage("RenRun4.png");
|
||||
if(laufPhase == 3 && System.currentTimeMillis() - laufTimer >= 200){
|
||||
setImage(walk4);
|
||||
GreenfootImage image = getImage();
|
||||
image.scale(160, 160);
|
||||
image.scale(250, 250);
|
||||
setImage(image);
|
||||
getImage().mirrorHorizontally();
|
||||
laufPhase = 4;
|
||||
laufTimer = System.currentTimeMillis();
|
||||
}
|
||||
if(laufPhase == 4 && System.currentTimeMillis() - laufTimer >= 100){
|
||||
setImage("2Combo1.png");
|
||||
if(laufPhase == 4 && System.currentTimeMillis() - laufTimer >= 200){
|
||||
setImage(defaultAnimation);
|
||||
GreenfootImage image = getImage();
|
||||
image.scale(160, 160);
|
||||
image.scale(250, 250);
|
||||
setImage(image);
|
||||
getImage().mirrorHorizontally();
|
||||
laufPhase = 0;
|
||||
@@ -241,11 +334,56 @@ public class Player1 extends Actor
|
||||
|
||||
public void charakter(){
|
||||
if(charakter == 1){
|
||||
setImage("2Combo1.png");
|
||||
GreenfootImage image = getImage();
|
||||
image.scale(160,160);
|
||||
setImage(image);
|
||||
defaultAnimation = "2Combo1.png";
|
||||
attacke1Animation = "1Combo2.png";
|
||||
attacke2Animation1 = "3Combo2.png";
|
||||
attacke2Animation2 = defaultAnimation;
|
||||
walk1 = "RenRun1.png";
|
||||
walk2 = "RenRun2.png";
|
||||
walk3 = "RenRun3.png";
|
||||
walk4 = "RenRun4.png";
|
||||
attack2Duration = 1;
|
||||
speed = 6;
|
||||
maxLeben = 100;
|
||||
leben = maxLeben;
|
||||
speedFaktor = 1;
|
||||
speedFaktor2 = speedFaktor;
|
||||
}
|
||||
|
||||
if(charakter == 2){
|
||||
defaultAnimation = "Tetsu1Combo1.png";
|
||||
attacke1Animation = "Tetsu1Combo2.png";
|
||||
attacke2Animation1 = "Tetsu3Combo1.png";
|
||||
attacke2Animation2 = "Tetsu3Combo2.png";
|
||||
walk1 = "TetsuRun1.png";
|
||||
walk2 = "TetsuRun2.png";
|
||||
walk3 = "TetsuRun3.png";
|
||||
walk4 = "TetsuRun4.png";
|
||||
attack2Duration = 2;
|
||||
speed = 4;
|
||||
maxLeben = 130;
|
||||
leben = maxLeben;
|
||||
speedFaktor = 0.5;
|
||||
speedFaktor2 = 0.75;
|
||||
}
|
||||
if(charakter == 3){
|
||||
defaultAnimation = "HinataShoot1.png";
|
||||
attacke1Animation = "Hinata2Combo1.png";
|
||||
attacke2Animation1 = "Hinata3Combo1.png";
|
||||
attacke2Animation2 = defaultAnimation;
|
||||
walk1 = "HinataRun1.png";
|
||||
walk2 = "HinataRun2.png";
|
||||
walk3 = "HinataRun3.png";
|
||||
walk4 = "HinataRun4.png";
|
||||
attack2Duration = 1;
|
||||
speed = 8;
|
||||
maxLeben = 80;
|
||||
leben = maxLeben;
|
||||
speedFaktor = 2;
|
||||
speedFaktor2 = 8;
|
||||
}
|
||||
setImage(defaultAnimation);
|
||||
GreenfootImage image = getImage();
|
||||
image.scale(250,250);
|
||||
setImage(image);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@ comment0.target=Player2
|
||||
comment0.text=\r\n\ Write\ a\ description\ of\ class\ player\ here.\r\n\ \r\n\ @author\ (your\ name)\ \r\n\ @version\ (a\ version\ number\ or\ a\ date)\r\n
|
||||
comment1.params=pCharakter
|
||||
comment1.target=Player2(int)
|
||||
comment10.params=
|
||||
comment10.target=void\ charakter()
|
||||
comment2.params=
|
||||
comment2.target=void\ act()
|
||||
comment3.params=
|
||||
@@ -12,11 +14,11 @@ comment4.target=void\ springen()
|
||||
comment5.params=
|
||||
comment5.target=boolean\ attacke()
|
||||
comment6.params=
|
||||
comment6.target=void\ animation1()
|
||||
comment6.target=boolean\ attacke2()
|
||||
comment7.params=
|
||||
comment7.target=void\ anitmationLaufen()
|
||||
comment7.target=void\ animation1()
|
||||
comment8.params=
|
||||
comment8.target=void\ gravitation()
|
||||
comment8.target=void\ animationLaufen()
|
||||
comment9.params=
|
||||
comment9.target=void\ charakter()
|
||||
numComments=10
|
||||
comment9.target=void\ gravitation()
|
||||
numComments=11
|
||||
|
||||
@@ -14,7 +14,10 @@ public class Player2 extends Actor
|
||||
*/
|
||||
|
||||
public int leben;
|
||||
int maxLeben;
|
||||
long c;
|
||||
long d = 0;
|
||||
long e = 0;
|
||||
boolean schautNachRechts;
|
||||
long attackTimer = 0;
|
||||
int attackPhase = 0;
|
||||
@@ -23,10 +26,22 @@ public class Player2 extends Actor
|
||||
long laufTimer = 0;
|
||||
boolean laeuft = false;
|
||||
int charakter;
|
||||
boolean attacking2 = false;
|
||||
String attacke1Animation;
|
||||
String attacke2Animation1;
|
||||
String attacke2Animation2;
|
||||
String defaultAnimation;
|
||||
String walk1;
|
||||
String walk2;
|
||||
String walk3;
|
||||
String walk4;
|
||||
int attack2Duration;
|
||||
int speed;
|
||||
double speedFaktor;
|
||||
double speedFaktor2;
|
||||
|
||||
Player2(int pCharakter){
|
||||
charakter = pCharakter;
|
||||
leben = 100;
|
||||
schautNachRechts = false;
|
||||
charakter();
|
||||
}
|
||||
@@ -36,142 +51,221 @@ public class Player2 extends Actor
|
||||
gravitation();
|
||||
springen();
|
||||
animation1();
|
||||
anitmationLaufen();
|
||||
animationLaufen();
|
||||
}
|
||||
|
||||
public void bewegung(){
|
||||
if(Greenfoot.isKeyDown("right")){
|
||||
if(Greenfoot.isKeyDown("l")){
|
||||
setRotation(0);
|
||||
move(5);
|
||||
move(speed);
|
||||
if(!schautNachRechts && attackPhase == 0){
|
||||
getImage().mirrorHorizontally();
|
||||
schautNachRechts = true;
|
||||
}
|
||||
laeuft = true;
|
||||
attacke();
|
||||
attacke2();
|
||||
}
|
||||
if(Greenfoot.isKeyDown("left")){
|
||||
if(Greenfoot.isKeyDown("j")){
|
||||
setRotation(0);
|
||||
move(-5);
|
||||
move(-speed);
|
||||
if(schautNachRechts && attackPhase == 0){
|
||||
getImage().mirrorHorizontally();
|
||||
schautNachRechts = false;
|
||||
}
|
||||
laeuft = true;
|
||||
attacke();
|
||||
attacke2();
|
||||
}
|
||||
}
|
||||
|
||||
public void springen(){
|
||||
if(Greenfoot.isKeyDown("up") && this.getY() > 289 ){
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean attacke(){
|
||||
if(Greenfoot.isKeyDown(".")){
|
||||
if(System.currentTimeMillis() >= c){
|
||||
|
||||
if (!attacking) {
|
||||
if(System.currentTimeMillis() >= c){
|
||||
if(Greenfoot.isKeyDown("o")){
|
||||
if (!attacking && !attacking2) {
|
||||
attacking = true;
|
||||
attackPhase = 1;
|
||||
attackTimer = System.currentTimeMillis();
|
||||
|
||||
|
||||
if(schautNachRechts){
|
||||
setImage("1Combo2.png");
|
||||
setImage(attacke1Animation);
|
||||
GreenfootImage image = getImage();
|
||||
image.scale(160, 160);
|
||||
image.scale(250, 250);
|
||||
setImage(image);
|
||||
}
|
||||
else{
|
||||
setImage("1Combo2.png");
|
||||
setImage(attacke1Animation);
|
||||
GreenfootImage image = getImage();
|
||||
image.scale(160, 160);
|
||||
image.scale(250, 250);
|
||||
setImage(image);
|
||||
getImage().mirrorHorizontally();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
c = System.currentTimeMillis() + 500;
|
||||
return true;
|
||||
c = System.currentTimeMillis() + (int)(500/speedFaktor);
|
||||
}
|
||||
else{
|
||||
return false;
|
||||
}
|
||||
if(attacking && attackPhase == 1 && System.currentTimeMillis() >= d){
|
||||
d = System.currentTimeMillis() + (int)(300/speedFaktor);
|
||||
return true;
|
||||
}
|
||||
else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean attacke2(){
|
||||
if(System.currentTimeMillis() >= c){
|
||||
if(Greenfoot.isKeyDown("u")){
|
||||
if (!attacking2 && !attacking) {
|
||||
attacking2 = true;
|
||||
attackPhase = 1;
|
||||
attackTimer = System.currentTimeMillis();
|
||||
|
||||
if(schautNachRechts){
|
||||
setImage(attacke2Animation1);
|
||||
GreenfootImage image = getImage();
|
||||
image.scale(250, 250);
|
||||
setImage(image);
|
||||
}
|
||||
else{
|
||||
setImage(attacke2Animation1);
|
||||
GreenfootImage image = getImage();
|
||||
image.scale(250, 250);
|
||||
setImage(image);
|
||||
getImage().mirrorHorizontally();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
c = System.currentTimeMillis() + (int)(800/speedFaktor);
|
||||
}
|
||||
}
|
||||
if(attacking2 && attackPhase == attack2Duration && System.currentTimeMillis() >= System.currentTimeMillis()+e){
|
||||
e = (int)(1000/speedFaktor2);
|
||||
return true;
|
||||
}
|
||||
else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void animation1(){
|
||||
if (attacking && attackPhase == 1 && System.currentTimeMillis() - attackTimer >= 200) {
|
||||
if (attacking && attackPhase == 1 && System.currentTimeMillis() - attackTimer >= (int)(200/speedFaktor)) {
|
||||
if(schautNachRechts){
|
||||
attackPhase = 2;
|
||||
setImage("2Combo1.png");
|
||||
setImage(defaultAnimation);
|
||||
GreenfootImage image = getImage();
|
||||
image.scale(160, 160);
|
||||
image.scale(250, 250);
|
||||
setImage(image);
|
||||
}
|
||||
else{
|
||||
attackPhase = 2;
|
||||
setImage("2Combo1.png");
|
||||
setImage(defaultAnimation);
|
||||
GreenfootImage image = getImage();
|
||||
image.scale(160, 160);
|
||||
image.scale(250, 250);
|
||||
setImage(image);
|
||||
getImage().mirrorHorizontally();
|
||||
}
|
||||
}
|
||||
if (attacking && attackPhase == 2 && System.currentTimeMillis() - attackTimer >= 300) {
|
||||
if (attacking && attackPhase == 2 && System.currentTimeMillis() - attackTimer >= (int)(500/speedFaktor)) {
|
||||
attacking = false;
|
||||
attackPhase = 0;
|
||||
d = 0;
|
||||
}
|
||||
if (attacking2 && attackPhase == 1 && System.currentTimeMillis() - attackTimer >= (int)(550/speedFaktor2)) {
|
||||
if(schautNachRechts){
|
||||
attackPhase = 2;
|
||||
setImage(attacke2Animation2);
|
||||
GreenfootImage image = getImage();
|
||||
image.scale(250, 250);
|
||||
setImage(image);
|
||||
}
|
||||
else{
|
||||
attackPhase = 2;
|
||||
setImage(attacke2Animation2);
|
||||
GreenfootImage image = getImage();
|
||||
image.scale(250, 250);
|
||||
setImage(image);
|
||||
getImage().mirrorHorizontally();
|
||||
}
|
||||
}
|
||||
if (attacking2 && attackPhase == 2 && System.currentTimeMillis() - attackTimer >= (int)(800/speedFaktor2)) {
|
||||
attacking2 = false;
|
||||
attackPhase = 0;
|
||||
e = 0;
|
||||
if(schautNachRechts){
|
||||
setImage(defaultAnimation);
|
||||
GreenfootImage image = getImage();
|
||||
image.scale(250, 250);
|
||||
setImage(image);
|
||||
}
|
||||
else{
|
||||
setImage(defaultAnimation);
|
||||
GreenfootImage image = getImage();
|
||||
image.scale(250, 250);
|
||||
setImage(image);
|
||||
getImage().mirrorHorizontally();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void anitmationLaufen(){
|
||||
if(laeuft){
|
||||
public void animationLaufen(){
|
||||
if(laeuft &! attacking &! attacking2){
|
||||
if(schautNachRechts){
|
||||
if(laufPhase == 0){
|
||||
setImage("RenRun1.png");
|
||||
setImage(walk1);
|
||||
GreenfootImage image = getImage();
|
||||
image.scale(160, 160);
|
||||
image.scale(250, 250);
|
||||
setImage(image);
|
||||
laufPhase = 1;
|
||||
laufTimer = System.currentTimeMillis();
|
||||
}
|
||||
if(laufPhase == 1 && System.currentTimeMillis() - laufTimer >= 100){
|
||||
setImage("RenRun2.png");
|
||||
if(laufPhase == 1 && System.currentTimeMillis() - laufTimer >= 200){
|
||||
setImage(walk2);
|
||||
GreenfootImage image = getImage();
|
||||
image.scale(160, 160);
|
||||
image.scale(250, 250);
|
||||
setImage(image);
|
||||
laufPhase = 2;
|
||||
laufTimer = System.currentTimeMillis();
|
||||
}
|
||||
if(laufPhase == 2 && System.currentTimeMillis() - laufTimer >= 100){
|
||||
setImage("RenRun3.png");
|
||||
if(laufPhase == 2 && System.currentTimeMillis() - laufTimer >= 200){
|
||||
setImage(walk3);
|
||||
GreenfootImage image = getImage();
|
||||
image.scale(160, 160);
|
||||
image.scale(250, 250);
|
||||
setImage(image);
|
||||
laufPhase = 3;
|
||||
laufTimer = System.currentTimeMillis();
|
||||
}
|
||||
if(laufPhase == 3 && System.currentTimeMillis() - laufTimer >= 100){
|
||||
setImage("RenRun4.png");
|
||||
if(laufPhase == 3 && System.currentTimeMillis() - laufTimer >= 200){
|
||||
setImage(walk4);
|
||||
GreenfootImage image = getImage();
|
||||
image.scale(160, 160);
|
||||
image.scale(250, 250);
|
||||
setImage(image);
|
||||
laufPhase = 4;
|
||||
laufTimer = System.currentTimeMillis();
|
||||
}
|
||||
if(laufPhase == 4 && System.currentTimeMillis() - laufTimer >= 100){
|
||||
setImage("2Combo1.png");
|
||||
if(laufPhase == 4 && System.currentTimeMillis() - laufTimer >= 200){
|
||||
setImage(defaultAnimation);
|
||||
GreenfootImage image = getImage();
|
||||
image.scale(160, 160);
|
||||
image.scale(250, 250);
|
||||
setImage(image);
|
||||
laufPhase = 0;
|
||||
laufTimer = System.currentTimeMillis();
|
||||
@@ -180,45 +274,45 @@ public class Player2 extends Actor
|
||||
}
|
||||
else{
|
||||
if(laufPhase == 0){
|
||||
setImage("RenRun1.png");
|
||||
setImage(walk1);
|
||||
GreenfootImage image = getImage();
|
||||
image.scale(160, 160);
|
||||
image.scale(250, 250);
|
||||
setImage(image);
|
||||
getImage().mirrorHorizontally();
|
||||
laufPhase = 1;
|
||||
laufTimer = System.currentTimeMillis();
|
||||
}
|
||||
if(laufPhase == 1 && System.currentTimeMillis() - laufTimer >= 100){
|
||||
setImage("RenRun2.png");
|
||||
if(laufPhase == 1 && System.currentTimeMillis() - laufTimer >= 200){
|
||||
setImage(walk2);
|
||||
GreenfootImage image = getImage();
|
||||
image.scale(160, 160);
|
||||
image.scale(250, 250);
|
||||
setImage(image);
|
||||
getImage().mirrorHorizontally();
|
||||
laufPhase = 2;
|
||||
laufTimer = System.currentTimeMillis();
|
||||
}
|
||||
if(laufPhase == 2 && System.currentTimeMillis() - laufTimer >= 100){
|
||||
setImage("RenRun3.png");
|
||||
if(laufPhase == 2 && System.currentTimeMillis() - laufTimer >= 200){
|
||||
setImage(walk3);
|
||||
GreenfootImage image = getImage();
|
||||
image.scale(160, 160);
|
||||
image.scale(250, 250);
|
||||
setImage(image);
|
||||
getImage().mirrorHorizontally();
|
||||
laufPhase = 3;
|
||||
laufTimer = System.currentTimeMillis();
|
||||
}
|
||||
if(laufPhase == 3 && System.currentTimeMillis() - laufTimer >= 100){
|
||||
setImage("RenRun4.png");
|
||||
if(laufPhase == 3 && System.currentTimeMillis() - laufTimer >= 200){
|
||||
setImage(walk4);
|
||||
GreenfootImage image = getImage();
|
||||
image.scale(160, 160);
|
||||
image.scale(250, 250);
|
||||
setImage(image);
|
||||
getImage().mirrorHorizontally();
|
||||
laufPhase = 4;
|
||||
laufTimer = System.currentTimeMillis();
|
||||
}
|
||||
if(laufPhase == 4 && System.currentTimeMillis() - laufTimer >= 100){
|
||||
setImage("2Combo1.png");
|
||||
if(laufPhase == 4 && System.currentTimeMillis() - laufTimer >= 200){
|
||||
setImage(defaultAnimation);
|
||||
GreenfootImage image = getImage();
|
||||
image.scale(160, 160);
|
||||
image.scale(250, 250);
|
||||
setImage(image);
|
||||
getImage().mirrorHorizontally();
|
||||
laufPhase = 0;
|
||||
@@ -240,12 +334,57 @@ public class Player2 extends Actor
|
||||
|
||||
public void charakter(){
|
||||
if(charakter == 1){
|
||||
setImage("2Combo1.png");
|
||||
GreenfootImage image = getImage();
|
||||
image.scale(160,160);
|
||||
setImage(image);
|
||||
getImage().mirrorHorizontally();
|
||||
defaultAnimation = "2Combo1.png";
|
||||
attacke1Animation = "1Combo2.png";
|
||||
attacke2Animation1 = "3Combo2.png";
|
||||
attacke2Animation2 = defaultAnimation;
|
||||
walk1 = "RenRun1.png";
|
||||
walk2 = "RenRun2.png";
|
||||
walk3 = "RenRun3.png";
|
||||
walk4 = "RenRun4.png";
|
||||
attack2Duration = 1;
|
||||
speed = 6;
|
||||
maxLeben = 100;
|
||||
leben = maxLeben;
|
||||
speedFaktor = 1;
|
||||
speedFaktor2 = speedFaktor;
|
||||
}
|
||||
|
||||
if(charakter == 2){
|
||||
defaultAnimation = "Tetsu1Combo1.png";
|
||||
attacke1Animation = "Tetsu1Combo2.png";
|
||||
attacke2Animation1 = "Tetsu3Combo1.png";
|
||||
attacke2Animation2 = "Tetsu3Combo2.png";
|
||||
walk1 = "TetsuRun1.png";
|
||||
walk2 = "TetsuRun2.png";
|
||||
walk3 = "TetsuRun3.png";
|
||||
walk4 = "TetsuRun4.png";
|
||||
attack2Duration = 2;
|
||||
speed = 4;
|
||||
maxLeben = 130;
|
||||
leben = maxLeben;
|
||||
speedFaktor = 0.5;
|
||||
speedFaktor2 = 0.75;
|
||||
}
|
||||
if(charakter == 3){
|
||||
defaultAnimation = "HinataShoot1.png";
|
||||
attacke1Animation = "Hinata2Combo1.png";
|
||||
attacke2Animation1 = "Hinata3Combo1.png";
|
||||
attacke2Animation2 = defaultAnimation;
|
||||
walk1 = "HinataRun1.png";
|
||||
walk2 = "HinataRun2.png";
|
||||
walk3 = "HinataRun3.png";
|
||||
walk4 = "HinataRun4.png";
|
||||
attack2Duration = 1;
|
||||
speed = 8;
|
||||
maxLeben = 80;
|
||||
leben = maxLeben;
|
||||
speedFaktor = 2;
|
||||
speedFaktor2 = 8;
|
||||
}
|
||||
setImage(defaultAnimation);
|
||||
GreenfootImage image = getImage();
|
||||
image.scale(250,250);
|
||||
setImage(image);
|
||||
getImage().mirrorHorizontally();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,34 +3,47 @@ class.Lebensanzeige.image=Lebensanzeige.png
|
||||
class.MyWorld.image=IMG_7841.png
|
||||
class.Player1.image=man01.png
|
||||
class.Player2.image=man01.png
|
||||
class.StartWorld.image=HomeScreen.png
|
||||
dependency1.from=EndWorld
|
||||
dependency1.to=StartWorld
|
||||
dependency1.to=MenuWorld
|
||||
dependency1.type=UsesDependency
|
||||
dependency10.from=MyWorld
|
||||
dependency10.to=Picture
|
||||
dependency10.type=UsesDependency
|
||||
dependency11.from=MyWorld
|
||||
dependency11.to=EndWorld
|
||||
dependency11.type=UsesDependency
|
||||
dependency2.from=StartWorld
|
||||
dependency2.to=Pfeil
|
||||
dependency2.to=Picture
|
||||
dependency2.type=UsesDependency
|
||||
dependency3.from=StartWorld
|
||||
dependency3.to=MyWorld
|
||||
dependency3.to=MenuWorld
|
||||
dependency3.type=UsesDependency
|
||||
dependency4.from=MyWorld
|
||||
dependency4.to=Player1
|
||||
dependency4.from=MenuWorld
|
||||
dependency4.to=Pfeil
|
||||
dependency4.type=UsesDependency
|
||||
dependency5.from=MyWorld
|
||||
dependency5.to=Player2
|
||||
dependency5.from=MenuWorld
|
||||
dependency5.to=Picture
|
||||
dependency5.type=UsesDependency
|
||||
dependency6.from=MyWorld
|
||||
dependency6.to=Lebensanzeige
|
||||
dependency6.from=MenuWorld
|
||||
dependency6.to=MyWorld
|
||||
dependency6.type=UsesDependency
|
||||
dependency7.from=MyWorld
|
||||
dependency7.to=EndWorld
|
||||
dependency7.to=Player1
|
||||
dependency7.type=UsesDependency
|
||||
editor.fx.0.height=686
|
||||
editor.fx.0.width=1294
|
||||
editor.fx.0.x=-7
|
||||
editor.fx.0.y=-7
|
||||
dependency8.from=MyWorld
|
||||
dependency8.to=Player2
|
||||
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=7
|
||||
package.numTargets=7
|
||||
package.numDependencies=11
|
||||
package.numTargets=9
|
||||
project.charset=UTF-8
|
||||
publish.hasSource=false
|
||||
publish.locked=true
|
||||
@@ -60,40 +73,54 @@ target2.width=120
|
||||
target2.x=0
|
||||
target2.y=0
|
||||
target3.height=70
|
||||
target3.name=Lebensanzeige
|
||||
target3.name=Picture
|
||||
target3.showInterface=false
|
||||
target3.type=ClassTarget
|
||||
target3.width=120
|
||||
target3.x=0
|
||||
target3.y=0
|
||||
target4.height=70
|
||||
target4.name=StartWorld
|
||||
target4.name=Lebensanzeige
|
||||
target4.showInterface=false
|
||||
target4.type=ClassTarget
|
||||
target4.width=120
|
||||
target4.x=0
|
||||
target4.y=0
|
||||
target5.height=70
|
||||
target5.name=Player2
|
||||
target5.name=StartWorld
|
||||
target5.showInterface=false
|
||||
target5.type=ClassTarget
|
||||
target5.width=120
|
||||
target5.x=0
|
||||
target5.y=0
|
||||
target6.height=70
|
||||
target6.name=Player1
|
||||
target6.name=Player2
|
||||
target6.showInterface=false
|
||||
target6.type=ClassTarget
|
||||
target6.width=120
|
||||
target6.x=0
|
||||
target6.y=0
|
||||
target7.height=70
|
||||
target7.name=MyWorld
|
||||
target7.name=Player1
|
||||
target7.showInterface=false
|
||||
target7.type=ClassTarget
|
||||
target7.width=120
|
||||
target7.x=0
|
||||
target7.y=0
|
||||
target8.height=70
|
||||
target8.name=MenuWorld
|
||||
target8.showInterface=false
|
||||
target8.type=ClassTarget
|
||||
target8.width=120
|
||||
target8.x=0
|
||||
target8.y=0
|
||||
target9.height=70
|
||||
target9.name=MyWorld
|
||||
target9.showInterface=false
|
||||
target9.type=ClassTarget
|
||||
target9.width=120
|
||||
target9.x=0
|
||||
target9.y=0
|
||||
version=3.1.0
|
||||
width=1294
|
||||
world.lastInstantiated=StartWorld
|
||||
|
||||