PDA

View Full Version : ClickFast (game made in Simba)



Chris
08-26-2012, 09:51 PM
ClickFast, a little game
(Download the file and start it with Simba, the game will appear!)

http://i48.tinypic.com/2rp76du.png

{
Explanation:

A square will appear on a random spot on the black part of the form.
You have to click inside the square before the time runs out, when you
succesfully click in there, you will go to the next level and there will
appear a new square. The last square will not vanish when a new one appears,
so it might get pretty hard to see which square just appeared!
The squares get smaller and smaller, there is no pause button :)

My high score is level 106 using the touchpad of my laptop :P
}

Level 106, red boxes: http://i50.tinypic.com/24l0i7k.png
Level 55, colored boxes: http://i50.tinypic.com/xljhj6.png

Sin
08-26-2012, 09:55 PM
This is epic xD

http://puu.sh/Z7xU

Solar
08-26-2012, 10:00 PM
Ha, awesome! What made you think of making this?

Chris
08-26-2012, 10:07 PM
Glad you like it :D
When I was working on a form for a script, I came across some pretty awesome form functions. That made me think of making some kind of game :p

Janilabo
08-26-2012, 10:09 PM
Great job!
Gotta love these Simba & SCAR-based games! :D

Toby1
08-26-2012, 10:12 PM
Cool game! got to level 44 on easy.. (im not to good) ;)

NKN
08-26-2012, 10:14 PM
Nice. :O

Chris
08-26-2012, 10:21 PM
Thanks :D

Sin
08-26-2012, 10:32 PM
So I started writing a script to do this for me, and its completely tearing me apart..
Im using Lape since it can do more calculations per minute but..... :(

euphemism
08-26-2012, 10:35 PM
I played a round, and this is what I ended at:
http://puu.sh/Z8fX

Chris
08-26-2012, 10:45 PM
So I started writing a script to do this for me, and its completely tearing me apart..
Im using Lape since it can do more calculations per minute but..... :(

Haha, I also thought about making that myself :p
My first try would be to make a TPA of the color 0 from before the square is drawn and after it's drawn, and then getting the points which are in the first TPA but not in the second. After that, it would be grabbing the point with the lowest x and y, and then clicking on it :p
That should work until the square isn't drawn over black points ^^

Edit:
@euphemism:
Nice!
I believe the squares won't get smaller after level 271 (5x5 pixels) :D

Sin
08-26-2012, 10:53 PM
What I was doing was getting the color of every pixel in the game and saving it as a TIA, and comparing it a older one :l

Chris
08-26-2012, 11:02 PM
Hmm yes that would be even better.
for x := 0 to 500 do
for y := 0 to 500 do
begin
TIA[I] := GetColor(x, y);
Inc(i);
end;
Something like that to start with, not going to write more as it is a pain to do because I'm currently here through my phone :p

Sin
08-26-2012, 11:03 PM
Yeah! That's exactly what I did!

Chris
08-26-2012, 11:09 PM
Hehe nice,
I'm going to bed right now, it's 1:09 am here and I have to be at work at 8:00..

Shatterhand
08-27-2012, 08:52 AM
This is nice and funny! Keep making games like this! :D

masterBB
08-27-2012, 03:28 PM
I didn't feel like finishing it. But this 'tool' will make you immortal. Got to 200 on hard with then I quit. Could easily be made into a bot.

:p LAPE PEOPLE!
program new;
{$DEFINE DEBUG}

const
SP: TPoint = [3, 45];
EP: TPoint = [502, 375];
SIZE: TPoint = [500, 331];

var
Setup: Boolean;
area, clearArea: TPointArray;

procedure DisplayDebug(bmp: Integer);
begin
{$IFDEF DEBUG}
if(Setup) then
begin
writeln('setting up debug window');
DisplayDebugImgWindow(SIZE.x, SIZE.y);
Setup := False;
end;
ClearDebugImg;
DrawBitmapDebugImg(bmp);
{$ENDIF}
end;

procedure DisplayDebug(pts: TPointArray); overload;
var
bmp: Integer;
bounds: TBox;
begin
{$IFDEF DEBUG}
bounds := GetTPABounds(pts);
bmp := CreateBitmap(bounds.x2 + 1, bounds.y2 + 1);
DrawTPABitmap(bmp, pts, $FF00FF);
DisplayDebug(bmp);
FreeBitmap(bmp);
{$ENDIF}
end;

type
TButton = record
v: Integer;
end;

var
button: TButton;

function TButton.TryAgain: Boolean;
begin

end;

function GetArea(what: String): TPointArray;
begin
if(what = 'screen')then
TPAFromBoxWrap(IntToBox(0, 0, Size.x-1, Size.y-1), Result)
else
TPAFromBoxWrap(IntToBox(0, 0, 96, 96), Result)
end;

function CompareBmps(const bmp1, bmp2: Integer; var x, y: Integer): Boolean;
var
i: Integer;
colors1, colors2: TIntegerArray;
pts: TPointArray;
begin
Result := False;

colors1 := FastGetPixels(bmp1, area);
colors2 := FastGetPixels(bmp2, area);

for i := High(colors1) downto 0 do //loop through the colors
if(not(colors1[i] = colors2[i])) then //compare the colors
begin
SetLength(pts,Length(pts)+1);
pts[High(pts)] := Point(i div Size.y, i mod Size.y); //i to coords
end;

if Length(pts) < 1 then //if there is no change, continue
Exit;

ClearTPAFromTPAWrap(pts, clearArea, pts); //clears the score area
DisplayDebug(pts);

Result := True;
MiddleTPAEx(pts, x, y);
end;

procedure MainLoop();
var
newBmp, oldBmp, x, y: Integer;
ptsDif: TPointArray;
begin
oldBmp := CreateBitmap(SIZE.x, SIZE.y);
while not(button.TryAgain) do
begin
newBMP := CreateBitmap(SIZE.x, SIZE.y);
CopyClientToBitmap(newBmp, SP.x, SP.y, EP.x, EP.y);

CompareBmps(newBMP, oldBmp, x, y);

//MoveMouse(x, y);

FreeBitmap(oldBmp);
oldBmp := newBmp;
end;
end;

begin
Setup := True;
area := GetArea('screen');
clearArea := GetArea('clear');
ClearDebug;
MainLoop();
end.

Footy
08-27-2012, 04:52 PM
Got this with my brute force script, could have been more if I was using LAPE. I love playing this game though, really cool that it was made in simba.
http://i0.simplest-image-hosting.net/picture/untitled203.png#REMEMBER-TO-LINK-SIMPLEST-IMAGE-HOSTING.NET-WHEN-HOTLINKING
program new;
{$i srl/srl.simba}
var
tries:integer;

procedure This;
var
TPA:TPointArray;
R, x, y:integer;
begin
findcolorstolerance(TPA, 0, 17, 37, 483, 352, 10);
if(GetArrayLength(TPA) <> 0)then
begin
R := Random(GetArrayLength(TPA));
MoveMouse(TPA[R].x, TPA[R].y);
getmousepos(x, y);
clickmouse(x, y, mouse_left);
end;
end;

begin
SetupSRL;
repeat
wait(1);
This
inc(tries);
if tries > 4000 then
begin
wait(1500);
tries := 0;
end;
until(tries > 4200);

end.

litoris
08-27-2012, 05:02 PM
Botting a game made in simba, using simba :D
This is nice.

masterBB
08-28-2012, 06:34 AM
Above level 220 there seems to be a change no new square is added. But this could also be a bug in my bot.

biDWkrBPIEY

Rezozo
08-28-2012, 06:47 AM
I so need to try this! gonna break that 272 barrier!

masterBB
08-28-2012, 07:26 AM
I so need to try this! gonna break that 272 barrier!

Already broke it:
http://i46.tinypic.com/302rki8.png

It was a bug in my bot. I will create a new vid ^^

Rezozo
08-28-2012, 08:24 AM
Already broke it:
http://i46.tinypic.com/302rki8.png

It was a bug in my bot. I will create a new vid ^^

~FML...

Now someone is going to bot this game too?

Sin
08-28-2012, 08:27 AM
Rule 85, if it exists, a bots there for it.

Chris
08-28-2012, 04:56 PM
Already broke it:
http://i46.tinypic.com/302rki8.png

It was a bug in my bot. I will create a new vid ^^

Lol, nice :D

There is a little bug, when you click between 0, 0 and 100, 100 when you've just started the script.
Changing line 54 to:
if (Button.Caption = 'Next level') or (Button.Caption = 'Try again') or (Button.Caption = 'Start') then
Solves it :p