<commit_before>package org.jtrfp.trcl.ai;

import java.awt.event.KeyEvent;

import org.jtrfp.trcl.KeyStatus;
import org.jtrfp.trcl.objects.Player;

public class UserInputRudderElevatorControlBehavior extends ObjectBehavior {
    @Override
    public void _tick(long tickTimeMillis){
	final Player p = (Player)getParent();
	final KeyStatus keyStatus = p.getTr().getKeyStatus();
	final RotationalMomentumBehavior rmb = p.getBehavior().probeForBehavior(RotationalMomentumBehavior.class);
	rmb.setEquatorialMomentum(0);
	rmb.setLateralMomentum(0);
	rmb.setPolarMomentum(0);
	if (keyStatus.isPressed(KeyEvent.VK_UP)){
		rmb.accelleratePolarMomentum(-2.*Math.PI*.003);
		}
	if (keyStatus.isPressed(KeyEvent.VK_DOWN)){
	    	rmb.accelleratePolarMomentum(2.*Math.PI*.003);
		}
	if (keyStatus.isPressed(KeyEvent.VK_LEFT)){
	    	//Tilt
		rmb.accellerateLateralMomentum(-2.*Math.PI*.003);
		//Turn
		rmb.accellerateEquatorialMomentum(2*Math.PI*.003);
		}
	if (keyStatus.isPressed(KeyEvent.VK_RIGHT)){
	    	//Tilt
		rmb.accellerateLateralMomentum(2.*Math.PI*.003);
		//Turn
		rmb.accellerateEquatorialMomentum(-2*Math.PI*.003);
		}
    }//end UserInputRudderElevatorControlBehavior
}<commit_msg>Fixed locked-velocity bug<commit_after>package org.jtrfp.trcl.ai;

import java.awt.event.KeyEvent;

import org.jtrfp.trcl.KeyStatus;
import org.jtrfp.trcl.objects.Player;

public class UserInputRudderElevatorControlBehavior extends ObjectBehavior {
    private  double accellerationFactor=.0005;
    @Override
    public void _tick(long tickTimeMillis){
	final Player p = (Player)getParent();
	final KeyStatus keyStatus = p.getTr().getKeyStatus();
	final RotationalMomentumBehavior rmb = p.getBehavior().probeForBehavior(RotationalMomentumBehavior.class);
	if (keyStatus.isPressed(KeyEvent.VK_UP)){
		rmb.accelleratePolarMomentum(-2.*Math.PI*accellerationFactor);
		}
	if (keyStatus.isPressed(KeyEvent.VK_DOWN)){
	    	rmb.accelleratePolarMomentum(2.*Math.PI*accellerationFactor);
		}
	if (keyStatus.isPressed(KeyEvent.VK_LEFT)){
	    	//Tilt
		rmb.accellerateLateralMomentum(-2.*Math.PI*accellerationFactor);
		//Turn
		rmb.accellerateEquatorialMomentum(2*Math.PI*accellerationFactor);
		}
	if (keyStatus.isPressed(KeyEvent.VK_RIGHT)){
	    	//Tilt
		rmb.accellerateLateralMomentum(2.*Math.PI*accellerationFactor);
		//Turn
		rmb.accellerateEquatorialMomentum(-2*Math.PI*accellerationFactor);
		}
    }//end UserInputRudderElevatorControlBehavior
    /**
     * @return the accellerationFactor
     */
    public double getAccellerationFactor() {
        return accellerationFactor;
    }
    /**
     * @param accellerationFactor the accellerationFactor to set
     */
    public void setAccellerationFactor(double accellerationFactor) {
        this.accellerationFactor = accellerationFactor;
    }
}
{'fraction_non_alphanumeric': 0.11836441893830703, 'fraction_numerical': 0.01327116212338594, 'mean_word_length': 4.883966244725738, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3022991', 'n_tokens_mistral': 1041, 'n_tokens_neox': 997, 'n_words': 128}