<commit_before>/**
 * 
 */
package snake;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Toolkit;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.awt.image.BufferedImage;

import javax.swing.JPanel;

/**
 * @author Aaron
 * @author Ryan
 *
 */
@SuppressWarnings("serial")
public class GamePanel extends JPanel implements Runnable, KeyListener {
	//Dimensions
	private double screenWidth = Toolkit.getDefaultToolkit().getScreenSize().getWidth();
	private double screenHeight = Toolkit.getDefaultToolkit().getScreenSize().getHeight();
	public static int WIDTH = 640;
	public static int HEIGHT = 512;
	public static double SCALE;
		
	//Properties
	public static final String TITLE = "Snake";
	public static final String VERSION = "3.0.1";
	private boolean debug = false;
		
	//Image
	private BufferedImage image;
	private Graphics2D g2d;
	
	//Thread
	private Thread thread;
	private boolean running;
	private int TargetFPS = 60;	
	private int FPS;
	private long targetTime = 1000 / TargetFPS;
	
	private Grid grid = new Grid();

	/**
	 * 
	 */
	public GamePanel() {
		//Calculate scaling
		if(Math.abs(screenWidth / screenHeight - 16.0f / 9.0f) / (16.0f / 9.0f) < 0.0005f){
			SCALE = ((int) (screenWidth / 1360 / 0.25)) * 0.25;
		} else if(screenWidth / screenHeight - (16.0f / 9.0f) / (16.0f / 9.0f) > 0.0005f){
			SCALE = ((int) (screenHeight / 1360 / 0.25)) * 0.25;
		} else if(screenWidth / screenHeight - (16.0f / 9.0f) / (16.0f / 9.0f) < -0.0005f){
			SCALE = ((int) (screenWidth / 765 / 0.25)) * 0.25;
		}
		//Scales the width and height<commit_msg>Change version number<commit_after>/**
 * 
 */
package snake;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Toolkit;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.awt.image.BufferedImage;

import javax.swing.JPanel;

/**
 * @author Aaron
 * @author Ryan
 *
 */
@SuppressWarnings("serial")
public class GamePanel extends JPanel implements Runnable, KeyListener {
	//Dimensions
	private double screenWidth = Toolkit.getDefaultToolkit().getScreenSize().getWidth();
	private double screenHeight = Toolkit.getDefaultToolkit().getScreenSize().getHeight();
	public static int WIDTH = 640;
	public static int HEIGHT = 512;
	public static double SCALE;
		
	//Properties
	public static final String TITLE = "Snake";
	public static final String VERSION = "3.1.1";
	private boolean debug = false;
		
	//Image
	private BufferedImage image;
	private Graphics2D g2d;
	
	//Thread
	private Thread thread;
	private boolean running;
	private int TargetFPS = 60;	
	private int FPS;
	private long targetTime = 1000 / TargetFPS;
	
	private Grid grid = new Grid();

	/**
	 * 
	 */
	public GamePanel() {
		//Calculate scaling
		if(Math.abs(screenWidth / screenHeight - 16.0f / 9.0f) / (16.0f / 9.0f) < 0.0005f){
			SCALE = ((int) (screenWidth / 1360 / 0.25)) * 0.25;
		} else if(screenWidth / screenHeight - (16.0f / 9.0f) / (16.0f / 9.0f) > 0.0005f){
			SCALE = ((int) (screenHeight / 1360 / 0.25)) * 0.25;
		} else if(screenWidth / screenHeight - (16.0f / 9.0f) / (16.0f / 9.0f) < -0.0005f){
			SCALE = ((int) (screenWidth / 765 / 0.25)) * 0.25;
		}
		//Scales the width and height
{'fraction_non_alphanumeric': 0.13770294648226097, 'fraction_numerical': 0.05532170775706555, 'mean_word_length': 3.4538152610441766, 'pattern_counts': {'":': 0, '<': 7, '<?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': '5405679', 'n_tokens_mistral': 1311, 'n_tokens_neox': 1150, 'n_words': 311}