Ejemplo n.º 1
0
 public Renderer(Map map ,Graphics g,Gamescreen screen,Label label1)
 {
     this.first = map;
     this.g = g;
     this.screen = screen;
     this.brush = new TextureBrush(first.files.menuBrush,WrapMode.TileFlipXY);
     this.brush1= new SolidBrush(Color.PaleVioletRed);
     this.brush2 = new SolidBrush(Color.PaleGreen);
     this.ran = new Random();
     this.pointsplayer1 = first.player1.collectedItems.ToString();
     this.pointsplayer2 = first.player2.collectedItems.ToString();
     this.Action = label1.Text;
 }
Ejemplo n.º 2
0
        public Form1(int size, int p1, int p2, int hmi, String wB)
        {
            whoBegins = wB;

            mapSize = size;
            InitializeComponent();
            first = new Map(size,hmi,p1,p2);

            screen = new Gamescreen(first, this);
            first.fillMap();
            first.addPropToMap(first);
            //Fenster wird auto Maximiert
            this.DoubleBuffered = true;                                     //Reduziert flimmern hierdurch kann allerdings nur im on_paint event gezeichnet werden
            this.AllowDrop = true;											//für Drag and Drop bin mir aber nicht sicher ob es Programmintern überhaupt gebraucht wird
            p = new Point(screen.ExchangeCard.X, screen.ExchangeCard.Y);
            WindowState = FormWindowState.Maximized;

            pathMoving = false;
        }
Ejemplo n.º 3
0
 public void setPositionPixel(Gamescreen screen)
 {
     int xPosMap = (positionMap.X * screen.MapPointSize) + screen.MapPosition.X + (screen.MapPointSize / 2) - (this.getPlayerSize(screen) / 2);
     int yPosMap = (positionMap.Y * screen.MapPointSize) + screen.MapPosition.Y + (screen.MapPointSize / 2) - (this.getPlayerSize(screen) / 2 + this.getPlayerSize(screen) / 4);
     positionPixel = new Point(xPosMap, yPosMap);
 }
Ejemplo n.º 4
0
 public int getPlayerSize(Gamescreen screen)
 {
     return screen.MapPointSize / 2;
 }
Ejemplo n.º 5
0
        //Geht vom Spielfeld aus .X=0 und .Y=0 oberstes linkes Feld
        public Point getMapPosition(Gamescreen screen)
        {
            int x = (positionPixel.X - screen.MapPosition.X) / screen.MapPointSize;
            int y = (positionPixel.Y - screen.MapPosition.Y) / screen.MapPointSize;

            positionMap = new Point(x, y);
            return positionMap;
        }
Ejemplo n.º 6
0
        private void Form1_Resize(object sender, EventArgs e)
        {
            screen = new Gamescreen(first, this);
            first.player1.setPositionPixel(screen);
            first.player2.setPositionPixel(screen);

            Refresh();
        }