Changeset 24


Ignore:
Timestamp:
Sep 28, 2011, 9:14:55 PM (13 years ago)
Author:
george
Message:
  • Fixed: Up to eight possible players with different colors.
  • Fixed: Damage done to correct player shield.
Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UMainForm.lfm

    r23 r24  
    5151    Width = 514
    5252    Align = alClient
     53    OnMouseLeave = Image1MouseLeave
    5354    OnResize = Image1Resize
    5455  end
  • trunk/Forms/UMainForm.pas

    r23 r24  
    4848    procedure FormKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
    4949    procedure FormShow(Sender: TObject);
     50    procedure Image1MouseLeave(Sender: TObject);
    5051    procedure Image1Resize(Sender: TObject);
    5152    procedure TimerDrawTimer(Sender: TObject);
     
    201202end;
    202203
     204procedure TMainForm.Image1MouseLeave(Sender: TObject);
     205begin
     206
     207end;
     208
    203209procedure TMainForm.Image1Resize(Sender: TObject);
    204210begin
  • trunk/Forms/UMapForm.pas

    r21 r24  
    3030
    3131uses
    32   UCore;
     32  UCore, UMainForm;
    3333
    3434{ TMapForm }
     
    3737begin
    3838  Image1.Picture.Bitmap.SetSize(Image1.Width, Image1.Height);
    39   Engine.World.DrawToBitmap(Image1.Picture.Bitmap);
     39  MainForm.Engine.World.DrawToBitmap(Image1.Picture.Bitmap);
    4040end;
    4141
  • trunk/Forms/UNewGameForm.pas

    r23 r24  
    3434
    3535uses
    36   UCore;
     36  UCore, UMainForm;
    3737
    3838{$R *.lfm}
     
    6060    BeginUpdate;
    6161    Clear;
    62     for I := 0 to Engine.PlayerPool.Count - 1 do
    63     with TPlayer(Engine.PlayerPool[I]) do begin
     62    for I := 0 to MainForm.Engine.PlayerPool.Count - 1 do
     63    with TPlayer(MainForm.Engine.PlayerPool[I]) do begin
    6464      NewItem := Items.Add;
    6565      NewItem.Caption := Name;
  • trunk/UApplicationInfo.pas

    r18 r24  
    5252  Name := 'Tunneler';
    5353  Identification := 1;
    54   ReleaseDate := '2011-03-24';
     54  ReleaseDate := '2011-09-28';
    5555  MajorVersion := 0;
    56   MinorVersion := 1;
     56  MinorVersion := 2;
    5757  BugFixVersion := 0;
    5858  CompanyName := 'Chronosoft';
  • trunk/UCore.pas

    r23 r24  
    204204    (X: 0; Y: 1), (X: -1; Y: 1), (X: -1; Y: 0), (X: -1; Y: -1));
    205205
    206 var
    207   Engine: TEngine;
    208 
    209206function SwapBRComponent(Value: Integer): Integer; inline;
    210207
     
    427424    Color := TColor($b600b6);
    428425    Player := 3;
     426  end;
     427
     428  // Player 5 cannon
     429  with TMatter(Matter.AddNew(TMatter.Create)) do begin
     430    Kind := mkCannon;
     431    Color := clYellow;
     432    Player := 4;
     433  end;
     434  // Player 5 home
     435  with TMatter(Matter.AddNew(TMatter.Create)) do begin
     436    Kind := mkHome;
     437    Color := TColor($ffff2c);
     438    Player := 4;
     439  end;
     440  // Player 5 body1
     441  with TMatter(Matter.AddNew(TMatter.Create)) do begin
     442    Kind := mkTankBody;
     443    Color := TColor($ffff2c);
     444    Player := 4;
     445  end;
     446  // Player 5 body2
     447  with TMatter(Matter.AddNew(TMatter.Create)) do begin
     448    Kind := mkTankBody;
     449    Color := TColor($b6b600);
     450    Player := 4;
     451  end;
     452
     453  // Player 6 cannon
     454  with TMatter(Matter.AddNew(TMatter.Create)) do begin
     455    Kind := mkCannon;
     456    Color := clYellow;
     457    Player := 5;
     458  end;
     459  // Player 6 home
     460  with TMatter(Matter.AddNew(TMatter.Create)) do begin
     461    Kind := mkHome;
     462    Color :=  TColor($2cffff);
     463    Player := 5;
     464  end;
     465  // Player 6 body1
     466  with TMatter(Matter.AddNew(TMatter.Create)) do begin
     467    Kind := mkTankBody;
     468    Color := TColor($2cffff);
     469    Player := 5;
     470  end;
     471  // Player 6 body2
     472  with TMatter(Matter.AddNew(TMatter.Create)) do begin
     473    Kind := mkTankBody;
     474    Color := TColor($00b6b6);
     475    Player := 5;
     476  end;
     477
     478  // Player 7 cannon
     479  with TMatter(Matter.AddNew(TMatter.Create)) do begin
     480    Kind := mkCannon;
     481    Color := clYellow;
     482    Player := 6;
     483  end;
     484  // Player 7 home
     485  with TMatter(Matter.AddNew(TMatter.Create)) do begin
     486    Kind := mkHome;
     487    Color :=  TColor($008cff);
     488    Player := 6;
     489  end;
     490  // Player 7 body1
     491  with TMatter(Matter.AddNew(TMatter.Create)) do begin
     492    Kind := mkTankBody;
     493    Color := TColor($008cff);
     494    Player := 6;
     495  end;
     496  // Player 7 body2
     497  with TMatter(Matter.AddNew(TMatter.Create)) do begin
     498    Kind := mkTankBody;
     499    Color := TColor($002da0);
     500    Player := 6;
     501  end;
     502
     503  // Player 8 cannon
     504  with TMatter(Matter.AddNew(TMatter.Create)) do begin
     505    Kind := mkCannon;
     506    Color := clYellow;
     507    Player := 7;
     508  end;
     509  // Player 8 home
     510  with TMatter(Matter.AddNew(TMatter.Create)) do begin
     511    Kind := mkHome;
     512    Color :=  TColor($d0d0d0);
     513    Player := 7;
     514  end;
     515  // Player 8 body1
     516  with TMatter(Matter.AddNew(TMatter.Create)) do begin
     517    Kind := mkTankBody;
     518    Color := TColor($d0d0d0);
     519    Player := 7;
     520  end;
     521  // Player 8 body2
     522  with TMatter(Matter.AddNew(TMatter.Create)) do begin
     523    Kind := mkTankBody;
     524    Color := TColor($707070);
     525    Player := 7;
    429526  end;
    430527end;
     
    666763          for P := 0 to Engine.Players.Count - 1 do
    667764          with TPlayer(Engine.Players[P]) do
    668           if Enabled and (TMatter(Engine.World.Matter[ItemsXY[Pos.X, Pos.Y]]).Kind = mkTankBody) then
     765          if (TMatter(Engine.World.Matter[ItemsXY[Pos.X, Pos.Y]]).Kind = mkTankBody) and
     766            (TMatter(Engine.World.Matter[ItemsXY[Pos.X, Pos.Y]]).Player = P) then
    669767            Shield := Shield - 1 / ShieldSteps;
    670768          if StopByDirt then Explosion(LastPos, BulletExplosionRange);
     
    11111209  with TPlayer(PlayerPool.AddNew(TPlayer.Create)) do begin
    11121210    Keys.Left := 76;
    1113     Keys.Down := 186;
     1211    Keys.Down := 147;
    11141212    Keys.Right := 222;
    11151213    Keys.Up := 80;
     
    11231221    Keys.Shoot := 105;
    11241222  end;
     1223  with TPlayer(PlayerPool.AddNew(TPlayer.Create)) do begin
     1224    Keys.Left := 0;
     1225    Keys.Down := 0;
     1226    Keys.Right := 0;
     1227    Keys.Up := 0;
     1228    Keys.Shoot := 0;
     1229  end;
     1230  with TPlayer(PlayerPool.AddNew(TPlayer.Create)) do begin
     1231    Keys.Left := 0;
     1232    Keys.Down := 0;
     1233    Keys.Right := 0;
     1234    Keys.Up := 0;
     1235    Keys.Shoot := 0;
     1236  end;
     1237  with TPlayer(PlayerPool.AddNew(TPlayer.Create)) do begin
     1238    Keys.Left := 0;
     1239    Keys.Down := 0;
     1240    Keys.Right := 0;
     1241    Keys.Up := 0;
     1242    Keys.Shoot := 0;
     1243  end;
     1244  with TPlayer(PlayerPool.AddNew(TPlayer.Create)) do begin
     1245    Keys.Left := 0;
     1246    Keys.Down := 0;
     1247    Keys.Right := 0;
     1248    Keys.Up := 0;
     1249    Keys.Shoot := 0;
     1250  end;
    11251251  for I := 0 to PlayerPool.Count - 1 do
    11261252  with TPlayer(PlayerPool[I]) do begin
     
    11291255    InitTanks;
    11301256    Name := SPlayer + ' ' + IntToStr(I + 1);
     1257    Enabled := True;
    11311258  end;
    11321259end;
     
    12301357  I2: Integer;
    12311358begin
     1359  Active := False;
    12321360  Players.Clear;
    12331361  for I := 0 to PlayerPool.Count - 1 do
     
    12421370  with TPlayer(Players[I]) do
    12431371    Init;
     1372  ClearBackground := True;
    12441373  Redraw;
     1374  Active := True;
    12451375end;
    12461376
  • trunk/tunneler.lpi

    r23 r24  
    5555        <TopLine Value="1"/>
    5656        <CursorPos X="61" Y="10"/>
    57         <UsageCount Value="114"/>
     57        <UsageCount Value="116"/>
    5858        <Loaded Value="True"/>
    5959      </Unit0>
     
    7272        <IsPartOfProject Value="True"/>
    7373        <UnitName Value="UCore"/>
    74         <IsVisibleTab Value="True"/>
    7574        <EditorIndex Value="0"/>
    7675        <WindowIndex Value="0"/>
    77         <TopLine Value="954"/>
    78         <CursorPos X="9" Y="970"/>
    79         <UsageCount Value="114"/>
     76        <TopLine Value="739"/>
     77        <CursorPos X="14" Y="766"/>
     78        <UsageCount Value="116"/>
    8079        <Loaded Value="True"/>
    8180      </Unit2>
     
    125124        <TopLine Value="453"/>
    126125        <CursorPos X="1" Y="470"/>
    127         <UsageCount Value="10"/>
     126        <UsageCount Value="11"/>
    128127        <Loaded Value="True"/>
    129128      </Unit8>
     
    147146        <EditorIndex Value="16"/>
    148147        <WindowIndex Value="0"/>
    149         <TopLine Value="154"/>
    150         <CursorPos X="3" Y="156"/>
     148        <TopLine Value="152"/>
     149        <CursorPos X="1" Y="174"/>
    151150        <UsageCount Value="49"/>
    152151        <Loaded Value="True"/>
     
    181180        <TopLine Value="115"/>
    182181        <CursorPos X="1" Y="132"/>
    183         <UsageCount Value="26"/>
     182        <UsageCount Value="27"/>
    184183        <Loaded Value="True"/>
    185184      </Unit15>
     
    401400        <IsPartOfProject Value="True"/>
    402401        <UnitName Value="UPlatform"/>
    403         <UsageCount Value="73"/>
     402        <UsageCount Value="75"/>
    404403      </Unit44>
    405404      <Unit45>
     
    450449        <TopLine Value="120"/>
    451450        <CursorPos X="44" Y="150"/>
    452         <UsageCount Value="58"/>
     451        <UsageCount Value="60"/>
    453452        <Loaded Value="True"/>
    454453      </Unit50>
     
    476475        <TopLine Value="69"/>
    477476        <CursorPos X="3" Y="90"/>
    478         <UsageCount Value="51"/>
     477        <UsageCount Value="53"/>
    479478        <Loaded Value="True"/>
    480479      </Unit53>
     
    483482        <IsPartOfProject Value="True"/>
    484483        <UnitName Value="UApplicationInfo"/>
     484        <IsVisibleTab Value="True"/>
    485485        <EditorIndex Value="18"/>
    486486        <WindowIndex Value="0"/>
    487         <TopLine Value="1"/>
    488         <CursorPos X="70" Y="42"/>
    489         <UsageCount Value="51"/>
     487        <TopLine Value="29"/>
     488        <CursorPos X="20" Y="56"/>
     489        <UsageCount Value="53"/>
    490490        <Loaded Value="True"/>
    491491      </Unit54>
     
    494494        <IsPartOfProject Value="True"/>
    495495        <UnitName Value="URegistry"/>
    496         <UsageCount Value="50"/>
     496        <UsageCount Value="52"/>
    497497      </Unit55>
    498498      <Unit56>
     
    525525        <TopLine Value="34"/>
    526526        <CursorPos X="35" Y="51"/>
    527         <UsageCount Value="42"/>
     527        <UsageCount Value="44"/>
    528528        <Loaded Value="True"/>
    529529      </Unit59>
     
    546546        <EditorIndex Value="3"/>
    547547        <WindowIndex Value="0"/>
    548         <TopLine Value="41"/>
    549         <CursorPos X="1" Y="74"/>
    550         <UsageCount Value="42"/>
     548        <TopLine Value="44"/>
     549        <CursorPos X="23" Y="65"/>
     550        <UsageCount Value="44"/>
    551551        <Loaded Value="True"/>
    552552        <LoadedDesigner Value="True"/>
     
    561561        <EditorIndex Value="4"/>
    562562        <WindowIndex Value="0"/>
    563         <TopLine Value="29"/>
    564         <CursorPos X="1" Y="46"/>
    565         <UsageCount Value="42"/>
     563        <TopLine Value="183"/>
     564        <CursorPos X="3" Y="206"/>
     565        <UsageCount Value="44"/>
    566566        <Loaded Value="True"/>
    567567        <LoadedDesigner Value="True"/>
     
    576576        <EditorIndex Value="20"/>
    577577        <WindowIndex Value="0"/>
    578         <TopLine Value="1"/>
    579         <CursorPos X="10" Y="5"/>
    580         <UsageCount Value="42"/>
     578        <TopLine Value="14"/>
     579        <CursorPos X="19" Y="32"/>
     580        <UsageCount Value="44"/>
    581581        <Loaded Value="True"/>
    582582        <LoadedDesigner Value="True"/>
     
    616616        <TopLine Value="1508"/>
    617617        <CursorPos X="17" Y="1512"/>
    618         <UsageCount Value="10"/>
     618        <UsageCount Value="11"/>
    619619        <Loaded Value="True"/>
    620620      </Unit67>
     
    625625        <TopLine Value="1"/>
    626626        <CursorPos X="33" Y="15"/>
    627         <UsageCount Value="10"/>
     627        <UsageCount Value="11"/>
    628628        <Loaded Value="True"/>
    629629      </Unit68>
     
    634634        <TopLine Value="50"/>
    635635        <CursorPos X="5" Y="67"/>
    636         <UsageCount Value="10"/>
     636        <UsageCount Value="11"/>
    637637        <Loaded Value="True"/>
    638638      </Unit69>
     
    643643        <TopLine Value="164"/>
    644644        <CursorPos X="27" Y="167"/>
    645         <UsageCount Value="10"/>
     645        <UsageCount Value="11"/>
    646646        <Loaded Value="True"/>
    647647      </Unit70>
     
    649649    <JumpHistory Count="30" HistoryIndex="29">
    650650      <Position1>
    651         <Filename Value="Common/UThreading.pas"/>
    652         <Caret Line="272" Column="11" TopLine="255"/>
     651        <Filename Value="UCore.pas"/>
     652        <Caret Line="1264" Column="1" TopLine="1240"/>
    653653      </Position1>
    654654      <Position2>
    655655        <Filename Value="UCore.pas"/>
    656         <Caret Line="241" Column="14" TopLine="238"/>
     656        <Caret Line="1266" Column="1" TopLine="1240"/>
    657657      </Position2>
    658658      <Position3>
    659659        <Filename Value="UCore.pas"/>
    660         <Caret Line="1221" Column="9" TopLine="1205"/>
     660        <Caret Line="1267" Column="1" TopLine="1240"/>
    661661      </Position3>
    662662      <Position4>
    663         <Filename Value="Common/UThreading.pas"/>
    664         <Caret Line="167" Column="19" TopLine="158"/>
     663        <Filename Value="UCore.pas"/>
     664        <Caret Line="1268" Column="1" TopLine="1240"/>
    665665      </Position4>
    666666      <Position5>
    667667        <Filename Value="UCore.pas"/>
    668         <Caret Line="972" Column="57" TopLine="955"/>
     668        <Caret Line="803" Column="1" TopLine="786"/>
    669669      </Position5>
    670670      <Position6>
    671671        <Filename Value="UCore.pas"/>
    672         <Caret Line="16" Column="41" TopLine="1"/>
     672        <Caret Line="805" Column="1" TopLine="786"/>
    673673      </Position6>
    674674      <Position7>
    675         <Filename Value="Common/UThreading.pas"/>
    676         <Caret Line="272" Column="5" TopLine="255"/>
     675        <Filename Value="UCore.pas"/>
     676        <Caret Line="806" Column="1" TopLine="786"/>
    677677      </Position7>
    678678      <Position8>
    679         <Filename Value="Common/UThreading.pas"/>
    680         <Caret Line="274" Column="54" TopLine="255"/>
     679        <Filename Value="UCore.pas"/>
     680        <Caret Line="807" Column="1" TopLine="786"/>
    681681      </Position8>
    682682      <Position9>
    683683        <Filename Value="UCore.pas"/>
    684         <Caret Line="972" Column="31" TopLine="957"/>
     684        <Caret Line="808" Column="1" TopLine="786"/>
    685685      </Position9>
    686686      <Position10>
    687         <Filename Value="Common/UThreading.pas"/>
    688         <Caret Line="43" Column="48" TopLine="26"/>
     687        <Filename Value="UCore.pas"/>
     688        <Caret Line="809" Column="1" TopLine="786"/>
    689689      </Position10>
    690690      <Position11>
    691691        <Filename Value="UCore.pas"/>
    692         <Caret Line="960" Column="29" TopLine="947"/>
     692        <Caret Line="810" Column="1" TopLine="786"/>
    693693      </Position11>
    694694      <Position12>
    695695        <Filename Value="UCore.pas"/>
    696         <Caret Line="241" Column="14" TopLine="238"/>
     696        <Caret Line="811" Column="1" TopLine="786"/>
    697697      </Position12>
    698698      <Position13>
    699         <Filename Value="Common/UThreading.pas"/>
    700         <Caret Line="61" Column="31" TopLine="53"/>
     699        <Filename Value="UCore.pas"/>
     700        <Caret Line="789" Column="1" TopLine="783"/>
    701701      </Position13>
    702702      <Position14>
    703         <Filename Value="Common/UThreading.pas"/>
    704         <Caret Line="51" Column="33" TopLine="41"/>
     703        <Filename Value="UCore.pas"/>
     704        <Caret Line="790" Column="1" TopLine="783"/>
    705705      </Position14>
    706706      <Position15>
    707707        <Filename Value="UCore.pas"/>
    708         <Caret Line="1205" Column="23" TopLine="1205"/>
     708        <Caret Line="792" Column="1" TopLine="783"/>
    709709      </Position15>
    710710      <Position16>
    711711        <Filename Value="UCore.pas"/>
    712         <Caret Line="204" Column="32" TopLine="191"/>
     712        <Caret Line="791" Column="1" TopLine="783"/>
    713713      </Position16>
    714714      <Position17>
    715         <Filename Value="Common/UThreading.pas"/>
    716         <Caret Line="61" Column="26" TopLine="43"/>
     715        <Filename Value="UCore.pas"/>
     716        <Caret Line="794" Column="1" TopLine="783"/>
    717717      </Position17>
    718718      <Position18>
    719         <Filename Value="Common/UThreading.pas"/>
    720         <Caret Line="51" Column="35" TopLine="34"/>
     719        <Filename Value="UCore.pas"/>
     720        <Caret Line="812" Column="1" TopLine="784"/>
    721721      </Position18>
    722722      <Position19>
    723         <Filename Value="/usr/share/fpcsrc/2.4.2/rtl/unix/tthread.inc"/>
    724         <Caret Line="6" Column="64" TopLine="1"/>
     723        <Filename Value="UCore.pas"/>
     724        <Caret Line="1267" Column="1" TopLine="1240"/>
    725725      </Position19>
    726726      <Position20>
    727727        <Filename Value="UCore.pas"/>
    728         <Caret Line="971" Column="35" TopLine="955"/>
     728        <Caret Line="1268" Column="1" TopLine="1240"/>
    729729      </Position20>
    730730      <Position21>
    731         <Filename Value="../../../lazarus/lcl/include/rasterimage.inc"/>
    732         <Caret Line="470" Column="1" TopLine="453"/>
     731        <Filename Value="UCore.pas"/>
     732        <Caret Line="1269" Column="1" TopLine="1240"/>
    733733      </Position21>
    734734      <Position22>
    735735        <Filename Value="UCore.pas"/>
    736         <Caret Line="966" Column="65" TopLine="955"/>
     736        <Caret Line="1262" Column="1" TopLine="1240"/>
    737737      </Position22>
    738738      <Position23>
    739739        <Filename Value="UCore.pas"/>
    740         <Caret Line="971" Column="1" TopLine="955"/>
     740        <Caret Line="1264" Column="1" TopLine="1240"/>
    741741      </Position23>
    742742      <Position24>
    743743        <Filename Value="UCore.pas"/>
    744         <Caret Line="1180" Column="1" TopLine="1163"/>
     744        <Caret Line="1261" Column="42" TopLine="1241"/>
    745745      </Position24>
    746746      <Position25>
    747         <Filename Value="Forms/UMainForm.pas"/>
    748         <Caret Line="46" Column="1" TopLine="29"/>
     747        <Filename Value="../../PascalClassLibrary/Generics/TemplateGenerics/Generic/GenericMatrix.inc"/>
     748        <Caret Line="174" Column="1" TopLine="152"/>
    749749      </Position25>
    750750      <Position26>
    751         <Filename Value="Forms/UNewGameForm.pas"/>
    752         <Caret Line="22" Column="1" TopLine="5"/>
     751        <Filename Value="UCore.pas"/>
     752        <Caret Line="698" Column="30" TopLine="682"/>
    753753      </Position26>
    754754      <Position27>
    755         <Filename Value="Forms/UNewGameForm.pas"/>
    756         <Caret Line="74" Column="1" TopLine="41"/>
     755        <Filename Value="UCore.pas"/>
     756        <Caret Line="1172" Column="49" TopLine="1159"/>
    757757      </Position27>
    758758      <Position28>
    759         <Filename Value="UCore.pas"/>
    760         <Caret Line="971" Column="1" TopLine="954"/>
     759        <Filename Value="../../PascalClassLibrary/Generics/TemplateGenerics/Generic/GenericList.inc"/>
     760        <Caret Line="132" Column="1" TopLine="115"/>
    761761      </Position28>
    762762      <Position29>
    763         <Filename Value="UCore.pas"/>
    764         <Caret Line="972" Column="1" TopLine="954"/>
     763        <Filename Value="Forms/UMainForm.pas"/>
     764        <Caret Line="39" Column="35" TopLine="29"/>
    765765      </Position29>
    766766      <Position30>
    767767        <Filename Value="UCore.pas"/>
    768         <Caret Line="973" Column="1" TopLine="954"/>
     768        <Caret Line="1326" Column="29" TopLine="1318"/>
    769769      </Position30>
    770770    </JumpHistory>
Note: See TracChangeset for help on using the changeset viewer.