Add files via upload

master
4ngelica 9 years ago committed by GitHub
parent 6ddaff7195
commit ec24addc3b

Binary file not shown.

@ -0,0 +1,9 @@
#BlueJ class context
comment0.target=Colours
comment0.text=\r\n\ Write\ a\ description\ of\ class\ Colours\ here.\r\n\ \r\n\ @author\ (your\ name)\ \r\n\ @version\ (a\ version\ number\ or\ a\ date)\r\n
comment1.params=
comment1.target=Colours()
comment1.text=\r\n\ Constructor\ for\ objects\ of\ class\ Colours.\r\n\ \r\n
comment2.params=b
comment2.target=void\ buttonClicked(Button)
numComments=3

@ -0,0 +1,108 @@
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class Colours here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Colours extends World implements ButtonEvent
{
Button schwarz = new Button ("Schwarz", 16, this);
Button blau = new Button ("Blau", 16, this);
Button grün = new Button ("Grün", 16, this);
Button rot = new Button ("Rot", 16, this);
Button lila = new Button ("Lila", 16, this);
Button gelb = new Button ("Gelb", 16, this);
Button weiter = new Button ("Weiter", 16, this);
int [] colour = new int [6];
String [] pn = new String [6];
int x;
boolean possw = true;
boolean posbl = true;
boolean posgr = true;
boolean posrt = true;
boolean posgb = true;
boolean posli = true;
int sw = 1;
int bl = 2;
int gr = 3;
int rt = 4;
int gb = 5;
int li = 6;
/**
* Constructor for objects of class Colours.
*
*/
public Colours()
{
super(1600, 900, 1);
addObject(schwarz, 10, 10);
addObject ( blau, 25, 10);
addObject ( grün, 40, 10);
addObject ( rot, 55, 10);
addObject(gelb, 70, 10);
addObject(lila, 85, 10);
}
// Überprüft, ob ein Farbbutton geklickt wurde
//Überprüft, ob die Farbe noch nicht ausgewählt wurde
// Wenn alle Bedingungen erfüllt wurden:
// Setzt die aktuelle Stelle des Farbarrays gleich der Zahl der aktuellen Farbe
// erhöht die Variable zum Durchzählen um eins
// verhindert durch falschsetzten einer Variable die Wiederauswahl einer Farbe
// wenn Weiter geklickt wurde und x größer 1 ist wird eine neue Welt Map erzeugt,
//der per Konstruktor die Daten der Colorklasse übertragen werden, dannach wird die Map die aktive Welt
public void buttonClicked (Button b)
{
if ( b == schwarz && possw == true)
{
colour [x] = sw;
pn[x]="Schwarz";
x+=1;
possw = false;
}
if (b == blau && posbl == true)
{
colour[x] = bl;
pn[x] = "Blau";
x+=1;
posbl = false;
}
if (b == grün && posgr == true )
{
colour[x] = gr;
pn[x]="Grün";
x+=1;
posgr = false;
}
if ( b == rot && posrt == true)
{
colour[x] = rt;
pn[x]="Rot";
x+=1;
posrt = false;
}
if ( b == gelb && posgb == true)
{
colour [x] = gb;
pn[x]="Gelb";
x+=1;
posgb = false;
}
if ( b == lila && posli == true)
{
colour [x] = li;
pn[x]="Lila";
x+=1;
posli = false;
}
if ( b == weiter && x >1)
{
Map m = new Map(colour, x, pn);
//setWorld(m);
}
}
}

Binary file not shown.

@ -0,0 +1,31 @@
#BlueJ class context
comment0.target=GeneralMap
comment0.text=\r\n\tOberklasse\ f\u00FCr\ verschiedene\ Maps;\r\n\tneue\ Maps\ werden\ als\ Unterklasse\ dieser\ Klasse\ eingef\u00FCgt.\r\n\r\n\t@author\ GruenerWal,\ MaxiJohl,\ Felix\ Stupp\r\n\t@version\ 0.3.0\r\n
comment1.params=backImage\ playerList\ colorList
comment1.target=GeneralMap(java.lang.String,\ java.lang.String[],\ int[])
comment1.text=\r\n\t\tErstellt\ eine\ GeneralMap\ mit\ allen\ Eigenschaften\ und\ initialisiert\ die\ Arrays\ f\u00FCr\ Provinzen\ und\ Spieler.\r\n\t\t@param\ backImage\ Das\ Hintergrundbild,\ welches\ von\ dieser\ Klasse\ geladen\ und\ dargestellt\ wird.\r\n\t\t@param\ playerList\ Die\ Liste\ mit\ den\ Namen\ der\ Spieler\r\n\t\t@param\ colorList\ Die\ Liste\ mit\ den\ Farben\ der\ Spieler\r\n
comment2.params=
comment2.target=void\ initProvinces()
comment2.text=\r\n\t\tF\u00FCgt\ alle\ Provinzen\ aus\ dem\ Array\ der\ Welt\ an\ der\ entsprechden\ Stelle\ zu.\r\n
comment3.params=
comment3.target=int\ getPlayerCount()
comment3.text=\r\n\t\tGibt\ die\ Anzahl\ der\ vorhandenen\ Spieler\ aus.\r\n
comment4.params=
comment4.target=java.lang.String\ getPlayerName()
comment4.text=\r\n\t\tGibt\ den\ Namen\ des\ aktuellen\ Spielers\ aus.\r\n\t\t@return\ Der\ Name\ des\ aktuellen\ Spielers\r\n
comment5.params=plID
comment5.target=java.lang.String\ getPlayerName(int)
comment5.text=\r\n\t\tGibt\ den\ Namen\ des\ Spielers\ aus,\ dem\ dessen\ ID\ geh\u00F6rt.\r\n\t\t@param\ plID\ Die\ ID\ des\ zu\ findenden\ Spielers\r\n\t\t@return\ Der\ Name\ des\ Spielers\r\n
comment6.params=
comment6.target=int\ getPlayerStars()
comment6.text=\r\n\t\tGibt\ die\ Anzahl\ der\ Sterne\ des\ aktuellen\ Spielers\ zur\u00FCck.\r\n\t\t@return\ Die\ Anzahl\ der\ Sterne\ des\ aktuellen\ Spielers\r\n
comment7.params=prID
comment7.target=int\ getProvinceOwner(int)
comment7.text=\r\n\t\tGibt\ die\ ID\ des\ Spielers\ zur\u00FCck,\ dem\ die\ gefragte\ Provinz\ geh\u00F6rt.\r\n\t\t@param\ prID\ Die\ gefragte\ Provinz\r\n
comment8.params=
comment8.target=int[]\ getProvinceOwners()
comment8.text=\r\n\t\tGibt\ eine\ Liste\ mit\ allen\ Provinzen\ und\ deren\ Besitzern\ zur\u00FCck.\r\n\t\t@return\ Array\ mit\ der\ Provinz-ID\ als\ Index\ und\ dem\ Besitzer\ als\ Wert\r\n
comment9.params=playerID
comment9.target=int\ getProvinceEntityCount(int)
comment9.text=\r\n\t\tZ\u00E4hlt\ die\ Anzahl\ der\ Einheiten\ von\ allen\ Provinzen\ zusammen,\ die\ einem\ bestimmten\ Spieler\ geh\u00F6rt.\r\n\t\t@param\ playerID\ Die\ ID\ des\ Spielers,\ f\u00FCr\ den\ die\ Einheiten\ gez\u00E4hlt\ werden\ sollen.\r\n\t\t@return\ Die\ Anzahl\ der\ Einheiten,\ die\ dem\ Spieler\ geh\u00F6ren.\r\n
numComments=10

Binary file not shown.

@ -0,0 +1,8 @@
#BlueJ class context
comment0.target=Map
comment0.text=\r\n\ Write\ a\ description\ of\ class\ Map\ here.\r\n\ \r\n\ @author\ (your\ name)\ \r\n\ @version\ (a\ version\ number\ or\ a\ date)\r\n
comment1.params=bunt\ zahl\ name
comment1.target=Map(int[],\ int,\ java.lang.String[])
comment2.params=b
comment2.target=void\ buttonClicked(Button)
numComments=3

@ -6,25 +6,27 @@ import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
* @author (your name)
* @version (a version number or a date)
*/
public class Map extends Spielstart
public class Map implements ButtonEvent
{
private Button map1 = new Button ("map1",16,this);
private Button map2 = new Button ("map2",16,this);
private Button fertigst = new Button (" Fertigstellen",16,this);
int [] color = new int[6];
int [] colour = new int[6];
String [] pn = new String [6];
int pnu;
//private int x;
//private int y;
private int m=0;
private GeneralMap GM ;
public Map( int [] bunt, int zahl , String [] name)
{
super(1600, 900, 1);
for (int i=0; i<6; i++)
{
color[x] = bunt[x];
pn[x] = name[x];
colour[i] = bunt[i];
pn[i] = name[i];
}
pnu = zahl;
addObject(map1, (1600-map1.getWidth())/2, (900-map1.getHeight())/2);
@ -48,7 +50,7 @@ public class Map extends Spielstart
}
if (b == fertigst)
{
new GeneralMap (color, pnu, pn, m);
//new GeneralMap(colour, pnu, pn, m);
Greenfoot.setWorld(GM);
}
}

Binary file not shown.

@ -0,0 +1,7 @@
#BlueJ class context
comment0.target=Map_World
comment0.text=\r\n\tKlasse\ der\ Standard-Welt\r\n\t(Also\ die\ normale\ Weltkarte\ mit\ allen\ Kontinenten)\r\n\r\n\t@author\ GruenerWal,\ MaxiJohl\r\n\t@version\ 0.3.0\r\n
comment1.params=playerList\ colorList
comment1.target=Map_World(java.lang.String[],\ int[])
comment1.text=\ \r\n\t\tKonstruktor\ der\ Weltkarte;\r\n\t\tkonstruiert\ eine\ GeneralMap\ mit\ den\ Ausmassen\ 1600\ auf\ 900\ Pixel.\r\n
numComments=2

@ -21,9 +21,9 @@ public class Map_World extends GeneralMap
konstruiert eine GeneralMap mit den Ausmassen 1600 auf 900 Pixel.
*/
public Map_World(String[] playerList, int[] colorList)
public Map_World(String[] playerList, int[] colourList)
{
super("",playerList,colorList);
super("",playerList,colourList);
/*
Hier werden später sämtliche Provinzen der Standard-Map erstellt.
Dies funktioniert folgendermassen:

Binary file not shown.

@ -0,0 +1,11 @@
#BlueJ class context
comment0.target=Start_Load
comment0.text=\r\n\ Beginnt\ neues\ Spiel/\ l\u00E4dt\ altes\ Spiel.\r\n\ \r\n\ @author\ 4ngelica\ \r\n\ @version\ 1.0\r\n
comment1.params=
comment1.target=Start_Load()
comment1.text=\r\n\ Constructor\ for\ objects\ of\ class\ Start_Load.\r\n\ \r\n
comment2.params=b
comment2.target=void\ buttonClicked(Button)
comment3.params=
comment3.target=void\ Load()
numComments=4

@ -6,26 +6,29 @@ import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
* @author 4ngelica
* @version 1.0
*/
public class Start_Load extends World
public class Start_Load extends World implements ButtonEvent
{
Button start = new Button ("new game", 16, this);
/**
* Constructor for objects of class Start_Load.
*
*/
public Start_Load()
{
// Create a new world with 600x400 cells with a cell size of 1x1 pixels.
super(600, 400, 1);
super(1600, 900, 1);
addObject (start, 800, 450);
}
public void NewGame()
public void buttonClicked (Button b)
{
if (Greenfoot.mouseClicked(this))
{
addObject (new Start_Button());
Greenfoot.setWorld(new Colours());
}
}
public void Load()
public void Load() //hat noch keine Funktion
{
}

@ -2,15 +2,18 @@
class.ArmySchubser.superclass=Map_World
class.Button.superclass=GUI_Interface
class.ButtonEvent.superclass=
class.Colours.superclass=greenfoot.World
class.CurrentPlayerArrow.superclass=GUI_Interface
class.DefenderDices.superclass=DicesList
class.Dice.superclass=GUI_Interface
class.Dice_Defender.superclass=Dice
class.Dice_Offender.superclass=Dice
class.DicesList.superclass=greenfoot.Actor
class.Fight.superclass=Map_World
class.GUI_Interface.superclass=greenfoot.Actor
class.GeneralMap.superclass=greenfoot.World
class.Label.superclass=GUI_Interface
class.Map.superclass=
class.Map_World.superclass=GeneralMap
class.Menue_Button.superclass=Button
class.OffenderDices.superclass=DicesList
@ -19,7 +22,6 @@ class.Province.superclass=greenfoot.Actor
class.Roll_Button.superclass=Button
class.Spieleranzahl.superclass=Spieloptionen
class.Spieloptionen.superclass=greenfoot.World
class.Start_Button.superclass=Button
class.Start_Load.superclass=greenfoot.World
class.Utils.superclass=
class.Weltenauswahl.superclass=Spieloptionen
@ -50,15 +52,42 @@ dependency16.type=UsesDependency
dependency17.from=Start_Load
dependency17.to=ButtonEvent
dependency17.type=UsesDependency
dependency18.from=Start_Button
dependency18.to=ButtonEvent
dependency18.from=Colours
dependency18.to=Button
dependency18.type=UsesDependency
dependency19.from=Start_Load
dependency19.to=Start_Button
dependency19.from=Colours
dependency19.to=Map
dependency19.type=UsesDependency
dependency2.from=GeneralMap
dependency2.to=Menue_Button
dependency2.type=UsesDependency
dependency20.from=Fight
dependency20.to=Province
dependency20.type=UsesDependency
dependency21.from=Fight
dependency21.to=Dice_Offender
dependency21.type=UsesDependency
dependency22.from=Fight
dependency22.to=Dice_Defender
dependency22.type=UsesDependency
dependency23.from=Map
dependency23.to=Button
dependency23.type=UsesDependency
dependency24.from=Map
dependency24.to=GeneralMap
dependency24.type=UsesDependency
dependency25.from=Colours
dependency25.to=Map_World
dependency25.type=UsesDependency
dependency26.from=Start_Load
dependency26.to=Colours
dependency26.type=UsesDependency
dependency27.from=Map
dependency27.to=GeneralMap
dependency27.type=UsesDependency
dependency28.from=Colours
dependency28.to=Map_World
dependency28.type=UsesDependency
dependency3.from=GeneralMap
dependency3.to=Roll_Button
dependency3.type=UsesDependency
@ -85,15 +114,15 @@ editor.fx.0.width=700
editor.fx.0.x=0
editor.fx.0.y=0
editor.swing.0.height=700
editor.swing.0.width=700
editor.swing.0.width=701
editor.swing.0.x=78
editor.swing.0.y=0
mainWindow.height=744
mainWindow.width=1382
mainWindow.width=1375
mainWindow.x=-8
mainWindow.y=-8
package.numDependencies=19
package.numTargets=20
mainWindow.y=0
package.numDependencies=26
package.numTargets=22
project.charset=UTF-8
readme.height=58
readme.name=@README
@ -109,77 +138,77 @@ target1.width=80
target1.x=120
target1.y=10
target10.height=50
target10.name=Dice_Defender
target10.name=DefenderDices
target10.showInterface=false
target10.type=ClassTarget
target10.typeParameters=
target10.width=110
target10.x=10
target10.y=310
target10.y=490
target11.height=50
target11.name=DefenderDices
target11.name=Province
target11.showInterface=false
target11.type=ClassTarget
target11.typeParameters=
target11.width=110
target11.x=10
target11.y=490
target11.width=80
target11.x=130
target11.y=310
target12.height=50
target12.name=Province
target12.name=GeneralMap
target12.showInterface=false
target12.type=ClassTarget
target12.type=AbstractTarget
target12.typeParameters=
target12.width=80
target12.x=130
target12.y=310
target12.width=90
target12.x=70
target12.y=70
target13.height=50
target13.name=GeneralMap
target13.name=Map_World
target13.showInterface=false
target13.type=AbstractTarget
target13.type=ClassTarget
target13.typeParameters=
target13.width=90
target13.x=70
target13.x=170
target13.y=70
target14.height=50
target14.name=Map_World
target14.name=Button
target14.showInterface=false
target14.type=ClassTarget
target14.typeParameters=
target14.width=90
target14.x=170
target14.y=70
target14.width=80
target14.x=10
target14.y=130
target15.height=50
target15.name=Button
target15.name=ButtonEvent
target15.showInterface=false
target15.type=ClassTarget
target15.type=InterfaceTarget
target15.typeParameters=
target15.width=80
target15.x=10
target15.y=130
target15.width=90
target15.x=130
target15.y=490
target16.height=50
target16.name=ButtonEvent
target16.name=Dice_Offender
target16.showInterface=false
target16.type=InterfaceTarget
target16.type=ClassTarget
target16.typeParameters=
target16.width=90
target16.x=130
target16.y=490
target16.width=110
target16.x=100
target16.y=130
target17.height=50
target17.name=Dice_Offender
target17.name=Utils
target17.showInterface=false
target17.type=ClassTarget
target17.typeParameters=
target17.width=110
target17.x=100
target17.y=130
target17.width=80
target17.x=10
target17.y=190
target18.height=50
target18.name=Utils
target18.name=Colours
target18.showInterface=false
target18.type=ClassTarget
target18.typeParameters=
target18.width=80
target18.x=10
target18.y=190
target18.y=610
target19.height=50
target19.name=Start_Load
target19.showInterface=false
@ -204,6 +233,30 @@ target20.typeParameters=
target20.width=90
target20.x=190
target20.y=190
target21.height=50
target21.name=Fight
target21.showInterface=false
target21.type=ClassTarget
target21.typeParameters=
target21.width=80
target21.x=100
target21.y=610
target22.height=50
target22.name=Map
target22.showInterface=false
target22.type=ClassTarget
target22.typeParameters=
target22.width=80
target22.x=190
target22.y=610
target23.height=50
target23.name=Map
target23.showInterface=false
target23.type=ClassTarget
target23.typeParameters=
target23.width=80
target23.x=190
target23.y=610
target3.height=50
target3.name=GUI_Interface
target3.showInterface=false
@ -253,12 +306,12 @@ target8.width=110
target8.x=100
target8.y=430
target9.height=50
target9.name=Start_Button
target9.name=Dice_Defender
target9.showInterface=false
target9.type=ClassTarget
target9.typeParameters=
target9.width=100
target9.x=110
target9.y=550
target9.width=110
target9.x=10
target9.y=310
version=2.8.0
world.lastInstantiated=Map_World

Loading…
Cancel
Save