Changeset 32 for trunk/UCore.pas


Ignore:
Timestamp:
Sep 8, 2012, 10:28:50 PM (12 years ago)
Author:
chronos
Message:
  • Added: CoolAudio package.
  • Added: Experimental in-game sounds.
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
        44tunneler.exe
        55heaptrclog.trc
         6tunneler.lps
  • trunk/UCore.pas

    r28 r32  
    88  Dialogs, Classes, SysUtils, Contnrs, Graphics, SpecializedMatrix, SpecializedList,
    99  IntfGraphics, FPImage, LCLType, SpecializedBitmap, GraphType, Math, URectangle,
    10   Syncobjs, UThreading, Forms, DateUtils;
     10  Syncobjs, UThreading, Forms, DateUtils, UAudioSystem, UAudioSystemMPlayer;
    1111
    1212const
     
    213213    CurrentRound: Integer;
    214214    MaxRound: Integer;
     215    AudioShot: TMediaPlayer;
     216    AudioExplode: TMediaPlayer;
    215217    procedure CheckGameEnd;
    216218    constructor Create;
     
    765767      //with Engine, World do
    766768      //if TMatter(Matter[Surface.Items[Position]]).Diggable ;
     769      Engine.AudioShot.Play;
    767770    end;
    768771end;
     
    821824      Explosion(Position, ExplosionRange);
    822825      Exploded := True;
     826      Engine.AudioExplode.Play;
    823827    end;
    824828  end else begin
     
    846850    Explosion(Position, ExplosionRange);
    847851    Exploded := True;
     852    Engine.AudioExplode.Play;
    848853  end;
    849854
     
    15431548  World := TWorld.Create;
    15441549  World.Engine := Self;
     1550  DefaultAudioSystem := TAudioSystemMPlayer.Create(nil);
     1551  AudioShot := TMediaPlayer.Create(nil);
     1552  AudioShot.FileName := 'Audio/GE_KF7_Soviet.wav';
     1553  AudioShot.Open;
     1554  AudioExplode := TMediaPlayer.Create(nil);
     1555  AudioExplode.FileName := 'Audio/bomb.wav';
     1556  AudioExplode.Open;
    15451557  InitPlayerPool;
    15461558  DigMasks := TListObject.Create;
     
    15531565begin
    15541566  Active := False;
    1555   DigMasks.Free;
    1556   FBitmapLower.Free;
    1557   FBitmapLock.Free;
    1558   IntfImage.Free;
    1559   PlayerPool.Free;
    1560   Players.Free;
    1561   Keyboard.Free;
    1562   World.Free;
    1563   Lock.Free;
     1567  FreeAndNil(DigMasks);
     1568  FreeAndNil(FBitmapLower);
     1569  FreeAndNil(FBitmapLock);
     1570  FreeAndNil(IntfImage);
     1571  FreeAndNil(PlayerPool);
     1572  FreeAndNil(Players);
     1573  FreeAndNil(Keyboard);
     1574  FreeAndNil(World);
     1575  FreeAndNil(Lock);
     1576  FreeAndNil(AudioShot);
     1577  FreeAndNil(AudioExplode);
    15641578  inherited Destroy;
    15651579end;
Note: See TracChangeset for help on using the changeset viewer.