Changeset 43 for trunk/UCore.pas
- Timestamp:
- Apr 19, 2019, 11:25:56 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UCore.pas
r42 r43 106 106 function DigProc(Item1, Item2: Byte): Byte; 107 107 public 108 Color: TColor; 108 Color1: TColor; 109 Color2: TColor; 109 110 Id: Integer; 110 111 Enabled: Boolean; … … 222 223 FDrawThread: TDrawThread; 223 224 FSystemThread: TSystemThread; 224 IntfImage: TLazIntfImage;225 225 ClearBackground: Boolean; 226 226 procedure InitDigMasks; … … 341 341 var 342 342 I: Integer; 343 begin 344 Clear; 345 Count := Config.GetValue(DOMString(Path + '/Count'), 0); 343 NewCount: Integer; 344 begin 345 NewCount := Config.GetValue(DOMString(Path + '/Count'), 0); 346 while Count > NewCount do Delete(Count - 1); 347 while Count < NewCount do Add(TPlayer.Create); 346 348 for I := 0 to Count - 1 do begin 347 349 Items[I] := TPlayer.Create; … … 1285 1287 Id := Source.Id; 1286 1288 Keys := Source.Keys; 1287 Color := Source.Color; 1289 Color1 := Source.Color1; 1290 Color2 := Source.Color2; 1288 1291 Energy := Source.Energy; 1289 1292 Shield := Source.Shield; … … 1298 1301 begin 1299 1302 with Config do begin 1300 Self.Name := string(GetValue(DOMString(Path + '/Name'), '')); 1301 Color := GetValue(DOMString(Path + '/Color'), 0); 1302 Enabled := GetValue(DOMString(Path + '/Enabled'), False); 1303 Keys.Left := GetValue(DOMString(Path + '/Keys/Left'), 0); 1304 Keys.Right := GetValue(DOMString(Path + '/Keys/Right'), 0); 1305 Keys.Down := GetValue(DOMString(Path + '/Keys/Down'), 0); 1306 Keys.Up := GetValue(DOMString(Path + '/Keys/Up'), 0); 1307 Keys.Shoot := GetValue(DOMString(Path + '/Keys/Shoot'), 0); 1303 Self.Name := string(GetValue(DOMString(Path + '/Name'), UnicodeString(Name))); 1304 Color1 := GetValue(DOMString(Path + '/Color1'), Color1); 1305 Color2 := GetValue(DOMString(Path + '/Color2'), Color2); 1306 Enabled := GetValue(DOMString(Path + '/Enabled'), Enabled); 1307 Keys.Left := GetValue(DOMString(Path + '/Keys/Left'), Keys.Left); 1308 Keys.Right := GetValue(DOMString(Path + '/Keys/Right'), Keys.Right); 1309 Keys.Down := GetValue(DOMString(Path + '/Keys/Down'), Keys.Down); 1310 Keys.Up := GetValue(DOMString(Path + '/Keys/Up'), Keys.Up); 1311 Keys.Shoot := GetValue(DOMString(Path + '/Keys/Shoot'), Keys.Shoot); 1308 1312 end; 1309 1313 InitTanks; … … 1314 1318 with Config do begin 1315 1319 SetValue(DOMString(Path + '/Name'), DOMString(Self.Name)); 1316 SetValue(DOMString(Path + '/Color'), Color); 1320 SetValue(DOMString(Path + '/Color1'), Color1); 1321 SetValue(DOMString(Path + '/Color2'), Color2); 1317 1322 SetValue(DOMString(Path + '/Enabled'), Enabled); 1318 1323 SetValue(DOMString(Path + '/Keys/Left'), Keys.Left); … … 1569 1574 Keys.Up := 87; 1570 1575 Keys.Shoot := 69; 1576 Color1 := $00ff00; 1577 Color2 := $00a000; 1571 1578 Enabled := True; 1572 1579 end; … … 1577 1584 Keys.Up := 38; 1578 1585 Keys.Shoot := 17; 1586 Color1 := $ff2c2c; 1587 Color2 := $b60000; 1579 1588 Enabled := True; 1580 1589 end; … … 1585 1594 Keys.Up := 80; 1586 1595 Keys.Shoot := 191; 1596 Color1 := $0000ff; 1597 Color2 := $0000a0; 1587 1598 end; 1588 1599 with PlayerPool.AddNew do begin … … 1592 1603 Keys.Up := 104; 1593 1604 Keys.Shoot := 105; 1605 Color1 := $ff2cff; 1606 Color2 := $b600b6; 1594 1607 end; 1595 1608 with PlayerPool.AddNew do begin … … 1599 1612 Keys.Up := 0; 1600 1613 Keys.Shoot := 0; 1614 Color1 := $ffff2c; 1615 Color2 := $b6b600; 1601 1616 end; 1602 1617 with PlayerPool.AddNew do begin … … 1606 1621 Keys.Up := 0; 1607 1622 Keys.Shoot := 0; 1623 Color1 := $2cffff; 1624 Color2 := $00b6b6; 1608 1625 end; 1609 1626 with PlayerPool.AddNew do begin … … 1613 1630 Keys.Up := 0; 1614 1631 Keys.Shoot := 0; 1632 Color1 := $008cff; 1633 Color2 := $002da0; 1615 1634 end; 1616 1635 with PlayerPool.AddNew do begin … … 1620 1639 Keys.Up := 0; 1621 1640 Keys.Shoot := 0; 1641 Color1 := $d0d0d0; 1642 Color2 := $707070; 1622 1643 end; 1623 1644 for I := 0 to PlayerPool.Count - 1 do … … 1644 1665 Players.Add(NewPlayer); 1645 1666 Score := 0; 1667 World.Matters[Integer(miPlayer1Home) + I * 4].Color := Color1; 1668 World.Matters[Integer(miPlayer1TankBody) + I * 4].Color := Color1; 1669 World.Matters[Integer(miPlayer1TankBody2) + I * 4].Color := Color2; 1646 1670 end; 1647 1671 end; … … 1701 1725 FBitmapLower := TBitmapTColor.Create; 1702 1726 FBitmapLock := TCriticalSection.Create; 1703 IntfImage := TLazIntfImage.Create(1, 1);1704 1727 PlayerPool := TPlayers.Create; 1705 1728 PlayerPool.Engine := Self; … … 1729 1752 FreeAndNil(FBitmapLower); 1730 1753 FreeAndNil(FBitmapLock); 1731 FreeAndNil(IntfImage);1732 1754 FreeAndNil(PlayerPool); 1733 1755 FreeAndNil(Players); … … 1765 1787 try 1766 1788 Lock.Acquire; 1767 if ClearBackground then FBitmapLower.FillAll(clNavy);1789 //if ClearBackground then FBitmapLower.FillAll(clNavy); 1768 1790 for I := 0 to Players.Count - 1 do begin 1769 1791 TPlayer(Players[I]).Paint;
Note:
See TracChangeset
for help on using the changeset viewer.