<commit_before>package com.gdxjam.behaviors.control;

import com.badlogic.ashley.core.Entity;
import com.badlogic.ashley.core.PooledEngine;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.math.MathUtils;
import com.badlogic.gdx.math.Vector2;
import com.gdxjam.components.Components;
import com.gdxjam.components.ControlComponent.ControlBehavior;
import com.gdxjam.components.SteerableComponent;
import com.gdxjam.components.SteeringBehaviorComponent;

/**
 * This is the movement behavior for the " saucer" ship which i called a
 * "Corvette"
 * 
 * @author alex-place
 * @author <NAME>
 * */
public class CorvetteControlBehavior implements ControlBehavior {

	PooledEngine engine;
	Entity entity;
	SteeringBehaviorComponent steer;
	SteerableComponent steerable;
	float speed = 150;

	// TODO make parameters (or a param class) for ship classes (speed...)
	public CorvetteControlBehavior(Entity entity, PooledEngine engine, float radius) {
		this.entity = entity;
		this.engine = engine;
		steer = Components.STEERING_BEHAVIOR.get(entity);
		steerable = engine.createComponent(SteerableComponent.class).init(Components.PHYSICS.get(entity).getBody(), radius);
		steerable.setIndependentFacing(true);
		steerable.setMaxLinearSpeed(5);
	}

	@Override
	public void forward(float delta) {
		steerable.getBody().setLinearVelocity(new Vector2(0, 0)); // remove
												// all
												// velocity
												// to
												// creat
												// instant
												// speed
												// change.
												// -Nate
		steerable.getBody().applyForce(new Vector2(0, speed * delta), steerable.getBody().getWorldCenter(), true);
	}

	@Override
	public void reverse(float delta) {
		steerable.getBody().setLinearVelocity(new Vector2(0, 0)); // remove
												// all
												// velocity
												// to
												// creat
												// instant
												// speed
												// change.
												// -Nate
		steerable.getBody().applyForce(new Vector2(0, -speed * delta), steerable.getBody().getWorldCenter(), true);
	}

	@Override
	public void left(float delta) {
		steerable.getBody().setLinearVelocity(new Vector2(0, 0)); // remove
												// all
												// velocity
												// to
												// creat
												// instant
												// speed
												// change.
												// -Nate
		steerable.getBody().applyForce(new Vector2(-speed * delta, 0), steerable.getBody().getWorldCenter(), true);

	}

	@Override
	public void right(float delta) {
		steerable.getBody().setLinearVelocity(new Vector2(0, 0)); // remove
												// all
												// velocity
												// to
												// creat
												// instant
												// speed
												// change.
												// -Nate
		steerable.getBody().applyForce(new Vector2(speed * delta, 0), steerable.getBody().getWorldCenter(), true);
	}

	@Override
	public void lookAt(Vector2 position) {
	}

	@Override
	public Entity getEntity() {
		// TODO Auto-generated method stub
		return entity;
	}

}
<commit_msg>fixed corvette<commit_after>package com.gdxjam.behaviors.control;

import com.badlogic.ashley.core.Entity;
import com.badlogic.ashley.core.PooledEngine;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.math.MathUtils;
import com.badlogic.gdx.math.Vector2;
import com.gdxjam.components.Components;
import com.gdxjam.components.ControlComponent.ControlBehavior;
import com.gdxjam.components.SteerableComponent;
import com.gdxjam.components.SteeringBehaviorComponent;

/**
 * This is the movement behavior for the " saucer" ship which i called a
 * "Corvette"
 * 
 * @author alex-place
 * @author <NAME>
 * */
public class CorvetteControlBehavior implements ControlBehavior {

	PooledEngine engine;
	Entity entity;
	SteeringBehaviorComponent steer;
	SteerableComponent steerable;
	float speed = 15000;

	// TODO make parameters (or a param class) for ship classes (speed...)
	public CorvetteControlBehavior(Entity entity, PooledEngine engine, float radius) {
		this.entity = entity;
		this.engine = engine;
		steer = Components.STEERING_BEHAVIOR.get(entity);
		steerable = engine.createComponent(SteerableComponent.class).init(Components.PHYSICS.get(entity).getBody(), radius);
		steerable.setIndependentFacing(true);
		steerable.setMaxLinearSpeed(5);
	}

	@Override
	public void forward(float delta) {
		steerable.getBody().applyForce(new Vector2(0, speed * delta), steerable.getBody().getWorldCenter(), true);
	}

	@Override
	public void reverse(float delta) {
		steerable.getBody().applyForce(new Vector2(0, -speed * delta), steerable.getBody().getWorldCenter(), true);
	}

	@Override
	public void left(float delta) {
		steerable.getBody().applyForce(new Vector2(-speed * delta, 0), steerable.getBody().getWorldCenter(), true);
	}

	@Override
	public void right(float delta) {
		steerable.getBody().applyForce(new Vector2(speed * delta, 0), steerable.getBody().getWorldCenter(), true);
	}

	@Override
	public void lookAt(Vector2 position) {
	}

	@Override
	public Entity getEntity() {
		// TODO Auto-generated method stub
		return entity;
	}

}

{'fraction_non_alphanumeric': 0.11867088607594936, 'fraction_numerical': 0.008306962025316455, 'mean_word_length': 3.17588769611891, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6743778', 'n_tokens_mistral': 1987, 'n_tokens_neox': 1559, 'n_words': 333}