improve bounce
This commit is contained in:
parent
a6ca7206a7
commit
669bf5c9b5
1 changed files with 5 additions and 10 deletions
|
@ -26,7 +26,6 @@ SX=0
|
||||||
SY=0
|
SY=0
|
||||||
XDIR=0
|
XDIR=0
|
||||||
YDIR=0
|
YDIR=0
|
||||||
XORY=0
|
|
||||||
BOUNCESTEP=2
|
BOUNCESTEP=2
|
||||||
|
|
||||||
## end bounce
|
## end bounce
|
||||||
|
@ -287,8 +286,6 @@ flootworker()
|
||||||
test -z $X_MAX && X_MAX=800
|
test -z $X_MAX && X_MAX=800
|
||||||
test -z $Y_MAX && Y_MAX=600
|
test -z $Y_MAX && Y_MAX=600
|
||||||
|
|
||||||
if [ $XORY == 0 ]
|
|
||||||
then
|
|
||||||
if [ $XDIR == 0 ]
|
if [ $XDIR == 0 ]
|
||||||
then
|
then
|
||||||
SX=$(($SX+$BOUNCESTEP))
|
SX=$(($SX+$BOUNCESTEP))
|
||||||
|
@ -297,8 +294,7 @@ flootworker()
|
||||||
SX=$(($SX-$BOUNCESTEP))
|
SX=$(($SX-$BOUNCESTEP))
|
||||||
test $SX -eq 0 && XDIR=0
|
test $SX -eq 0 && XDIR=0
|
||||||
fi
|
fi
|
||||||
XORY=1
|
|
||||||
else
|
|
||||||
if [ $YDIR == 0 ]
|
if [ $YDIR == 0 ]
|
||||||
then
|
then
|
||||||
SY=$(($SY+$BOUNCESTEP))
|
SY=$(($SY+$BOUNCESTEP))
|
||||||
|
@ -307,8 +303,7 @@ flootworker()
|
||||||
SY=$(($SY-$BOUNCESTEP))
|
SY=$(($SY-$BOUNCESTEP))
|
||||||
test $SY -eq 0 && YDIR=0
|
test $SY -eq 0 && YDIR=0
|
||||||
fi
|
fi
|
||||||
XORY=0
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "$(shuf_xy $SX $SY)
|
echo "$(shuf_xy $SX $SY)
|
||||||
|
|
Loading…
Reference in a new issue