
nazwasamochodu exec "skrypt.sqs"
- Kod: Zaznacz cały
#start
_dir=getdir _this
_cur1velx = velocity _this select 0
_cur1vely = velocity _this select 1
_vektor1 = sqrt((_cur1velx*_cur1velx)+(_cur1vely*_cur1vely))
~0.1
_cur2velx = velocity _this select 0
_cur2vely = velocity _this select 1
_vektor2 = sqrt((_cur2velx*_cur2velx)+(_cur2vely*_cur2vely))
_f=0
? _vektor2 + 0.15 > _vektor1 :_f=(_vektor1-_vektor2)*0.6;
? _vektor2 + 0.2 < _vektor1 :_f=(_vektor1-_vektor2)*0.3;
? _vektor2 < 0.15 :_f=0;
~0.05
hint format["w1:%1 \nw2:%2 \nspeed:%3 \nf:%4",_vektor1,_vektor2,speed _this,_f]
_this setvelocity [_cur2velx + sin(_dir)*(_f),_cur2vely + cos(_dir)*(_f) ,(velocity _this select 2)]
goto "start"
#to100
@speed _this > 0.01
hint "start"
_t1=time
@speed _this >= 100
_t2=time
_t=_t2-_t1
hint format["%1 \n%2",_t,speed _this]
exit