Changeset 87
- Timestamp:
- May 17, 2024, 8:50:43 PM (6 months ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Engine.pas
r86 r87 205 205 gsInstructions, gsSettings, gsPlayerKeys, gsPlayerKeysRedefine); 206 206 207 TPlayerColor = (pcGreen); 208 207 209 { TEngine } 208 210 … … 231 233 procedure ClearBackground; 232 234 procedure DrawMenu; 235 procedure DrawStatsPartial(PlayerIndex, YDiff: Integer); 233 236 procedure DrawStats; 234 237 procedure DrawGamePrepare(Thread: TVirtualThread); … … 273 276 procedure SaveToRegistry(Context: TRegistryContext); 274 277 procedure InitPlayerPool; 278 procedure Translate; 275 279 property Bitmap: TBitmap read FBitmap write SetBitmap; 276 280 property Active: Boolean read FActive write SetActive; … … 308 312 'Players can refuel at either base but can repair their shields only at their own bases.'; 309 313 SInstructionsDetails4 = 'Controls: \n ' + 310 'Blue: W - up, A - left, S - down, D - right, E- shoot \n ' +311 'Green: arrows key, CTRL- shoot';314 'Blue: W - up, A - left, X - down, D - right, Control - shoot \n ' + 315 'Green: arrows key, Enter - shoot'; 312 316 SInformation = 'Information'; 313 317 SInformationDetails = 'Tunneler is written from scratch in Lazarus/FPC. ' + … … 1707 1711 Name := SGreen; 1708 1712 Keys.Left := vkA; 1709 Keys.Down := vk S;1713 Keys.Down := vkX; 1710 1714 Keys.Right := vkD; 1711 1715 Keys.Up := vkW; 1712 Keys.Shoot := vk E;1716 Keys.Shoot := vkControl; 1713 1717 Color1 := $00ff00; 1714 1718 Color2 := $00a000; … … 1721 1725 Keys.Right := vkRight; 1722 1726 Keys.Up := vkUp; 1723 Keys.Shoot := vk Control;1727 Keys.Shoot := vkReturn; 1724 1728 Color1 := $ff2c2c; 1725 1729 Color2 := $b60000; … … 1793 1797 if I < 2 then Enabled := True; 1794 1798 end; 1799 end; 1800 1801 procedure TEngine.Translate; 1802 begin 1803 PlayerPool[0].Name := SGreen; 1804 PlayerPool[1].Name := SBlue; 1805 PlayerPool[2].Name := SRed; 1806 PlayerPool[3].Name := SPink; 1807 PlayerPool[4].Name := SCyan; 1808 PlayerPool[5].Name := SYellow; 1809 PlayerPool[6].Name := SOrange; 1810 PlayerPool[7].Name := SGray; 1795 1811 end; 1796 1812 … … 1893 1909 end; 1894 1910 1895 procedure TEngine.DrawStats ;1911 procedure TEngine.DrawStatsPartial(PlayerIndex, YDiff: Integer); 1896 1912 var 1897 1913 X: Integer; 1898 1914 Y: Integer; 1915 I: Integer; 1899 1916 Text: string; 1900 Winner: TPlayer;1901 I: Integer;1902 1917 ShotsPercent: Integer; 1903 1918 const … … 1905 1920 begin 1906 1921 with Bitmap.Canvas do begin 1907 X := Bitmap.Width div 4 * 3;1908 1909 Brush.Style := bsClear;1910 Pen.Style := psSolid;1911 1912 Pen.Color := clWhite;1913 MoveTo(Bitmap.Width div 2, 0);1914 LineTo(Bitmap.Width div 2, Bitmap.Height);1915 1916 Font.Color := clCyan;1917 Font.Size := 20;1918 Text := SStatistics;1919 TextOut(X - TextWidth(Text) div 2, Bitmap.Height div 10, Text);1920 1921 1922 Font.Color := clOrange; 1922 1923 Font.Size := 20; 1923 1924 1924 Y := Bitmap.Height div 10 + 3 * LineHeight ;1925 Y := Bitmap.Height div 10 + 3 * LineHeight + YDiff; 1925 1926 X := Bitmap.Width div 2 + 50; 1926 1927 Inc(Y, LineHeight); … … 1942 1943 Inc(Y, LineHeight); 1943 1944 1944 for I := 0 to Players.Count - 1 do 1945 for I := PlayerIndex to Min(Players.Count - 1, PlayerIndex + 3) do 1946 if I < Players.Count then 1945 1947 with Players[I] do begin 1946 Y := Bitmap.Height div 10 + 3 * LineHeight ;1947 X := Bitmap.Width div 2 + 50 + 500 + 200 * I;1948 Y := Bitmap.Height div 10 + 3 * LineHeight + YDiff; 1949 X := Bitmap.Width div 2 + 50 + 500 + 200 * (I - PlayerIndex); 1948 1950 Font.Color := Color1; 1949 1951 Text := Name; … … 1972 1974 1973 1975 Inc(Y, 3 * LineHeight); 1976 end; 1977 end; 1978 1979 procedure TEngine.DrawStats; 1980 var 1981 X: Integer; 1982 Y: Integer; 1983 Text: string; 1984 Winner: TPlayer; 1985 begin 1986 with Bitmap.Canvas do begin 1987 X := Bitmap.Width div 4 * 3; 1988 1989 Brush.Style := bsClear; 1990 Pen.Style := psSolid; 1991 1992 Pen.Color := clWhite; 1993 MoveTo(Bitmap.Width div 2, 0); 1994 LineTo(Bitmap.Width div 2, Bitmap.Height); 1995 1996 Font.Color := clCyan; 1997 Font.Size := 20; 1998 Text := SStatistics; 1999 TextOut(X - TextWidth(Text) div 2, Bitmap.Height div 10, Text); 2000 2001 DrawStatsPartial(0, 0); 2002 if Players.Count > 4 then 2003 DrawStatsPartial(4, 400); 1974 2004 1975 2005 X := Bitmap.Width div 2 + 50; … … 2019 2049 if Players.Count > 2 then VertFrameCount := 2 2020 2050 else VertFrameCount := 1; 2021 HorizFrameCount := Round(Players.Count / VertFrameCount);2051 HorizFrameCount := Ceil(Players.Count / VertFrameCount); 2022 2052 end else begin 2023 2053 VertFrameCount := 1; -
trunk/Forms/FormMain.pas
r85 r87 187 187 Engine.HomePage := Core.Core.ApplicationInfo.HomePage; 188 188 LoadConfig; 189 Engine.Translate; 189 190 Engine.Bitmap := Image1.Picture.Bitmap; 190 191 Engine.NewGame; -
trunk/Languages/Tunneler.cs.po
r85 r87 91 91 #: engine.sinstructionsdetails4 92 92 msgctxt "engine.sinstructionsdetails4" 93 msgid "Controls: \\n Blue: W - up, A - left, S - down, D - right, E - shoot \\n Green: arrows key, CTRL- shoot"94 msgstr "OvládánÃ: \\n Modrá: W - nahoru, A - vlevo, S - dolů, D - vpravo, E - stÅelba \\n ZelenÃœ: kurzorové Å¡ipky, CTRL+ stÅelba"93 msgid "Controls: \\n Blue: W - up, A - left, X - down, D - right, Control - shoot \\n Green: arrows key, Enter - shoot" 94 msgstr "OvládánÃ: \\n Modrá: W - nahoru, A - vlevo, X - dolů, D - vpravo, Control - stÅelba \\n ZelenÃœ: kurzorové Å¡ipky, Return + stÅelba" 95 95 96 96 #: engine.sleft -
trunk/Languages/Tunneler.pot
r85 r87 81 81 #: engine.sinstructionsdetails4 82 82 msgctxt "engine.sinstructionsdetails4" 83 msgid "Controls: \\n Blue: W - up, A - left, S - down, D - right, E - shoot \\n Green: arrows key, CTRL- shoot"83 msgid "Controls: \\n Blue: W - up, A - left, X - down, D - right, Control - shoot \\n Green: arrows key, Enter - shoot" 84 84 msgstr "" 85 85 -
trunk/UITypes2.pas
r85 r87 17 17 vkS: Integer = $53; 18 18 vkW: Integer = $57; 19 vkX: Integer = $58; 19 20 vkLeft: Integer = $25; 20 21 vkRight: Integer = $27; … … 24 25 vkQuote: Integer = $DE; 25 26 vkSlash: Integer = $BF; 27 vkReturn: Integer = $D; 26 28 vkNumpad1: Integer = $61; 27 29 vkNumpad2: Integer = $62;
Note:
See TracChangeset
for help on using the changeset viewer.