How about you subotai?
![Very Happy :D](./images/smilies/icon_biggrin.gif)
Moderator: Admin
Of course I did. I already wanted to answer, but I didn't have much time to test it (many pre-christmas partiespaul_nicholls wrote:So has anyone here tried The Probe yet? How about you subotai?
Code: Select all
Const
JOYAXIS_MAXVAL=25000;
...
IF Y<-JOYAXIS_MAXVAL then Move_Up else
IF Y>JOYAXIS_MAXVAL then Move_down else
IF X<-JOYAXIS_MAXVAL then Move_left else
IF X>JOYAXIS_MAXVAL then Move_right;
LOL No worries, I was just curious if anyone had tried it yetsubotai wrote:Of course I did. I already wanted to answer, but I didn't have much time to test it (many pre-christmas partiespaul_nicholls wrote:So has anyone here tried The Probe yet? How about you subotai?). Thanks for the upload!
Thanks for the kind words mate! I'm glad you like itsubotai wrote:I like the game. The scrolling is pretty smooth and the graphical effects are very nice (transparent acid with bubbles, laser beam, effect when collecting diamonds, etc.). I also like the elements.
Ah yeah, I need to change it so the editor can't put more than one Probe, or TLS emitter/receiver in the levels as that doesn't make much sense in the game as it standssubotai wrote:I remarked the following things:
When you use the editor and set more than one player, the first scanned player (probe) always gets the focus. But as you can only use one player for the moment, it doesn't make sense that a static element gets the focus for the scrolling.
I have actually fixed that glitch now, it will be in the next updatesubotai wrote:I would also disable the scrolling when you loose a life. Otherwise, the screen scrolls to the upper left.
hmm...interesting, I don't have an analog stick controller to test it with, only a digital joystick and game pad...subotai wrote:The gamepad conrol works good, as long as I don't use the analog stick of my gamepad. When releasing the analog stick, the player keeps moving.Code: Select all
Const JOYAXIS_MAXVAL=25000; ... IF Y<-JOYAXIS_MAXVAL then Move_Up else IF Y>JOYAXIS_MAXVAL then Move_down else IF X<-JOYAXIS_MAXVAL then Move_left else IF X>JOYAXIS_MAXVAL then Move_right;
Code: Select all
procedure TTheProbe.GetPlayerInput;
var
xpos,ypos,zpos: LongInt;
begin
FProbeEngine.MoveUp := xeEngine.Window.KeyIsDown(FConfiguration.Controls[GameKey_MoveUp]);
FProbeEngine.MoveDown := xeEngine.Window.KeyIsDown(FConfiguration.Controls[GameKey_MoveDown]);
FProbeEngine.MoveLeft := xeEngine.Window.KeyIsDown(FConfiguration.Controls[GameKey_MoveLeft]);
FProbeEngine.MoveRight := xeEngine.Window.KeyIsDown(FConfiguration.Controls[GameKey_MoveRight]);
FProbeEngine.Firing := PlayerFiring;
if FConfiguration.JoystickEnabled and (xeEngine.Window.GetGameControllersCount > 0) then
begin
xeEngine.Window.GetGameControllerXYZPositions(cDefaultGameController,xpos,ypos,zpos);
if not FProbeEngine.MoveUp and (ypos < -cMinControlMovement) then
FProbeEngine.MoveUp := True;
if not FProbeEngine.MoveDown and (ypos > +cMinControlMovement) then
FProbeEngine.MoveDown := True;
if not FProbeEngine.MoveLeft and (xpos < -cMinControlMovement) then
FProbeEngine.MoveLeft := True;
if not FProbeEngine.MoveRight and (xpos > +cMinControlMovement) then
FProbeEngine.MoveRight := True;
end;
end;
ok, cool...I am interested in what you come up withsubotai wrote:If I have time, I will try to build some levels.
It is rather quiet...I guess it is that time of yearsubotai wrote:P.S. : It's really very quit around here. Many silent readers
bull's eyepaul_nicholls wrote:Ahh...pre-christmas parties...HIC! hahaha...just kidding!
If you use a control pad, the values of the axis X/Y are always set to -1, when you release the control pad. The maximum values are about +/-32000. If you use an analog stick, these values are often higher/lower when you realease the analog stick (about +/-500 or even higher, not always -1). I think that the stick is not always in center position when you release it. Well, I don't know if these values differ with different gamepads/joysticks. I'm using the rumblepad II. Setting the minimum value of the axis to 25000 was just a guess. I think it can also be a bit lower, but should be about 20000.paul_nicholls wrote:I have similar code with my gamepad control input too, so I am unsure why it keeps the player moving yet...thanks for finding out that bug
Code: Select all
cMinControlMovement //about 20000..25000
Ah, ok...this is what my current value is right now:subotai wrote:bull's eyepaul_nicholls wrote:Ahh...pre-christmas parties...HIC! hahaha...just kidding!
If you use a control pad, the values of the axis X/Y are always set to -1, when you release the control pad. The maximum values are about +/-32000. If you use an analog stick, these values are often higher/lower when you realease the analog stick (about +/-500 or even higher, not always -1). I think that the stick is not always in center position when you release it. Well, I don't know if these values differ with different gamepads/joysticks. I'm using the rumblepad II. Setting the minimum value of the axis to 25000 was just a guess. I think it can also be a bit lower, but should be about 20000.paul_nicholls wrote:I have similar code with my gamepad control input too, so I am unsure why it keeps the player moving yet...thanks for finding out that bug
Just increase the value of the following variable and it should work:Don't worry, I can test it for youCode: Select all
cMinControlMovement //about 20000..25000
Code: Select all
cMinControlMovement = 200;
The ranges for my gamepads:SDL Documentation wrote:Structure Definition:
TSDL_JoyAxisEvent = record
type_: UInt8; // SDL_JOYAXISMOTION
which: UInt8; // The joystick device index
axis: UInt8; // The joystick axis index
value: Sint16; // The axis value (range: -32768 to 32767)
end;
Code: Select all
first gamepad:
-32513..+32506 (for both axis)
second gamepad:
-32513..+32767 (for both axis)
Can you play my game with your gamepad? I use 25000, but 20000 also works fine.paul_nicholls wrote:just so you know, 20000 works for me with my gamepad so hopefully all will be good for you too