Inilah Kota Ternate Propinsi Maluku Utara

Tempat Kelahiranku,, Terlihat seperti Kota New York kan?? hehe..

Hiu Ganas

Dua orang pemuda diserang hiu saat mandi dipantai :)

This is default featured slide 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured slide 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured slide 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

Jumat, 22 Juni 2012

TUGAS MEDIA PLAYER APLIKASI

unit u_mplayer;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, sPanel, ComCtrls, acProgressBar, StdCtrls, sLabel,
  sGroupBox, sSkinManager, sSkinProvider, Buttons, sSpeedButton, sListBox,
  sButton, MMSystem, MPlayer, sScrollBar, acPNG;

type
  TForm1 = class(TForm)
    sknprvdr1: TsSkinProvider;
    sknmngr1: TsSkinManager;
    grp1: TsGroupBox;
    lbl1: TsLabel;
    lbl2: TsLabel;
    probar1: TsProgressBar;
    lbl3: TsLabel;
    Panel1: TsPanel;
    ListB1: TsListBox;
    btn1: TsSpeedButton;
    btn2: TsSpeedButton;
    btn3: TsSpeedButton;
    btn4: TsSpeedButton;
    btn5: TsSpeedButton;
    dlgOpen1: TOpenDialog;
    tmr1: TTimer;
    Mplayer1: TMediaPlayer;
    scrlbr1: TsScrollBar;
    lbl4: TsLabel;
    btn7: TsSpeedButton;
    img1: TImage;
    procedure btn2Click(Sender: TObject);
    procedure btn4Click(Sender: TObject);
    procedure btn3Click(Sender: TObject);
    procedure btn5Click(Sender: TObject);
    procedure btn1Click(Sender: TObject);
    procedure tmr1Timer(Sender: TObject);
    procedure scrlbr1Change(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure FormCreate(Sender: TObject);
    procedure probar1MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure probar1MouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
    procedure ListB1DblClick(Sender: TObject);
    procedure Panel1Click(Sender: TObject);
    procedure btn7Click(Sender: TObject);
  private
    { Private declarations }
  public
    procedure MPPlay(PlayMp:Boolean);
    procedure MPOPen;
    procedure MPPrev;
    procedure MPNExt;
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

procedure TForm1.MPPrev;
begin
if ListB1.Count<>0 then
 begin
  if ListB1.ItemIndex=0 then
   begin
    ListB1.ItemIndex:=ListB1.Count-1;
     end else
    if ListB1.ItemIndex<>0 then
   begin
    ListB1.ItemIndex:=ListB1.ItemIndex-1;
  end;
end;
 if ListB1.ItemIndex=-1 then
  begin
   ListB1.ItemIndex:=0;
  end;
end;

procedure TForm1.MPNext;
begin
if (ListB1.Count<>0) and (ListB1.ItemIndex<>-1) then
 begin
  if ListB1.ItemIndex=ListB1.Count-1 then
   begin
    ListB1.ItemIndex:=0;
     end else
    if ListB1.ItemIndex<>ListB1.Count-1 then
   begin
    ListB1.ItemIndex:=ListB1.ItemIndex+1;
   end;
end else
 if ListB1.ItemIndex=-1 then
  begin
   ListB1.ItemIndex:=0;
  end;
end;

procedure TForm1.MPPlay(PlayMp:Boolean);
begin
   if PlayMP then
    begin
     try
      Mplayer1.FileName:=ListB1.Items[ListB1.ItemIndex];
      ListB1.Selected[ListB1.ItemIndex]:=true;
      lbl3.Caption:=Mplayer1.FileName;
      Panel1.Refresh;
      Mplayer1.Display:=Panel1;
      Mplayer1.Open;
      probar1.Position:=Mplayer1.Position;
      probar1.Max:=Mplayer1.Length;
      Mplayer1.DisplayRect:=Rect(0,0,Panel1.Width,Panel1.Height);
      Mplayer1.Enabled:=True;
      Mplayer1.Play;
      tmr1.Enabled:=true;
      except
       tmr1.Enabled:=false;
       MPNext;
       MPPLay(true);
       tmr1.Enabled:=true;
       lbl3.Caption:=Mplayer1.FileName;
      end;
    end;
end;

procedure TForm1.MPOPen;
begin
dlgOpen1.Filter:='All supported files|*.mp3;*.wav;*.avi;*.mpg;*.mpeg;;*.mp4;*.wma|Audio module files (*.mp3;*.wav;*.wma)|*.mp3;*.wav;*.wma|Video files (*.avi;*.mpg;*.mpeg;*.mp4)|*.avi;*.mpg;*.mpeg;*.mp4|All files (*.*)|*.*';
 if dlgOpen1.Execute then
  begin
    ListB1.Items.AddStrings(dlgOpen1.Files);
  end;
 form1.Caption:='Play List: '+inttostr(ListB1.Count)+' items';
end;

{$R *.dfm}

function getwavevolume:byte;
var
  Volume: DWord;
  MyWaveOutCaps: TWaveOutCaps;
  vol:real;
  s:string;
begin
  if WaveOutGetDevCaps(WAVE_MAPPER,@MyWaveOutCaps,sizeof(MyWaveOutCaps))=MMSYSERR_NOERROR then
   begin
    WaveOutGetVolume(WAVE_MAPPER, @Volume);
    vol:=(Volume div 65537 div 257);
    s:=floattostr(int(vol));
    getwavevolume:=strtoint(s);
   end;
end;

function setwavevolume(volume:DWord):Dword;
var  vol:integer;
MyWaveOutCaps: TWaveOutCaps;
begin
 vol:=(volume)*65537*257;
  if WaveOutGetDevCaps(WAVE_MAPPER,@MyWaveOutCaps,sizeof(MyWaveOutCaps))=MMSYSERR_NOERROR then
   begin
    WaveOutSetVolume(WAVE_MAPPER, MakeLong(vol, vol));
   end;
end;

procedure TForm1.btn2Click(Sender: TObject);
begin
 if lbl3.Caption='Paused' then
  begin
   Mplayer1.Position:=probar1.Position;
   Mplayer1.Play;
   lbl3.Caption:=Mplayer1.FileName;
  end else
 if ListB1.ItemIndex=-1 then
  begin
   ListB1.ItemIndex:=0;
   MPPlay(True);
  end else
   begin
    MPPlay(True);
   end;
 if (ListB1.Count=0) and (tmr1.Enabled=false) then
  begin
   MPOpen;
  end;
end;

procedure TForm1.btn4Click(Sender: TObject);
begin
Mplayer1.Stop;
tmr1.Enabled:=false;
probar1.Position:=0;
end;

procedure TForm1.btn3Click(Sender: TObject);
begin
 if (tmr1.Enabled) then
  begin
   Mplayer1.Pause;
   lbl3.Caption:='Paused';
  end else
 if lbl3.Caption='Paused' then
  begin
   Mplayer1.Position:=probar1.Position;
   Mplayer1.Play;
  end;
end;

procedure TForm1.btn5Click(Sender: TObject);
begin
MPNExt;
MPPlay(True);
end;

procedure TForm1.btn1Click(Sender: TObject);
begin
MPPrev;
MPPlay(True);
end;

procedure TForm1.tmr1Timer(Sender: TObject);
begin
 probar1.Position:=Mplayer1.Position;
end;

procedure TForm1.scrlbr1Change(Sender: TObject);
var f:real;
begin
 setwavevolume(scrlbr1.Position);
 f:=int(scrlbr1.Position/scrlbr1.Max*100);
 lbl4.Caption:=floattostr(f)+'%';
end;

procedure TForm1.FormDestroy(Sender: TObject);
begin
 tmr1.Destroying;
end;

procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
 tmr1.Enabled:=false;
end;

procedure TForm1.FormCreate(Sender: TObject);
var i:integer; f:real;
begin
 i:=getwavevolume;
 scrlbr1.Position:=i;
 f:=int(i/scrlbr1.Max*100);
 lbl4.Caption:=floattostr(f)+'%';
 application.HintColor:=$0046464A;
 screen.HintFont.Color:=cllime;
 application.HintHidePause:=2000;
end;

procedure TForm1.probar1MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
var f: string;
begin
try
 if Button = mbLeft then
  begin
   f := floattostr(int(((Mplayer1.length / (Form1.Width-probar1.Left-50) * x))));//calculates the new position of...
   probar1.Position := strtoint(f);
   Mplayer1.Position := strtoint(f);
    if lbl3.Caption<>'Paused' then
     Mplayer1.Play;
     tmr1.Enabled := true;
  end;
except
 exit;
end;
end;

procedure TForm1.probar1MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
var r:real;
begin
 r:=int(probar1.Position/probar1.Max*100);
 probar1.Hint:='Step: '+floattostr(r)+'%';
 probar1.ShowHint:=true;
end;

procedure TForm1.ListB1DblClick(Sender: TObject);
begin
  MPPlay(True);
end;

procedure TForm1.Panel1Click(Sender: TObject);
begin
 if (tmr1.Enabled) then
  begin
   Mplayer1.Pause;
   lbl3.Caption:='Paused';
  end else
 if lbl3.Caption='Paused' then
  begin
   Mplayer1.Position:=probar1.Position;
   Mplayer1.Play;
  end;
end;

procedure TForm1.btn7Click(Sender: TObject);
begin
MPOPen;
end;

end.

Kamis, 24 Mei 2012

Game : Diablo III Terbaru


Satu lagi nih game terbaru dari Blizzard Entertainment yang sudah tidak asing lagi yaitu Diablo III. Game ini berfantasi gelap/horor bertema action yang paling seru dan mendebarkan bila dimainkan hehe.. game ini dirilis pada tanggal 15 mei 2012. untuk spesifikasi minimal dibawah ini :
OS     : Windows XP/Vista/7.
CPU : Intel Pentium D 2.8 GHz or AMD Athlon 64 X2 4400+
Memory :  1 GB (1.5 GB for Vista and 7).
Hardisk :  12 GB.
Graphics : NVIDIA GeForce 7800 GT 256 MB or ATi Radeon X1950 Pro 256 MB

Price : Rp. 70.000
Isi 2 DVD
Screenshot :



Selasa, 22 Mei 2012

Game : The Witcher 2 Assassins Of Kings



Bagi para gamer sejati, ini ane jual game terbaru yang super berkualitas dengan grafik yang sangat halus. isinya ada 4 DVD. ini untuk spesifikasinya :

OS : Windows XP SP2 / Windows Vista SP2 / Windows 7 (32/64-bit)
Processor : Intel Core 2 Duo 2.2 Ghz or AMD Athlon 64 X2 5000+
Memory : 1 GB Windows XP / 2 GB Windows Vista and Windows 7
Video Card : 512 MB RAM, supporting Pixel Shader 3.0 (Nvidia GeForce)

Harga : Rp. 140.000

Screenshots :





Kamis, 19 April 2012

GAME SEDERHANA - TANK COMBAT

 unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, StdCtrls, MPlayer;

type
  TForm1 = class(TForm)
    Shape1: TShape;
    Shape2: TShape;
    Shape3: TShape;
    Shape4: TShape;
    t1: TImage;
    t2: TImage;
    Shape5: TShape;
    Memo1: TMemo;
    Label1: TLabel;
    Timer1: TTimer;
    Timer2: TTimer;
    Timer3: TTimer;
    mp1: TMediaPlayer;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    Label7: TLabel;
    Timer4: TTimer;
    back: TMediaPlayer;
    mp2: TMediaPlayer;
    mp4: TMediaPlayer;
    mp5: TMediaPlayer;
    Timer5: TTimer;
    Timer6: TTimer;
    Timer7: TTimer;
    Label8: TLabel;
    Label9: TLabel;
    Label10: TLabel;
    Timer8: TTimer;
    Label11: TLabel;
    Timer9: TTimer;
    Timer10: TTimer;
    Shape6: TShape;
    Label12: TLabel;
    Shape7: TShape;
    Label13: TLabel;
    procedure FormKeyUp(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    procedure FormCreate(Sender: TObject);
    procedure Label1Click(Sender: TObject);
    procedure Timer1Timer(Sender: TObject);
    procedure FormKeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    procedure Timer2Timer(Sender: TObject);
    procedure Timer3Timer(Sender: TObject);
    procedure Timer4Timer(Sender: TObject);
    procedure Timer5Timer(Sender: TObject);
    procedure Timer6Timer(Sender: TObject);
    procedure Timer7Timer(Sender: TObject);
    procedure Timer8Timer(Sender: TObject);
    procedure Timer9Timer(Sender: TObject);
    procedure Timer10Timer(Sender: TObject);
    procedure Label12Click(Sender: TObject);
    procedure Label13Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;
type zid=record
      t:trect;
      cl:tcolor;
     end;

type mut=record
      sus:boolean;
      jos:boolean;
      st:boolean;
      dr:boolean;
     end;
type glont=record
      t:trect;
      lov:boolean;
     end;

var
  Form1: TForm1;
  a:array[0..35,1..10] of zid;
  pat:trect;
  glont1,glont2:array[1..10] of glont;
  max,max2:integer;
  tan1,tan2:mut;
  care,xx,xxx,yyy,xxx2,yyy2,run,sh:integer;
  pot1,pot2:boolean;
implementation

{$R *.dfm}

procedure TForm1.FormKeyUp(Sender: TObject; var Key: Word;
  Shift: TShiftState);
var i:integer;
begin
if pot2 then
if key=vk_shift then
if max<10 then
 begin
  timer10.Enabled:=true;
  pot2:=false;
  xxx2:=991;
  shape3.Refresh;
  timer7.Enabled:=true;
  mp5.Rewind;
  mp5.Play;
  max:=max+1;
  pat.Right:=t2.Left;
  pat.Left:=pat.Right-7;
  pat.Top:=t2.Top+31;
  pat.Bottom:=pat.Top+7;
  form1.Canvas.Brush.Color:=$004080FF;
  form1.Canvas.Pen.Color:=$004080FF;
  form1.Canvas.Ellipse(pat);
  glont2[max].t:=pat;
  glont2[max].lov:=false;
 end
                    else
for i:=1 to 10 do
 if glont2[i].lov then
  begin
  timer10.Enabled:=true;
  pot2:=false;
   xxx2:=991;
   shape3.Refresh;
   timer7.Enabled:=true;
   mp5.Rewind;
   mp5.Play;
   pat.Right:=t2.Left;
   pat.Left:=pat.Right-7;
   pat.Top:=t2.Top+31;
   pat.Bottom:=pat.Top+7;
   form1.Canvas.Brush.Color:=$004080FF;
   form1.Canvas.Pen.Color:=$004080FF;
   form1.Canvas.Ellipse(pat);
   glont2[i].t:=pat;
   glont2[i].lov:=false;
   break;
  end;

if pot1 then
if key=vk_control then
if max2<10 then
 begin
  timer9.Enabled:=true;
  pot1:=false;
  xxx:=29;
  shape2.Refresh;
  timer5.Enabled:=true;
  mp5.Rewind;
  mp5.Play;
  max2:=max2+1;
  pat.Right:=t1.Left+77;
  pat.Left:=pat.Right-7;
  pat.Top:=t1.Top+31;
  pat.Bottom:=pat.Top+7;
  form1.Canvas.Brush.Color:=clnavy;
  form1.Canvas.Pen.Color:=clnavy;
  form1.Canvas.Ellipse(pat);
  glont1[max2].t:=pat;
  glont1[max2].lov:=false;
 end
                    else
for i:=1 to 10 do
 if glont1[i].lov then
  begin
  timer9.Enabled:=true;
  pot1:=false;
   xxx:=29;
   shape2.Refresh;
   timer5.Enabled:=true;
   mp5.Rewind;
   mp5.Play;
   pat.Right:=t1.Left+77;
   pat.Left:=pat.Right-7;
   pat.Top:=t1.Top+31;
   pat.Bottom:=pat.Top+7;
   form1.Canvas.Brush.Color:=clnavy;
   form1.Canvas.Pen.Color:=clnavy;
   form1.Canvas.Ellipse(pat);
   glont1[i].t:=pat;
   glont1[i].lov:=false;
   break;
  end;

case key of
 vk_down: tan2.jos:=false;
 vk_up: tan2.sus:=false;
 vk_left: tan2.st:=false;
 vk_right: tan2.dr:=false;

 ord('S'): tan1.jos:=false;
 ord('W'): tan1.sus:=false;
 ord('A'): tan1.st:=false;
 ord('D'): tan1.dr:=false;
end;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
max:=0;
max2:=0;
mp1.FileName:='Date\bad.wav';
mp1.Open;
mp2.FileName:='Date\bad2.wav';
mp2.Open;
{mp4.FileName:='Date\bum.wav';
mp4.Open;}
mp5.FileName:='Date\foc.wav';
mp5.Open;
back.FileName:='Date\back.mid';
back.open;
back.Play;
pot1:=false;
pot2:=false;
label9.Font.Color:=$004080FF;
label10.Font.Color:=clnavy;
run:=1;
end;

procedure TForm1.Label1Click(Sender: TObject);
var t:trect;
    i,val:integer;
begin
if label1.Caption='COMBAT' then
begin
if (run=4) or ((run=3) and (abs(strtoint(label9.Caption)-strtoint(label10.Caption))=2))
 then
  begin
   back.Rewind;
   back.Play;
   run:=1;
   label9.Caption:='0';
   label10.Caption:='0';
   shape1.Refresh;
  end;
if run=1 then
begin
 memo1.Lines.LoadFromFile('Date\1.txt');
 for i:=1 to 10 do
  begin
   glont1[i].lov:=true;
   glont2[i].lov:=true;
  end;
 label8.Visible:=false;
 timer3.Enabled:=true;
 timer2.Enabled:=true;
 timer6.Enabled:=true;
end;
 pot1:=true;
 pot2:=true;
care:=0;
timer4.Enabled:=true;
label1.Caption:='PAUSE';
label1.Left:=shape4.Left+(shape4.Width-label1.Width) div 2;
t.Left:=434;
t.Right:=448;
t.Top:=42;
t.Bottom:=56;
for val:=0 to 35 do
 begin
  t.Top:=t.Bottom;
  t.Bottom:=t.Top+14;
  t.Left:=434;
  t.Right:=448;
  for i:=1 to 10 do
   begin
    t.Left:=t.Right;
    t.Right:=t.Left+14;
    if memo1.Lines.Strings[val][i]='S' then form1.Canvas.Brush.Color:=$00D8E9EC
      else if memo1.Lines.Strings[val][i]='*' then form1.Canvas.Brush.Color:=clnavy
      else if memo1.Lines.Strings[val][i]='+' then form1.Canvas.Brush.Color:=$004080FF;
    form1.Canvas.FillRect(t);
    a[val,i].t:=t;
    a[val,i].cl:=form1.Canvas.Brush.Color;
    timer1.Enabled:=true;
   end;
 end;
end
        else
if label1.Caption='PAUSE' then
 begin
  label1.Caption:='G O';
  label1.Left:=shape4.Left+(shape4.Width-label1.Width) div 2;
  label2.Visible:=false;
  label3.Visible:=false;
  label4.Visible:=false;
  label5.Visible:=false;
  label6.Visible:=false;
  label7.Visible:=false;
  timer1.Enabled:=false;
  timer2.Enabled:=false;
  timer3.Enabled:=false;
  timer4.Enabled:=false;
  timer6.Enabled:=false;
  timer9.Enabled:=false;
  timer10.Enabled:=false;
  pot1:=false;
  pot2:=false;
 end
           else
if label1.Caption='G O' then
 begin
  label1.Caption:='PAUSE';
  label1.Left:=shape4.Left+(shape4.Width-label1.Width) div 2;
  pot1:=true;
  pot2:=true;
  care:=0;
  timer1.Enabled:=true;
  timer2.Enabled:=true;
  timer3.Enabled:=true;
  timer4.Enabled:=true;
  timer6.Enabled:=true;
 end;
end;

procedure TForm1.Timer1Timer(Sender: TObject);
var aux:array[1..10] of tcolor;
    x:tcolor;
    val,i:integer;
begin
 for i:=1 to 10 do
  begin
   aux[i]:=a[35,i].cl ;
   a[35,i].cl:=a[0,i].cl;
  end;
 for val:=34 downto 0 do
  for i:=1 to 10 do
   begin
    x:=a[val,i].cl;
    a[val,i].cl:=aux[i];
    aux[i]:=x;
   end;
for val:=0 to 35 do
 for i:=1 to 10 do
  begin
   form1.Canvas.Brush.Color:=a[val,i].cl;
   form1.Canvas.FillRect(a[val,i].t);
  end;
end;

procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
case key of
 vk_down: begin tan2.sus:=false; tan2.jos:=true; end;
 vk_up: begin tan2.jos:=false; tan2.sus:=true; end;
 vk_left: begin tan2.dr:=false; tan2.st:=true; end;
 vk_right: begin tan2.st:=false; tan2.dr:=true; end;

 ord('S'): begin tan1.sus:=false; tan1.jos:=true; end;
 ord('W'): begin tan1.jos:=false; tan1.sus:=true; end;
 ord('A'): begin tan1.dr:=false; tan1.st:=true; end;
 ord('D'): begin tan1.st:=false; tan1.dr:=true; end;
end;

end;

procedure TForm1.Timer2Timer(Sender: TObject);
var i,m,n:integer;
    waw:boolean;
begin
for i:=1 to max do
if glont2[i].lov=false then
begin
 form1.Canvas.Brush.Color:=$00D8E9EC;
 form1.Canvas.Pen.Color:=$00D8E9EC;
 form1.Canvas.Ellipse(glont2[i].t);
 form1.Canvas.Brush.Color:=$004080FF;
 form1.Canvas.Pen.Color:=$004080FF;
 if (glont2[i].t.Left>25) then
 begin
  glont2[i].t.Left:=glont2[i].t.Left-7;
  glont2[i].t.Right:=glont2[i].t.left+7;
  form1.Canvas.ellipse(glont2[i].t);
  if (glont2[i].t.Right<=448) and
     (glont2[i].t.left<=t1.Left+70) and
     ((form1.Canvas.Pixels[glont2[i].t.Left,glont2[i].t.Top]=clnavy) or
     (form1.Canvas.Pixels[glont2[i].t.left,glont2[i].t.Bottom]=clnavy)) then
    begin
     timer6.Enabled:=false;
     timer3.Enabled:=false;
     timer2.Enabled:=false;
     timer1.Enabled:=false;
     timer4.Enabled:=false;
     label2.Visible:=false;
     label3.Visible:=false;
     label4.Visible:=false;
     label5.Visible:=false;
     label6.Visible:=false;
     label7.Visible:=false;
     pot1:=false;
     pot2:=false;
     shape1.Refresh;
     form1.Canvas.Ellipse(glont2[i].t);
     label10.Caption:=inttostr(strtoint(label10.Caption)+1);
     for m:=1 to 10 do
      begin
       glont1[m].lov:=true;
       glont2[m].lov:=true;
      end;
     run:=run+1;
     if run=2 then
      begin
       label8.Caption:='Tank Biru Kena Tembak!'+#13+
       '        mulai rounde II...' ;
       label8.Visible:=true;
       timer8.Enabled:=true;
       label11.Visible:=true;
       label11.Caption:='4';
       sh:=4;
       label1.Visible:=false;
       label1.Caption:='COMBAT';
      end
      else
      if (run=3) and (label10.Caption<>'2') then
      begin
       label8.Caption:='Tank Biru Kena Tembak!'+#13+
       '        mulai rounde III...' ;
       label8.Visible:=true;
       timer8.Enabled:=true;
       label11.Visible:=true;
       label11.Caption:='4';
       sh:=4;
       label1.Visible:=false;
       label1.Caption:='COMBAT';
      end
       else if (run=3) and (label10.Caption='2') then
        begin
          label8.Visible:=true;
          label8.Caption:='Tank Orange Menang!';
          label1.Caption:='COMBAT';
          label1.Left:=shape4.Left+(shape4.Width-label1.Width) div 2;
        end
       else
       if run=4 then
        if strtoint(label9.Caption)>strtoint(label10.Caption) then
         begin
          label8.Visible:=true;
          label8.Caption:='Tank Biru Menang!';
          label1.Caption:='COMBAT';
          label1.Left:=shape4.Left+(shape4.Width-label1.Width) div 2;
         end
         else
         begin
          label8.Visible:=true;
          label8.Caption:='Tank Orange Menang!';
          label1.Caption:='COMBAT';
          label1.Left:=shape4.Left+(shape4.Width-label1.Width) div 2;
         end
    end;
  for m:=1 to max2 do
    if (glont1[m].lov=false) and (glont2[i].lov=false) then
   if (glont2[i].t.right=glont1[m].t.left) and (glont2[i].t.Top=glont1[m].t.top) then
    begin
     glont2[i].lov:=true;
     glont1[m].lov:=true;
     form1.Canvas.Brush.Color:=$00D8E9EC;
     form1.Canvas.Pen.Color:=$00D8E9EC;
     form1.Canvas.ellipse(glont2[i].t);
     form1.Canvas.ellipse(glont1[m].t);
     {mp4.Stop;
     mp4.Rewind;
     mp4.Play;}
    end;
  if (glont2[i].t.Left<=598) and (glont2[i].t.Left>=438) then
   for m:=0 to 35 do
       begin
       waw:=false;
    for n:=1 to 10 do
     if (a[m,n].cl<>$00D8E9EC) and ((a[m,n].t.Right=glont2[i].t.right) or (a[m,n].t.Left=glont2[i].t.Left))
                               and ((a[m,n].t.Bottom=glont2[i].t.Bottom) or (a[m,n].t.Top=glont2[i].t.Top)) then
      begin
       a[m,n].cl:=$00D8E9EC;
       glont2[i].lov:=true;
       form1.Canvas.Brush.Color:=$00D8E9EC;
       form1.Canvas.Pen.Color:=$00D8E9EC;
       form1.Canvas.Ellipse(glont2[i].t);
       waw:=true;
       mp1.Stop;
       mp1.Rewind;
       mp1.Play;
       break;
      end;
       if waw then break;
       end;
 end
                        else
  glont2[i].lov:=true;
end;
end;

procedure TForm1.Timer3Timer(Sender: TObject);
var i:integer;
    up,dn,lt:boolean;
begin
up:=true;
for i:=0 to 7 do if form1.Canvas.Pixels[t1.Left,t1.Top-i]=clblack then
  begin
   up:=false;
   break;
  end;

lt:=true;
for i:=0 to 7 do if (form1.Canvas.Pixels[t1.Left-i,t1.Top]=clblack) or
                     (form1.Canvas.Pixels[t1.Left-i,t1.Top+70]=clblack) then
  begin
   lt:=false;
   break;
  end;

dn:=true;
for i:=0 to 7 do if form1.Canvas.Pixels[t1.Left,t1.Top+70+i]=clblack then
  begin
   dn:=false;
   break;
  end;


if tan1.sus then if up then t1.Top:=t1.Top-7;
if tan1.jos then if dn then t1.Top:=t1.Top+7;
if tan1.st then if lt then t1.Left:=t1.Left-7;
if tan1.dr then if t1.Left<368 then t1.Left:=t1.Left+7;

up:=true;
for i:=0 to 7 do if form1.Canvas.Pixels[t2.Left+68,t2.Top-i]=clblack then
  begin
   up:=false;
   break;
  end;

lt:=true;
for i:=0 to 7 do if (form1.Canvas.Pixels[t2.Left+70+i,t2.Top]=clblack) or
                     (form1.Canvas.Pixels[t2.Left+70+i,t2.Top+70]=clblack) then
  begin
   lt:=false;
   break;
  end;

dn:=true;
for i:=0 to 7 do if form1.Canvas.Pixels[t2.Left+70,t2.Top+70+i]=clblack then
  begin
   dn:=false;
   break;
  end;

if tan2.sus then if up then t2.Top:=t2.Top-7;
if tan2.jos then if dn then t2.Top:=t2.Top+7;
if tan2.st then if t2.Left>598 then t2.Left:=t2.Left-7;
if tan2.dr then if lt then t2.Left:=t2.Left+7;
end;

procedure TForm1.Timer4Timer(Sender: TObject);
begin
care:=care+1;
if care=6 then begin xx:=0; timer4.Interval:=100; end;
case care of
1: label2.Visible:=true;
2: label3.Visible:=true;
3: label4.Visible:=true;
4: label5.Visible:=true;
5: label6.Visible:=true;
6: label7.Visible:=true;
7: begin
label2.Visible:=false;
label3.Visible:=false;
label4.Visible:=false;
label5.Visible:=false;
label6.Visible:=false;
label7.Visible:=false;
if xx=10 then care:=care+2;

   end;
8: begin
label2.Visible:=true;
label3.Visible:=true;
label4.Visible:=true;
label5.Visible:=true;
label6.Visible:=true;
label7.Visible:=true;
xx:=xx+1;
care:=care-2;
   end;
end;
if care=9 then begin care:=0; timer4.Interval:=500; end;
end;

procedure TForm1.Timer5Timer(Sender: TObject);
var i:integer;
begin
xxx:=xxx+5;
for yyy:=592 to 705 do
 for i:= xxx to xxx+5 do
 if form1.Canvas.Pixels[i,yyy]=$00D8E9EC then form1.Canvas.Pixels[i,yyy]:=clnavy;
if xxx>310 then begin timer5.Enabled:=false; shape2.Refresh; end;
end;

procedure TForm1.Timer6Timer(Sender: TObject);
var i,m,n:integer;
    waw:boolean;
begin
for i:=1 to max2 do
if glont1[i].lov=false then
begin
 form1.Canvas.Pen.Color:=$00D8E9EC;
 form1.Canvas.Brush.Color:=$00D8E9EC;
 form1.Canvas.Ellipse(glont1[i].t);
 form1.Canvas.Brush.Color:=clnavy;
 form1.Canvas.Pen.Color:=clnavy;
 if (glont1[i].t.Left<995) then
 begin
  glont1[i].t.Left:=glont1[i].t.Left+7;
  glont1[i].t.Right:=glont1[i].t.left+7;
  form1.Canvas.ellipse(glont1[i].t);
  if (glont1[i].t.Right>=588) and
     (glont1[i].t.Right>=t2.Left) and
     ((form1.Canvas.Pixels[glont1[i].t.Right,glont1[i].t.Top]=$004080FF) or
     (form1.Canvas.Pixels[glont1[i].t.Right,glont1[i].t.Bottom]=$004080FF)) then
    begin
     timer6.Enabled:=false;
     timer3.Enabled:=false;
     timer2.Enabled:=false;
     timer1.Enabled:=false;
     timer4.Enabled:=false;
     label2.Visible:=false;
     label3.Visible:=false;
     label4.Visible:=false;
     label5.Visible:=false;
     label6.Visible:=false;
     label7.Visible:=false;
     pot1:=false;
     pot2:=false;
     shape1.Refresh;
     form1.Canvas.Ellipse(glont1[i].t);
     label9.Caption:=inttostr(strtoint(label9.Caption)+1);
     for m:=1 to 10 do
      begin
       glont1[m].lov:=true;
       glont2[m].lov:=true;
      end;
     run:=run+1;
     if run=2 then
      begin
       label8.Caption:='Tank Orange Kena Tembak!'+#13+
       '         Mulai ronde II ...' ;
       label8.Visible:=true;
       timer8.Enabled:=true;
       label11.Visible:=true;
       label11.Caption:='4';
       label1.Visible:=false;
       label1.Caption:='COMBAT';
       sh:=4;
      end
             else
      if (run=3) and (label9.Caption<>'2') then
      begin
       label8.Caption:='Tank Orange Kena Tembak!'+#13+
       '         Mulai ronde III ...' ;
       label8.Visible:=true;
       timer8.Enabled:=true;
       label11.Visible:=true;
       label11.Caption:='4';
       label1.Visible:=false;
       label1.Caption:='COMBAT';
       sh:=4;
      end
        else if (run=3)and (label9.Caption='2') then
         begin
          label8.Visible:=true;
          label8.Caption:='Tank Biru Menang!';
          label1.Caption:='COMBAT';
          label1.Left:=shape4.Left+(shape4.Width-label1.Width) div 2;
         end
            else
       if run=4 then
        if strtoint(label9.Caption)>strtoint(label10.Caption) then
         begin
          label8.Visible:=true;
          label8.Caption:='Tank Biru Menang!';
          label1.Caption:='COMBAT';
          label1.Left:=shape4.Left+(shape4.Width-label1.Width) div 2;
         end
         else
         begin
          label8.Visible:=true;
          label8.Caption:='Tank Orange Menang!';
          label1.Caption:='COMBAT';
          label1.Left:=shape4.Left+(shape4.Width-label1.Width) div 2;
         end
    end;

  for m:=1 to max2 do
    if (glont2[m].lov=false) and (glont1[i].lov=false) then
   if (glont1[i].t.left=glont2[m].t.right) and (glont1[i].t.Top=glont2[m].t.top) then
    begin
     glont1[i].lov:=true;
     glont2[m].lov:=true;
     form1.Canvas.Pen.Color:=$00D8E9EC;
     form1.Canvas.Brush.Color:=$00D8E9EC;
     form1.Canvas.Ellipse(glont1[i].t);
     form1.Canvas.Ellipse(glont2[m].t);
     {mp4.Stop;
     mp4.Rewind;
     mp4.Play;}
    end;
  if (glont1[i].t.right<=598) and (glont1[i].t.right>=438) then
   for m:=0 to 35 do
       begin
       waw:=false;
    for n:=1 to 10 do
     if (a[m,n].cl<>$00D8E9EC) and ((a[m,n].t.left=glont1[i].t.Left) or (a[m,n].t.right=glont1[i].t.right))
                               and ((a[m,n].t.Bottom=glont1[i].t.Bottom) or (a[m,n].t.Top=glont1[i].t.Top)) then
      begin
       a[m,n].cl:=$00D8E9EC;
       glont1[i].lov:=true;
       form1.Canvas.Brush.Color:=$00D8E9EC;
       form1.Canvas.Pen.Color:=$00D8E9EC;
       form1.Canvas.Ellipse(glont1[i].t);
       waw:=true;
       mp2.Stop;
       mp2.Rewind;
       mp2.Play;
       break;
      end;
       if waw then break;
       end;
 end
                        else
  glont1[i].lov:=true;
end;
end;

procedure TForm1.Timer7Timer(Sender: TObject);
var i:integer;
begin
xxx2:=xxx2-5;
for yyy2:=592 to 705 do
 for i:= xxx2 downto xxx2-5 do
 if form1.Canvas.Pixels[i,yyy2]=$00D8E9EC then form1.Canvas.Pixels[i,yyy2]:=$004080FF;
if xxx2<710 then begin timer7.Enabled:=false; shape3.Refresh; end;

end;

procedure TForm1.Timer8Timer(Sender: TObject);
begin
sh:=sh-1;
case sh of
1..3: label11.Caption:=inttostr(sh);
0: begin
    if run=2 then memo1.Lines.LoadFromFile('Date\2.txt')
       else if run=3 then memo1.Lines.LoadFromFile('Date\3.txt');
    label1.OnClick(label1);
    timer8.Enabled:=false;
    timer2.Enabled:=true;
    timer6.Enabled:=true;
    timer3.Enabled:=true;
    label11.Visible:=false;
    label8.Visible:=false;
    shape1.Refresh;
    label1.Visible:=true;
   end;
end;
end;

procedure TForm1.Timer9Timer(Sender: TObject);
begin
pot1:=true;
timer9.Enabled:=false;
end;

procedure TForm1.Timer10Timer(Sender: TObject);
begin
pot2:=true;
timer10.Enabled:=false;
end;

procedure TForm1.Label12Click(Sender: TObject);
begin
form1.Close;
end;

procedure TForm1.Label13Click(Sender: TObject);
begin
showmessage('Game ini dapat dimainkan oleh 2 orang (2 Player) ...'
            +#13+'Anda harus menggunakan Keyboard... tank biru dimainkan dengan'
            +#13+'tombol w a s d dan ctrl sedangkan tank orange menggunakan'
            +#13+'tanda panah dan shift'
            +#13+'Selamat bersenang-senang'
            +#13+'...OH Lupa ... pertama tekan tombol combat ya'
            );
end;

end.

Kamis, 05 April 2012

Aplikasi Operasi File



unit u_pert4_AppOperasiFile;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, ExtCtrls, FileCtrl;

type
TForm4 = class(TForm)
lbl1: TLabel;
lbl2: TLabel;
edt_nmFile: TEdit;
dirlst_1: TDirectoryListBox;
Fllst_1: TFileListBox;
drvcbb1: TDriveComboBox;
bvl1: TBevel;
btn_ok: TBitBtn;
btn_save: TBitBtn;
btn_close: TBitBtn;
grp1: TGroupBox;
chk_ReadOnly: TCheckBox;
chk_Hidden: TCheckBox;
chk_System: TCheckBox;
procedure btn_okClick(Sender: TObject);
procedure btn_saveClick(Sender: TObject);
procedure btn_closeClick(Sender: TObject);
procedure Fllst_1Change(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form4: TForm4;

implementation
var
NmFile:string;
Atribut:Integer;

{$R *.dfm}

procedure TForm4.btn_okClick(Sender: TObject);
begin
NmFile:=edt_nmFile.Text;
Atribut:=FileGetAttr(NmFile);
if Atribut and faReadOnly = faReadOnly then
chk_ReadOnly.Checked:=True
else
chk_ReadOnly.Checked:=False;
if Atribut and faHidden = faHidden then
chk_Hidden.Checked:=True
else
chk_Hidden.Checked:=False;
if Atribut and faSysFile = faSysFile then
chk_System.Checked:=True
else
chk_System.Checked:=False;

end;

procedure TForm4.btn_saveClick(Sender: TObject);
begin
if chk_ReadOnly.Checked=True then
Atribut:=Atribut or faReadOnly
else
Atribut:=Atribut and not faReadOnly;
if chk_Hidden.Checked=True then
Atribut:=Atribut or faHidden
else
Atribut:=Atribut and not faHidden;
if chk_System.Checked=True then
Atribut:=Atribut or faSysFile
else
Atribut:=Atribut and not faSysFile;
FileSetAttr(NmFile,Atribut);
end;

procedure TForm4.Fllst_1Change(Sender: TObject);
begin
btn_okClick(Self);
end;

procedure TForm4.btn_closeClick(Sender: TObject);
begin
Application.Terminate;
end;

end.