<commit_before>package com.ezardlabs.lostsector.objects.projectiles;

import com.ezardlabs.dethsquare.Collider;
import com.ezardlabs.dethsquare.GameObject;
import com.ezardlabs.dethsquare.Physics;
import com.ezardlabs.dethsquare.Physics.RaycastHit;
import com.ezardlabs.dethsquare.RectF;
import com.ezardlabs.dethsquare.Script;
import com.ezardlabs.dethsquare.Vector2;
import com.ezardlabs.dethsquare.multiplayer.Network;
import com.ezardlabs.lostsector.Game.DamageType;
import com.ezardlabs.lostsector.objects.enemies.Enemy;

public class LankaBeam extends Script {
	private long chargeTime;
	private float direction;
	private long startTime;
	private int width;

	public LankaBeam(long chargeTime) {
		this.chargeTime = chargeTime;
	}

	@Override
	public void start() {
		startTime = System.currentTimeMillis();
		RaycastHit hit = Physics.raycast(transform.position, new Vector2(1, 0), Float.MAX_VALUE);
		width = (int) Math.abs(transform.position.x - hit.point.x);
		if (direction < 0) transform.position.x -= width;
		gameObject.renderer.setSize(width, 0);
		gameObject.renderer.setzIndex(3);
	}

	@Override
	public void update() {
		float halfHeight = ((System.currentTimeMillis() - startTime) / (float) chargeTime) * 9f;
		if (System.currentTimeMillis() - startTime < chargeTime) {
			gameObject.renderer.setSize(width, (int) (halfHeight * 2));
			gameObject.renderer.setOffsets(0, (int) -halfHeight);
		} else {
			gameObject.renderer.setImage("images/white.png", width, halfHeight * 2);<commit_msg>Update to work with new raycast method<commit_after>package com.ezardlabs.lostsector.objects.projectiles;

import com.ezardlabs.dethsquare.Collider;
import com.ezardlabs.dethsquare.GameObject;
import com.ezardlabs.dethsquare.Physics;
import com.ezardlabs.dethsquare.Physics.RaycastHit;
import com.ezardlabs.dethsquare.RectF;
import com.ezardlabs.dethsquare.Script;
import com.ezardlabs.dethsquare.Vector2;
import com.ezardlabs.dethsquare.multiplayer.Network;
import com.ezardlabs.lostsector.Game.DamageType;
import com.ezardlabs.lostsector.objects.enemies.Enemy;

public class LankaBeam extends Script {
	private long chargeTime;
	private float direction;
	private long startTime;
	private int width;

	public LankaBeam(long chargeTime) {
		this.chargeTime = chargeTime;
	}

	@Override
	public void start() {
		startTime = System.currentTimeMillis();
		RaycastHit hit = Physics
				.raycast(transform.position, new Vector2(1 * direction, 0), Float.MAX_VALUE,
						"solid");
		width = (int) Math.abs(transform.position.x - hit.point.x);
		if (direction < 0) transform.position.x -= width;
		gameObject.renderer.setSize(width, 0);
		gameObject.renderer.setzIndex(3);
	}

	@Override
	public void update() {
		float halfHeight = ((System.currentTimeMillis() - startTime) / (float) chargeTime) * 9f;
		if (System.currentTimeMillis() - startTime < chargeTime) {
			gameObject.renderer.setSize(width, (int) (halfHeight * 2));
			gameObject.renderer.setOffsets(0, (int) -halfHeight);
		} else {
			gameObject.renderer.setImage("images/white.png", width, halfHeight * 2);
{'fraction_non_alphanumeric': 0.11730205278592376, 'fraction_numerical': 0.007168458781362007, 'mean_word_length': 5.2525458248472505, 'pattern_counts': {'":': 0, '<': 7, '<?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': '4046708', 'n_tokens_mistral': 1103, 'n_tokens_neox': 1040, 'n_words': 200}