catlover444
2012-04-06 20:54:25
Wanted to get some practice with syntax and format before I started doing anything complicated for RS.
http://www.albinoblacksheep.com/games/curveball
wanted to try global/ local values so forgive me for putting z, t outside the main loop. The value that looks for the ball usually ends up in the top right. So I did a coordinate correction to get to center so that less balls would fly out the bottom right. The mouse continually follows ball position [z, t] and checks mousepos such that at a certain position it activates a script to serve (left mouse click).
Stable until level 8 at which point balls go out of left side. Considering moving coordinate position slightly left but concerned that they will fly out right side. Then I considered two if statements, one for ball position on left side of box and one for ball position on right side of box.
I'm wondering if there is a way to add a spin to the ball (jerk ball slightly) right before serve. I'd have to get down perfect volley though and then find a way to determine when ball is about to volley (maybe due to slight color change of the racket shadowing the ball).
Critique is always accepted.
http://www.albinoblacksheep.com/games/curveball
program CurveBall;
procedure StartGame;
begin
MoveMouse(261, 183);
ClickMouse(261, 183, 1);
Wait(500);
MoveMouse(284, 199);
ClickMouse(284, 199, 1);
Wait(1000);
End;
procedure BounceTheBall;
var
x, y:integer;
begin
if FindColorSpiralTolerance(x, y, 10092460 , 56 , 47 , 485 , 337, 10) then
begin
MoveMouse(x+19, y+12);
end;
End;
Procedure Serve;
begin
MoveMouse(282, 200);
ClickMouse(282, 200, 1);
End;
var
z, t:integer;
begin;
StartGame;
repeat
BounceTheBall;
GetMousePos(z, t);
if [z, t]= [263+19, 188+12] then
Serve;
until(false);
end.
wanted to try global/ local values so forgive me for putting z, t outside the main loop. The value that looks for the ball usually ends up in the top right. So I did a coordinate correction to get to center so that less balls would fly out the bottom right. The mouse continually follows ball position [z, t] and checks mousepos such that at a certain position it activates a script to serve (left mouse click).
Stable until level 8 at which point balls go out of left side. Considering moving coordinate position slightly left but concerned that they will fly out right side. Then I considered two if statements, one for ball position on left side of box and one for ball position on right side of box.
I'm wondering if there is a way to add a spin to the ball (jerk ball slightly) right before serve. I'd have to get down perfect volley though and then find a way to determine when ball is about to volley (maybe due to slight color change of the racket shadowing the ball).
Critique is always accepted.