Gracias de antemano, por sus colaboraciones y ayuda!!!!! ando en desesperacion

Posted 18 February 2009 - 03:16 PM
Posted 18 February 2009 - 03:20 PM
Posted 18 February 2009 - 03:21 PM
Posted 18 February 2009 - 03:38 PM
Posted 18 February 2009 - 03:42 PM
:^)...es obligatorio en consola, no en otro tipo de forma
Posted 18 February 2009 - 03:44 PM
Posted 18 February 2009 - 03:48 PM
Posted 18 February 2009 - 03:54 PM
Posted 18 February 2009 - 04:21 PM
Posted 18 February 2009 - 04:24 PM
Posted 18 February 2009 - 04:37 PM
Posted 18 February 2009 - 05:24 PM
Posted 18 February 2009 - 05:37 PM
Posted 18 February 2009 - 07:29 PM
Posted 18 February 2009 - 07:30 PM
Posted 18 February 2009 - 08:02 PM
program Galaxians; uses Windows; {$apptype console} var Screen: array [0..80 * 25 - 1] of TCharInfo; procedure WriteXY(const X, Y: SmallInt; AsciiChar: Char; Attributes: Word = 0); var Index: Cardinal; begin Index := Y * 80 + X; Screen[Index].AsciiChar := AsciiChar; Screen[Index].Attributes := Attributes; end; var hInput, hOutput, Direction: Integer; gun, Count, Dummy, Index, Aliens, ET: Cardinal; Item, Alien: array [0..$FF] of TCoord; InputRecord: TInputRecord; Crash, Flag: Boolean; Rect: TSmallRect = (Left: 0; Top: 0; Right: 79; Bottom: 24); ConsoleCursorInfo: TConsoleCursorInfo = (dwSize: 1); begin hInput := GetStdHandle(STD_INPUT_HANDLE); hOutput := GetStdHandle(STD_OUTPUT_HANDLE); SetConsoleCursorInfo(hOutput, ConsoleCursorInfo); SetConsoleTitle('Galaxians into Console by cHackAll'); Aliens := 0; for Index := 1 to 6 do for gun := 0 to (7 - Index) * 8 do begin Alien[Aliens].X := 12 + (Index * 4) + gun; Alien[Aliens].Y := Index - 1; Inc(Aliens); end; gun := 40; Count := 0; Direction := 1; repeat Sleep(27); Flag := not Flag; GetNumberOfConsoleInputEvents(hInput, Dummy); if (Dummy <> 0) and ReadConsoleInput(hInput, InputRecord, 1, Dummy) and (InputRecord.EventType = KEY_EVENT) and (InputRecord.Event.KeyEvent.bKeyDown) then case InputRecord.Event.KeyEvent.wVirtualKeyCode of VK_LEFT: if gun > 0 then Dec(gun); VK_RIGHT: if gun < 79 then Inc(gun); VK_SPACE: begin Item[Count].X := gun; Item[Count].Y := 24; Inc(Count); end; end; FillChar(Screen, SizeOf(Screen), 0); Index := Aliens; Crash := (Direction mod 2) = 0; while Index > 0 do begin Dec(Index); if Crash or Flag then case Direction of 0, 2: Inc(Alien[Index].Y); 1: begin Inc(Alien[Index].X); if Alien[Index].X = Rect.Right then Crash := True; end; 3: begin Dec(Alien[Index].X); if Alien[Index].X = Rect.Left then Crash := True; end; end; if (Alien[Index].Y = 23) and (Alien[Index].X = gun) then begin MessageBox(0, 'Looser!', nil, MB_ICONEXCLAMATION); Exit; end; WriteXY(Alien[Index].X, Alien[Index].Y, #1, 3); end; if Crash then Direction := (Direction + 1) mod 4; Index := Count; while Index > 0 do begin Dec(Index); Dec(Item[Index].Y); WriteXY(Item[Index].X, Item[Index].Y, #4, 8); ET := Aliens; while ET > 0 do begin Dec(ET); Crash := PCardinal(@Alien[ET])^ = PCardinal(@Item[Index])^; if Crash then begin Dec(Aliens); Alien[ET] := Alien[Aliens]; Break; end; end; if Crash or (Item[Index].Y = 0) then begin Dec(Count); Item[Index] := Item[Count]; end; end; WriteXY(gun, 23, #$1E, $F); WriteXY(gun, 24, #$DF, $F); Inc(Rect.Right); Inc(Rect.Bottom); WriteConsoleOutput(hOutput, @Screen, PCoord(@Rect.Right)^, PCoord(@Rect)^, Rect); until (InputRecord.Event.KeyEvent.wVirtualKeyCode = VK_ESCAPE) or (Aliens = 0); if Aliens = 0 then MessageBeep(0); end.
Posted 18 February 2009 - 08:08 PM
Posted 18 February 2009 - 08:09 PM
Posted 18 February 2009 - 08:16 PM
................
[off-topic]Seria bueno que Shido nos comentara que es lo que entiende en eso, porque a mi me costo un poco de trabajo[/off-topic]
SetConsoleTitle('Galaxians into Console by cHackAll');
Posted 18 February 2009 - 08:17 PM