Code: Select all
### Right Arrow ###
if((keyval(key:Left) == 0) && (keyval(key:Up) == 0) && (keyval(key:Down) == 0)) then(
I don't know exactly what I'm smoking, but suppose you were making a shooting game. A game where you can't walk and shoot at the same time. You could do
Code: Select all
If (KeyVal Key:Shoot >1)
then (
SetTag (Shoot,on)
Shoot
)
if (KeyVal Key:Move >1)
then (
if (CheckTag (Shoot,off))
then (Move)
else (Aim)
)
Code: Select all
script,TakeInputs,begin
if (KeyVal Key:shoot >1)
then (ReceivedShootInput := 1)
if (KeyVal Key:Move >1)
then (ReceivedMoveInput := 1)
end
script,ProcessInputs,begin
if (ReceivedShootInput)
then (
if (ReceivedMoveInput)
then (
Aim
Shoot
)
else (
Shoot
)
elseif (ReceivedMoveInput)
then (Move)
end
I feel like there's a HUGE point I'm forgetting or something I'm screwing up.
EDIT: Oh! I see my problem! In the first example, you've already shot BEFORE you've aimed. So if you were facing down, and in the same tick pressed Right+Fire, you'd fire and then turn right and die. In the second example, by waiting till all the inputs are in, you'd do the (hopefully more correct) aim THEN fire!