HoldArrowKeys + RotateCamera
I noticed that I couldn't find a function to hold down more than one arrow key at once.
Cuz' a lot of times in real life I hold down more than one arrow key :p
Didn't know if there is one of these already or not but I couldn't find one..
So I made some arrow using procedures :)
Remember that just like in the SCAR functions:
0 = UP
1 = RIGHT
2 = DOWN
3 = LEFT
SCAR Code:
Procedure HoldArrowKeys(Arrows: TIntegerArray; Time: Integer);
{will hold all ARROWS simultaneously for amount of TIME in milliseconds
0 = UP
1 = RIGHT
2 = DOWN
3 = LEFT }
var
i : Integer;
begin
for i := 0 to High(Arrows) do
begin
if (Arrows[i] = 3) then IncEx(Arrows[i], 34) else
IncEx(Arrows[i], 38);
KeyDown(Arrows[i]);
end;
Wait(Time);
for i := 0 to High(Arrows) do
KeyUp(Arrows[i]);
end;
Procedure RotateCamera(Limited: Boolean);
//randomly rotates camera angle
var
Rand : Integer;
begin
if Limited then Rand := 4
else Rand := 8;
Case Random(Rand) of
0 : HoldArrowKeys([0, 1], RandomRange(953, 1463)); //up-right
1 : HoldArrowKeys([0, 3], RandomRange(953, 1463)); //up-left
2 : HoldArrowKeys([1, 2], RandomRange(953, 1463)); //down-right
3 : HoldArrowKeys([2, 3], RandomRange(953, 1463)); //down-left
4 : HoldArrowKeys([0], RandomRange(953, 1463)); //up
5 : HoldArrowKeys([1], RandomRange(953, 1463)); //right
6 : HoldArrowKeys([2], RandomRange(953, 1463)); //down
7 : HoldArrowKeys([3], RandomRange(953, 1463)); //left
end;
end;
EXAMPLES:
SCAR Code:
begin
HoldArrowKeys([0, 1], 1000);
//will hold up and right arrows for 1 second
HoldArrowKeys([2, 3], 1000);
//will hold down and left arrows for 1 second
RotateCamera(True);
//randomly moves camera angle using ONLY "double" arrows (more than one)
RotateCamera(False)
//randomly moves camera angle using BOTH "double" or "single" arrows
end.
:):)