public Gamescreen(Map first,Form form1) { this.first = first; //Size s = SystemInformation.w; ; ScreenHight = form1.ClientSize.Height; ScreenWidth = form1.ClientSize.Width; UserMenu = new Rectangle(ScreenWidth - ScreenWidth / 4, 0, ScreenWidth - (ScreenWidth - ScreenWidth / 4), ScreenHight); //UserMenuSize = new Point(s.Height, s.Width); //= new Point(UserMenu.X + s.Width - UserMenu.X / 2 - first.SizeExchangeCard / 2, MapPosition.Y); Background = new Rectangle(0, 0, ScreenWidth - (ScreenWidth - UserMenu.X), ScreenHight); if (ScreenHight > UserMenu.X) { MapPointSize = Convert.ToInt32(UserMenu.X * 0.5 / first.Mapsize); } else { MapPointSize = Convert.ToInt32(ScreenHight * 0.5 / first.Mapsize); } MapPosition = new Rectangle(Convert.ToInt32(UserMenu.X * 0.5)-(Convert.ToInt32(first.Mapsize*MapPointSize*0.5)), (ScreenHight - first.Mapsize * MapPointSize /*first.MapPointSize*/) / 2, first.Mapsize * MapPointSize/* first.MapPointSize*/, first.Mapsize * MapPointSize); ExchangeCard = new Rectangle(UserMenu.X + ((ScreenWidth - UserMenu.X) / 2) - MapPointSize / 2, MapPosition.Y-MapPointSize, MapPointSize, MapPointSize); Button = new Rectangle(ExchangeCard.X, ExchangeCard.Y + Convert.ToInt32(MapPointSize*1.5), MapPointSize, MapPointSize); ExchangeCardFrame = new Rectangle(UserMenu.X + ((ScreenWidth - UserMenu.X) / 2) - MapPointSize,ExchangeCard.Y - MapPointSize / 2, MapPointSize * 2, MapPointSize * 2); propToFind = new Rectangle(UserMenu.X + ((ScreenWidth - UserMenu.X) / 2) - MapPointSize / 2, ScreenHight / 2-MapPointSize, MapPointSize, MapPointSize); propToFindFrame = new Rectangle(propToFind.X - (MapPointSize / 2), propToFind.Y - (MapPointSize / 2) , MapPointSize * 2, MapPointSize * 2); Pointsplayer1 = new Rectangle(UserMenu.X + ((ScreenWidth - UserMenu.X) / 2) - MapPointSize * 2, propToFind.Y + MapPointSize * 5, MapPointSize, MapPointSize); Pointsplayer2 = new Rectangle(UserMenu.X + ((ScreenWidth - UserMenu.X) / 2) - MapPointSize / 2 + MapPointSize, propToFind.Y + MapPointSize * 5, MapPointSize, MapPointSize); Playeraction = new Point(UserMenu.X + ((ScreenWidth - UserMenu.X) / 2) - MapPointSize*2, propToFind.Y + MapPointSize * 3); }
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; }
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; }
public void addPropToMap(Map first) { string[] keys= files.Proplist.Keys.ToArray(); int indexListe = 0; for (int i = 0; i < first.Mapsize; i++) { for (int j = 0; j < first.Mapsize; j++) { if (ran.Next(this.Randomwert) == 1 && indexListe < files.Proplist.Count && (i != 0 || j != 0) && (i != first.Mapsize -1 || j != first.Mapsize -1)) //Items werden nicht auf die Startposition der Spieler generiert { Board[i, j].propname = keys[indexListe]; Board[i, j].proppic = files.Proplist[keys[indexListe]]; this.usedProps.Add(keys[indexListe], files.Proplist[keys[indexListe]]); indexListe += 1; } } } int randomprop = ran.Next(this.usedProps.Count); this.searchProppic = files.Proplist[keys[randomprop]]; this.searchProp = keys[randomprop]; }
public Renderer() { first = new Map(); }