Results 1 to 13 of 13

Thread: [Game(?)] OMGBALLS

  1. #1
    Join Date
    Dec 2006
    Location
    .̿̂̔͋͗̎̆ͥ̍̒ͤ͂̾̌̀̅
    Posts
    3,012
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default [Game(?)] OMGBALLS

    Yeah. I wrote a game, or atleast I count it as a game at 3am or so last night

    First thing I've made with SCAR since ages ago so if it's nubby don't blame me..

    Oh yeah and seizure warning, flashing stuff If you're sensitive make the ballcount smaller and background flashing interval bigger..

    The idea of this "game" is to eat the other balls with your blue ball by moving the blue ball over the other "enemy" balls. Control the blue ball with your mouse.

    SCAR Code:
    //OMGBALLS. Best game ever. Made by GoF`
    //eat the other balls with the blue ball.
    //Move with the mouse.. ball follows your cursor.
    //Flashy stuff.. Seizure warning xD
    program OMGBALLS;

    const
      OtherBC    = 85;   // How many enemy balls to spawn? Max 155, min 1.
      TXT        = True; // Show the text ingame?
      BGInterval = 125;  // Interval (in ms) between background color changes??
                           // (smaller = faster)
    type
      Balls = record
        Loc: TPoint;
        Lx1, Ly1, Lx2, Ly2: Integer; // last size as size changes.. for eat checking
      end;

    var
      OBForm: TForm;
      T: TVariantArray;
      FCanvas: TCanvas;
      BufImg, R, Score, BCTimeout: Integer;
      OtherBalls: array of Balls;
      BlueBall: Balls;
       
    function ReBornBall: Balls; //remake a ball.
    begin
      Result.Loc.X := Random(410) + 20;
      Result.Loc.Y := Random(410) + 20;
      Result.Lx1   := Result.Loc.X;
      Result.Ly1   := Result.Loc.Y;
      Result.Lx2   := Result.Loc.X;
      Result.Ly2   := Result.Loc.Y;
    end;

    function InBlue(Sx, Sy, Ssx, Ssy: Integer): Boolean; // checks if enemy is in your area
    begin
      if (Sx < BlueBall.Lx2) and
         (Sy < BlueBall.Ly2) and
         (Sx > BlueBall.Lx1) and
         (Sy > BlueBall.Ly1) then
      begin
        Result := True;
        Exit;
      end;
      if (Ssx < BlueBall.Lx2) and
         (Ssy < BlueBall.Ly2) and
         (Ssx > BlueBall.Lx1) and
         (Ssy > BlueBall.Ly1) then
        Result := True;
    end;

    var
      LastTxt: Integer;

    procedure Draw(Sender: TObject); // drawing..
    var
      Ct: Integer;
      DIt: Boolean;
    begin
      SafeDrawBitmap(BufImg, FCanvas, 0, 0); // black background.
      if (TXT) and (LastTxt > 5) then // move and update text every 5 frames.
      begin
        LastTxt := 1;
        with FCanvas do
        begin
          Font.Name  := 'Arial';
          Font.Size  := 10 + Random(15);
          Font.Color := Random(16777215);
          TextOut(Random(120), Random(400), 'OMGBALLS - The Game.');
        end;
      end;
      Inc(LastTxt);
      for Ct := 0 to High(OtherBalls) do // your worst enemies
      begin
        DIt := True;
        if not InBlue(OtherBalls[Ct].Lx1, OtherBalls[Ct].Ly1, OtherBalls[Ct].Lx2, OtherBalls[Ct].Ly2) then
        begin  // if not eaten then randomize new size..
          OtherBalls[Ct].Lx1 := OtherBalls[Ct].Loc.X - 7 + Random(9);
          OtherBalls[Ct].Ly1 := OtherBalls[Ct].Loc.Y - 7 + Random(9);
          OtherBalls[Ct].Lx2 := OtherBalls[Ct].Loc.X + 7 + Random(9);
          OtherBalls[Ct].Ly2 := OtherBalls[Ct].Loc.Y + 7 + Random(9);
        end else
          begin   // and if eaten...
            OtherBalls[Ct] := ReBornBall;
            Inc(Score);
            ClearDebug;
            Writeln('YOU ATE AN ENEMY BALL! CONGRATULATIONS!');
            Writeln('Current score: ' + IntToStr(Score) + '!');
            DIt := False;
          end;
        if DIt then
          with FCanvas do
          begin
            Brush.Style := bsSolid;
            Brush.Color := Random(16777215);
            Pen.Width   := 1;
            Pen.Color   := Random(16777215);
            Ellipse(OtherBalls[Ct].Lx1, OtherBalls[Ct].Ly1, OtherBalls[Ct].Lx2, OtherBalls[Ct].Ly2);
          end;
      end;
      BlueBall.Lx1 := BlueBall.Loc.X - 17 + Random(11); // your ball
      BlueBall.Ly1 := BlueBall.Loc.Y - 17 + Random(11);
      BlueBall.Lx2 := BlueBall.Loc.X + 17 + Random(11);
      BlueBall.Ly2 := BlueBall.Loc.Y + 17 + Random(11);
      with FCanvas do
      begin
        Brush.Style := bsSolid;
        Brush.Color := clBlue;
        Pen.Width   := 1;
        Pen.Color   := clBlue;
        Ellipse(BlueBall.Lx1, BlueBall.Ly1, BlueBall.Lx2, BlueBall.Ly2);
      end;
    end;

    procedure MMove(Sender: TObject; Shift: TShiftState; x, y: Integer);
    begin
      BlueBall.Loc.X := x;
      BlueBall.Loc.Y := y;
    end;

    procedure ChangeBG(Sender: TObject); // new background color
    begin
      FastDrawClear(BufImg, Random(16777215));
    end;

    procedure Init; // form
    var
        Time: TTimer;
        Time_: TTimer;
    begin
      with OBForm do
      begin
        Width       := 450;
        Height      := 450;
        Position    := poDefault;
        BorderIcons := [biSystemMenu];
        BorderStyle := bsSingle;
        Caption     := 'OMGBALLS - The Game.';
        Color       := 0;
        OnPaint     := @Draw;
        OnMouseMove := @MMove;
      end;
      FCanvas       := OBForm.Canvas;
      Time          := TTimer.Create(OBForm);
      with Time do
      begin
        Interval    := 29;
        OnTimer     := @Draw;
      end;
      Time_           := TTimer.Create(OBForm);
      with Time_ do
      begin
        Interval    := BGInterval;
        OnTimer     := @ChangeBG;
      end;
      OBForm.ShowModal;
    end;

    procedure MakeBalls;
    var
      MBC: Integer;
    begin
      for MBC := 0 to High(OtherBalls) do
      begin
        OtherBalls[MBC].Loc.X := Random(410) + 20;
        OtherBalls[MBC].Loc.Y := Random(410) + 20;
        OtherBalls[MBC].Lx1   := OtherBalls[MBC].Loc.X - 5 + Random(8);
        OtherBalls[MBC].Ly1   := OtherBalls[MBC].Loc.Y - 5 + Random(8);
        OtherBalls[MBC].Lx2   := OtherBalls[MBC].Loc.X + 5 + Random(8);
        OtherBalls[MBC].Ly2   := OtherBalls[MBC].Loc.Y + 5 + Random(8);
      end;
      BlueBall.Loc.X := 225;
      BlueBall.Loc.Y := 225;
    end;

    procedure StartUp; // startup
    begin
      ClearDebug;
      Writeln('OMGBALLS - The Game. By GoF` ');
      Writeln('Have fun.');
      Wait(2500);
      Score  := 0;
      OBForm := CreateForm;
      BufImg := BitmapFromString(450, 450, '');
      FastDrawClear(BufImg, 0);
      SetArrayLength(OtherBalls, OtherBC)
      MakeBalls;
    end;

    begin
      StartUp;
      ThreadSafeCall('Init', T);
    end.

  2. #2
    Join Date
    Mar 2008
    Posts
    1,492
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    /has a seizure... 0_0 holy crap

  3. #3
    Join Date
    Jan 2008
    Location
    NC, USA.
    Posts
    4,429
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    That was like so insane! I couldn't even play the game and "eat" the balls because I was so distracted about the flashing colours!
    Quote Originally Posted by irc
    [00:55:29] < Guest3097> I lol at how BenLand100 has become noidea
    [01:07:40] <@BenLand100> i'm not noidea i'm
    [01:07:44] -!- BenLand100 is now known as BenLand42-
    [01:07:46] <@BenLand42-> shit
    [01:07:49] -!- BenLand42- is now known as BenLand420
    [01:07:50] <@BenLand420> YEA

  4. #4
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,553
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    [Brainwashed]
    GoF is Uber p0wnage
    [/Brainwashed]

    Good job on screwing my eyes
    ~Hermen

  5. #5
    Join Date
    Feb 2006
    Location
    Belgium
    Posts
    3,137
    Mentioned
    3 Post(s)
    Quoted
    5 Post(s)

    Default

    Brain meltdown...

  6. #6
    Join Date
    Jun 2007
    Location
    Liverpool ,Nsw,Australia
    Posts
    740
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    *Argh* My eyes....Very addictive
    Quote Originally Posted by Darkmage View Post
    I got 2 questions'
    #1. When i run the script will it automatically pick up the mouse and move?

  7. #7
    Join Date
    May 2007
    Location
    Netherlands, Amersfoort
    Posts
    2,701
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Current score: 1101!

    I died after that score, Good game gof, I expected nothing else form you

    OMG BALLS

  8. #8
    Join Date
    Apr 2007
    Location
    The Buckeye State
    Posts
    482
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    colors! Pretty colors! Make it full screen then use some acid, and man would that be trippy!
    I like my coffee black just like my metal.

  9. #9
    Join Date
    Mar 2008
    Location
    The Netherlands
    Posts
    1,395
    Mentioned
    1 Post(s)
    Quoted
    1 Post(s)

    Default

    Goddam you, now I have an headache


  10. #10
    Join Date
    Jul 2008
    Location
    California
    Posts
    255
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    LOL that's awesome...

    Current score: 31337!
    Unfortunately, no active scripts atm.

  11. #11
    Join Date
    Dec 2007
    Location
    UK
    Posts
    479
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    YOU ATE AN ENEMY BALL! CONGRATULATIONS!
    Current score: 1164!
    Successfully executed
    I don't play runescape. I auto it

  12. #12
    Join Date
    May 2007
    Location
    Ohio
    Posts
    2,296
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Mother F*cker, im still seeing balls!!!


    YOU ATE AN ENEMY BALL! CONGRATULATIONS!
    Current score: 43745!

  13. #13
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default

    Argh I stopped it and I am still seeing balls too... and it crashed SCAR.


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Fun Game =]
    By Sir_Oober in forum News and General
    Replies: 18
    Last Post: 02-03-2009, 06:15 AM
  2. my first Java game (shooter game)
    By Lorax in forum Java Help and Tutorials
    Replies: 19
    Last Post: 08-18-2008, 10:48 PM
  3. The Word Game Game
    By Putnam in forum The Bashing Club / BBQ Pit
    Replies: 5
    Last Post: 04-02-2008, 03:07 AM
  4. fun new game.
    By warship45 in forum Gaming
    Replies: 1
    Last Post: 05-23-2007, 02:35 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •