Files
@@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
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 |