• Welcome to Valhalla Legends Archive.
 

[Flash Game] Curve Ball

Started by CupHead, December 27, 2003, 10:47 AM

Previous topic - Next topic

13-yr-Old-Newb

Curve Ball is extremely easy.  3d pong is much more challenging, alot faster and the computer isnt shit.

UserLoser.

Quote from: 13-yr-Old-Newb on January 06, 2004, 08:06 PM
Curve Ball is extremely easy.  3d pong is much more challenging, alot faster and the computer isnt shit.

Really?  How far did you get and what was your score, show a screenshot for proof

GoSS

I love that game, another good game is Redline Rumble @ http://www.shockwave.com/

TehUser

It's been a long time since this thread was active, but I was playing this game the other day and wrote a C# program to play for me.  The program is only good enough to get to level 8 (rates about a 7.5 would be my guess).  Can be fun to watch when you're bored though.  It works by continually taking screenshots and searching the image for the ball as best it can.  The problem is that the ball changes sizes, so there's no easy way to look for it.  If anyone has ideas for how to speed up the search, I'd be interested in hearing the details.

Meanwhile, because it's useful, here's the function to take a screenshot of a window.


static public Bitmap GetWindowByTitle(String strTitle)
{
Int32 hWindow = Convert.ToInt32(FindWindowEx(0, 0, null, strTitle));

Int32 hSourceDC, hDestinationDC;
Int32 hBitmap, hOldBitmap;
RECT myRect = new RECT();
Int32 scrWidth, scrHeight;

Bitmap myBitmap = null;

if (hWindow != 0 && Convert.ToBoolean(IsWindow(hWindow)))
{
hSourceDC = GetWindowDC(Convert.ToUInt32(hWindow));
if (Convert.ToBoolean(hSourceDC))
{
Int32 rectSuccess = GetWindowRect(hWindow, ref myRect);
if (Convert.ToBoolean(rectSuccess))
{
scrWidth = myRect.Right - myRect.Left;
scrHeight = myRect.Bottom - myRect.Top;

hDestinationDC = CreateCompatibleDC(hSourceDC);
if (Convert.ToBoolean(hDestinationDC))
{
hBitmap = CreateCompatibleBitmap(hSourceDC, scrWidth, scrHeight);
if (Convert.ToBoolean(hBitmap))
{
hOldBitmap = SelectObject(hDestinationDC, hBitmap);
BitBlt(hDestinationDC, 0, 0, scrWidth, scrHeight, hSourceDC, 0, 0, SRCCOPY);
myBitmap = Bitmap.FromHbitmap(new IntPtr(hBitmap));
DeleteObject(SelectObject(hDestinationDC, hOldBitmap));
}

DeleteDC(hDestinationDC);
}
}

ReleaseDC(hWindow, hSourceDC);
}
}

return myBitmap;
}

Newby

- Newby

Quote[17:32:45] * xar sets mode: -oooooooooo algorithm ban chris cipher newby stdio TehUser tnarongi|away vursed warz
[17:32:54] * xar sets mode: +o newby
[17:32:58] <xar> new rule
[17:33:02] <xar> me and newby rule all

Quote<TehUser> Man, I can't get Xorg to work properly.  This sucks.
<torque> you should probably kill yourself
<TehUser> I think I will.  Thanks, torque.