Merge pull request #89 from HGE-IT-Course-2016/Spielanleitung

Spielanleitung
pull/92/head^2
Felix Stupp 8 years ago committed by GitHub
commit a9b9397885

Binary file not shown.

Binary file not shown.

@ -0,0 +1,20 @@
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class Spielanleitung here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Spielanleitung extends Actor
{
public void act()
{
setImage ("Spielanleitung.png");
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 KiB

Binary file not shown.

@ -4,7 +4,7 @@ import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
* Beginnt neues Spiel/ lädt altes Spiel. * Beginnt neues Spiel/ lädt altes Spiel.
* *
* @author 4ngelica * @author 4ngelica
* @version 1.0 * @version 04.07.16
*/ */
public class Start_Load extends World implements ButtonEvent public class Start_Load extends World implements ButtonEvent
{ {
@ -13,7 +13,8 @@ public class Start_Load extends World implements ButtonEvent
// Dark Theme: "backgroundDark.png" // Dark Theme: "backgroundDark.png"
Button chulien = new Button("Neues Spiel", 16 , this); Button chulien = new Button("Neues Spiel", 16 , this);
Button spielanleitung = new Button("Spielanleitung", 16, this);
Button zurück = new Button("zurück", 16, this);
/** /**
* Constructor for objects of class Start_Load. * Constructor for objects of class Start_Load.
* *
@ -24,17 +25,32 @@ public class Start_Load extends World implements ButtonEvent
super(1600, 900, 1); super(1600, 900, 1);
setBackground(backgroundImage); setBackground(backgroundImage);
chulien.setSize(100,50); chulien.setSize(100,50);
addObject (chulien, (1600-chulien.getWidth())/2, (900-chulien.getHeight())/2); spielanleitung.setSize(100,50);
zurück.setSize(100,50);
addObject (chulien, (1600-chulien.getWidth())/2+100, (900-chulien.getHeight())/2);
addObject (spielanleitung, (1600-spielanleitung.getWidth())/2+100, (900-spielanleitung.getHeight())/2 + 80);
} }
public void buttonClicked ( Button b) public void buttonClicked ( Button b)
{ {
if ( b == chulien) if ( b == chulien)
{ {
World chean = new Colours (1600, 900, 1); World chean = new Colours (1600, 900, 1);
Greenfoot.setWorld(chean); Greenfoot.setWorld(chean);
} }
if (b == spielanleitung)
{
addObject (new Spielanleitung(), 800, 410);
addObject (zurück, 800 , 870);
}
if (b == zurück)
{
removeObjects(getObjects(Spielanleitung.class));
removeObject(zurück);
}
} }

Loading…
Cancel
Save