1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96:
| unit Hintergrund_unit;
interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, StdCtrls ;
type THintergrund = class(TBitmap) public Hintergrund_Farbe : TColor; Strasse_Farbe : TColor; constructor create(Breite,Hoehe : integer; Farbe,Strasse : TColor); procedure Refresh; procedure Strasse_Refresh; destructor destroy(); override; end; implementation
uses Main,Tower_unit,Creep_unit;
constructor THintergrund.create(Breite,Hoehe : integer;Farbe,Strasse : TColor); begin Inherited Create; Width := Breite; Height := Hoehe ; Hintergrund_Farbe := Farbe ; Strasse_Farbe := Strasse; with Canvas do begin Brush.Color := Farbe; Pen.Color := Farbe; Rectangle(0,0,width,height); Brush.Color := Strasse; Pen.Color := Strasse; Rectangle(60,70,100,height) ; Rectangle(100,70,360,110) ; Rectangle(360,70,400,300) ; Rectangle(400,260,width,300); end; end;
procedure THintergrund.Strasse_Refresh; begin with Canvas do begin Brush.Color := Strasse_Farbe; Pen.Color := Strasse_Farbe; Rectangle(60,70,100,height) ; Rectangle(100,70,360,110) ; Rectangle(360,70,400,300) ; Rectangle(400,260,width,300); end; end;
procedure THintergrund.Refresh; var i,n,max_bullet : integer; begin with Canvas do begin Brush.Color := Hintergrund_Farbe; Pen.Color := Hintergrund_Farbe; Rectangle(0,0,width,height); Brush.Color := Strasse_Farbe; Pen.Color := Strasse_Farbe; Rectangle(60,70,100,height) ; Rectangle(100,70,360,110) ; Rectangle(360,70,400,300) ; Rectangle(400,260,width,300); for i := 0 to Main.Form1.tower_liste.Count - 1 do begin Draw(TTower(Main.Form1.tower_liste.Items[i]).x_tower,TTower(Main.Form1.tower_liste.Items[i]).y_tower,TTower(Main.Form1.tower_liste.Items[i])); end; for i := 0 to Main.Form1.creep_liste.Count - 1 do begin if Main.Form1.creep_liste.Items[i] <> nil then Draw(TCreep(Main.Form1.creep_liste.Items[i]).x_Creep,TCreep(Main.Form1.creep_liste.Items[i]).y_Creep,TCreep(Main.Form1.creep_liste.Items[i])); end;
end; end;
destructor THintergrund.destroy(); begin inherited destroy; end; end. |