Changeset 69


Ignore:
Timestamp:
Jan 9, 2023, 1:05:50 AM (23 months ago)
Author:
chronos
Message:
  • Fixed: Show informations and instructions texts.
Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Languages/Tunneler.cs.po

    r68 r69  
    186186msgstr "Informace"
    187187
     188#: uengine.sinformationdetails
     189msgid "Tunneler is written from scratch in Lazarus/FPC. It is designed to be as similar as the original MS-DOS game (https://tunneler.org/) but also with some modern extensions. The program uses standard canvas drawing with combination of low resolution fast pixel matrix. It supports High DPI scaling. It supports up to eight players."
     190msgstr "Tunneler je napsán od začátku v Lazarus/FPC. Je navrÅŸen jako co nejvíce podobnÃœ původní MS-DOS hře (https://tunneler.org/), ale také s některÃœmi moderními rozšířeními. Program pouşívá standardní plátno pro kreslení s kombinací matice rychlÃœch obrazovÃœch bodů v malém rozliÅ¡ení. Podporuje Å¡kálování vysokého rozliÅ¡ení. Podporuje aÅŸ osm hráčů."
     191
     192#: uengine.sinformationdetails2
     193msgid "This is a public domain open source program: feel free to copy it for friends and study the source code. \\n Homepage: https://app.zdechov.net/Tunneler"
     194msgstr "Toto je volně Å¡iřitelnÃœ program s otevřenÃœm kódem: klidně jej zkopírujte svÃœm přátelům a studujte jeho zdrojovÃœ kód. \\n Domovská stránka: https://app.zdechov.net/Tunneler"
     195
    188196#: uengine.sinstructions
    189197msgid "Instructions"
    190198msgstr "Instrukce"
     199
     200#: uengine.sinstructionsdetails
     201msgid "Tunneler is a two player game. The objective of the game is to be the first to win three rounds. A round continues until one tank blows up (from being shot or simply running out of energy)."
     202msgstr "Tunneler je hra pro dva hráče. Cílem hry je bÃœt první, kdo vyhraje tři kola. Kolo pokračuje dokud jeden tak vybuchne (zastřelením nebo vyčerpáním energie)."
     203
     204#: uengine.sinstructionsdetails2
     205msgid "The display: Each player has a view screen and an instrument panel with two meters. The view screen shows your surroundings from above (about 1% of the entire \"worlds\"). The two meters indicate the player's energy and shield condition."
     206msgstr "Zobrazení: KaÅŸdÃœ hráč má pohledovou obrazovku a nástrojovÃœ panel s dvěma měřiči. Pohledová obrazovka ukazuje vaÅ¡e okolí z vrchu (okolo 1% celého \"světa\"). Dva měřiče indikují stav hráčovy energie a Å¡títu."
     207
     208#: uengine.sinstructionsdetails3
     209msgid "The Game: Players can move in one of 8 directions. Movement in tunnels is three times as fast as normal digging. Fast digging can be accomplished by firing the tank's cannon while moving. Various actions use up different amounts of energy : moving costs some energy, digging costs more, and shotting costs the most. Shields are damaged when hit by the other player's cannon. Players can refuel at either base but can repair their shields only at their own bases."
     210msgstr "Hra: Hráči se mohou pohybovat v jednom z osmi směrů. Pohyb tunely je třikrát rychlejší neÅŸ obyčejné kopání. Rychlého kopání lze dosáhnout střílením z hlavně tanku při pohybu. Různé akce pouşívají různé mnoÅŸství energie: pohyb stojí nějakou energii, kopání stojí více a střílení nejvíce. Å tít je poÅ¡kozen, kdyÅŸ je zasaÅŸen dělem jiného hráče. Hráči mohou dotankovat v kterékoliv základně, ale mohou se opravit svůj Å¡tít jen ve svÃœch vlastních základnách."
     211
     212#: uengine.sinstructionsdetails4
     213msgid "Controls: \\n Blue: W - up, A - left, S - down, D - right, E - shoot \\n Green: arrows key, CTRL - shoot"
     214msgstr "Ovládání: \\n Modrá: W - nahoru, A - vlevo, S - dolů, D - vpravo, E - střelba \\n ZelenÃœ: kurzorové Å¡ipky, CTRL + střelba"
    191215
    192216#: uengine.smetersdug
  • trunk/Languages/Tunneler.pot

    r68 r69  
    150150msgstr ""
    151151
     152#: uengine.sinformationdetails
     153msgid "Tunneler is written from scratch in Lazarus/FPC. It is designed to be as similar as the original MS-DOS game (https://tunneler.org/) but also with some modern extensions. The program uses standard canvas drawing with combination of low resolution fast pixel matrix. It supports High DPI scaling. It supports up to eight players."
     154msgstr ""
     155
     156#: uengine.sinformationdetails2
     157msgid "This is a public domain open source program: feel free to copy it for friends and study the source code. \\n Homepage: https://app.zdechov.net/Tunneler"
     158msgstr ""
     159
    152160#: uengine.sinstructions
    153161msgid "Instructions"
     162msgstr ""
     163
     164#: uengine.sinstructionsdetails
     165msgid "Tunneler is a two player game. The objective of the game is to be the first to win three rounds. A round continues until one tank blows up (from being shot or simply running out of energy)."
     166msgstr ""
     167
     168#: uengine.sinstructionsdetails2
     169msgid "The display: Each player has a view screen and an instrument panel with two meters. The view screen shows your surroundings from above (about 1% of the entire \"worlds\"). The two meters indicate the player's energy and shield condition."
     170msgstr ""
     171
     172#: uengine.sinstructionsdetails3
     173msgid "The Game: Players can move in one of 8 directions. Movement in tunnels is three times as fast as normal digging. Fast digging can be accomplished by firing the tank's cannon while moving. Various actions use up different amounts of energy : moving costs some energy, digging costs more, and shotting costs the most. Shields are damaged when hit by the other player's cannon. Players can refuel at either base but can repair their shields only at their own bases."
     174msgstr ""
     175
     176#: uengine.sinstructionsdetails4
     177msgid "Controls: \\n Blue: W - up, A - left, S - down, D - right, E - shoot \\n Green: arrows key, CTRL - shoot"
    154178msgstr ""
    155179
  • trunk/UEngine.pas

    r68 r69  
    44
    55uses
    6   Dialogs, Classes, SysUtils, Graphics, SpecializedMatrix, URegistry,
     6  Dialogs, Classes, SysUtils, Graphics, SpecializedMatrix, URegistry, UCommon,
    77  IntfGraphics, FPImage, LCLType, SpecializedBitmap, GraphType, Math, URectangle,
    88  Syncobjs, UThreading, Forms, DateUtils, UAudioSystem, Generics.Collections,
     
    232232    procedure DrawMap;
    233233    procedure SetState(AValue: TGameState);
     234    function TextOutWordWrap(Canvas: TCanvas; X, Y: Integer; Text: string; Width: Integer): Integer;
    234235  public
    235236    ThreadErrorMessage: string;
     
    281282  SStartGame = 'Start game';
    282283  SInstructions = 'Instructions';
     284  SInstructionsDetails = 'Tunneler is a two player game. The objective of the game is to be the first to win three rounds. ' +
     285    'A round continues until one tank blows up (from being shot or simply running out of energy).';
     286  SInstructionsDetails2 = 'The display: Each player has a view screen and an instrument panel with two meters. ' +
     287    'The view screen shows your surroundings from above (about 1% of the entire "worlds"). ' +
     288    'The two meters indicate the player''s energy and shield condition.';
     289  SInstructionsDetails3 = 'The Game: Players can move in one of 8 directions. ' +
     290    'Movement in tunnels is three times as fast as normal digging. ' +
     291    'Fast digging can be accomplished by firing the tank''s cannon while moving. ' +
     292    'Various actions use up different amounts of energy : moving costs some energy, digging costs more, and shotting costs the most. ' +
     293    'Shields are damaged when hit by the other player''s cannon. ' +
     294    'Players can refuel at either base but can repair their shields only at their own bases.';
     295  SInstructionsDetails4 = 'Controls: \n ' +
     296    'Blue: W - up, A - left, S - down, D - right, E - shoot \n ' +
     297    'Green: arrows key, CTRL - shoot';
    283298  SInformation = 'Information';
     299  SInformationDetails = 'Tunneler is written from scratch in Lazarus/FPC. ' +
     300    'It is designed to be as similar as the original MS-DOS game (https://tunneler.org/) but also with some modern extensions. ' +
     301    'The program uses standard canvas drawing with combination of low resolution fast pixel matrix. ' +
     302    'It supports High DPI scaling. It supports up to eight players.';
     303  SInformationDetails2 = 'This is a public domain open source program: feel free to copy it for friends and study the source code. \n ' +
     304    'Homepage: https://app.zdechov.net/Tunneler';
    284305  SWorldReady = 'World ready';
    285306  SExit = 'Exit';
     
    11861207  Text: string;
    11871208  X: Integer;
     1209  Y: Integer;
     1210const
     1211  LineHeight = 60;
    11881212begin
    11891213  with Bitmap.Canvas do begin
     
    11931217
    11941218    X := Bitmap.Width div 2;
     1219    Y := Bitmap.Height div 20;
    11951220
    11961221    Brush.Style := bsClear;
    11971222    Pen.Style := psSolid;
    11981223    Pen.Color := clWhite;
    1199     Font.Color := clTuna;
     1224    Font.Color := clGreen;
    12001225    Font.Size := 30;
    12011226    Text := SInformation;
    1202     TextOut(X - TextWidth(Text) div 2, Bitmap.Height div 10, Text);
     1227    TextOut(X - TextWidth(Text) div 2, Y, Text);
     1228    Inc(Y, 2 * LineHeight);
     1229
     1230    X := 30;
     1231
     1232    Font.Color := clYellow;
     1233    Font.Size := 20;
     1234    Text := SInformationDetails;
     1235    Inc(Y, LineHeight * TextOutWordWrap(Bitmap.Canvas, X, Y, Text,  Bitmap.Width - 60));
     1236    Inc(Y, LineHeight);
     1237
     1238    Text := SInformationDetails2;
     1239    Inc(Y, LineHeight * TextOutWordWrap(Bitmap.Canvas, X, Y, Text,  Bitmap.Width - 60));
     1240    Inc(Y, LineHeight);
     1241
     1242    X := Bitmap.Width div 2;
    12031243
    12041244    Font.Color := clGreen;
     
    12131253  Text: string;
    12141254  X: Integer;
     1255  Y: Integer;
     1256const
     1257  LineHeight = 60;
    12151258begin
    12161259  with Bitmap.Canvas do begin
     
    12201263
    12211264    X := Bitmap.Width div 2;
     1265    Y := Bitmap.Height div 20;
    12221266
    12231267    Brush.Style := bsClear;
     
    12271271    Font.Size := 30;
    12281272    Text := SInstructions;
    1229     TextOut(X - TextWidth(Text) div 2, Bitmap.Height div 10, Text);
    1230 
     1273    TextOut(X - TextWidth(Text) div 2, Y, Text);
     1274    Inc(Y, 2 * LineHeight);
     1275
     1276    X := 30;
     1277
     1278    Font.Color := clTeal;
     1279    Font.Size := 20;
     1280    Text := SInstructionsDetails;
     1281    Inc(Y, LineHeight * TextOutWordWrap(Bitmap.Canvas, X, Y, Text,  Bitmap.Width - 60));
     1282    Inc(Y, LineHeight);
     1283
     1284    Text := SInstructionsDetails2;
     1285    Inc(Y, LineHeight * TextOutWordWrap(Bitmap.Canvas, X, Y, Text,  Bitmap.Width - 60));
     1286    Inc(Y, LineHeight);
     1287
     1288    Text := SInstructionsDetails3;
     1289    Inc(Y, LineHeight * TextOutWordWrap(Bitmap.Canvas, X, Y, Text,  Bitmap.Width - 60));
     1290    Inc(Y, LineHeight);
     1291
     1292    Text := SInstructionsDetails4;
     1293    Inc(Y, LineHeight * TextOutWordWrap(Bitmap.Canvas, X, Y, Text,  Bitmap.Width - 60));
     1294    Inc(Y, LineHeight);
     1295
     1296    X := Bitmap.Width div 2;
    12311297    Font.Color := clGreen;
    12321298    Font.Size := 30;
     
    12951361  FRedrawPending := True;
    12961362  FStateTime := Now;
     1363end;
     1364
     1365function TEngine.TextOutWordWrap(Canvas: TCanvas; X, Y: Integer; Text: string; Width: Integer): Integer;
     1366var
     1367  Parts: TStringArray;
     1368  I: Integer;
     1369  XX: Integer;
     1370begin
     1371  Result := 1;
     1372  XX := 0;
     1373  Parts := Explode(' ', Text);
     1374  for I := 0 to Length(Parts) - 1 do begin
     1375    if (X + XX + Canvas.TextWidth(Parts[I]) > Width) or (Parts[I] = '\n') then begin
     1376      Y := Y + Canvas.TextHeight(Parts[I]);
     1377      XX := 0;
     1378      Inc(Result);
     1379    end;
     1380    if Parts[I] = '\n' then Continue;
     1381    Canvas.TextOut(X + XX, Y, Parts[I]);
     1382    XX := XX + Canvas.TextWidth(Parts[I]) + Canvas.TextWidth(' ');
     1383  end;
    12971384end;
    12981385
Note: See TracChangeset for help on using the changeset viewer.