<commit_before><html>
<head>
<title>heart.js test</title>
<script src="heart.js"></script>
<script src="jquery-1.11.1.min.js"></script>
<script>
var MAP_NAME = "derp_walls2"
var matrix = null
var gObjects = []
var size = 6
var tile_width = 80
var tile_height = 36
var images = {}
var imageOffsets = {}
//var cameraX = 3375
//var cameraY = 105
var cameraX = 3640
var cameraY = 1560
var showHexOverlay = true

// tile grid geometry info
var transX = 48, transY = 24
var xdx = transX
var ydy = transY
var xdy = ydy - tile_height
var ydx = tile_width - xdx

// function tileToScreen(x, y) {
// 	var sx = x * xdx + y * ydx + 0
// 	var sy = x * xdy + y * ydy + 0
// 	return {x: sx, y: sy}
// }

function tileToScreen(x, y) {
   var sx = 4752 + (32 * y) - (48 * x);
   var sy = (24 * y) + (12 * x);

   return {x: sx, y: sy}
}

function tileFromScreen(x, y) {
	var determinant = xdx*ydy - xdy*ydx
	var tx = (x * ydy + y * -ydx) / determinant
	var ty = (x * -xdy + y * xdx) / determinant

	return {x: Math.round(tx), y: Math.round(ty) - 1}
}

// hex grid geometry info
var hexTileW = 32
var hexTileH = 16
var hexTransX = 16
var hexTransY = 12
var _hexOffsetX = 32
var _hexOffsetY = 10
var hexOffsetX = 0
var hexOffsetY = 0<commit_msg>fix tile geometry<commit_after><html>
<head>
<title>heart.js test</title>
<script src="heart.js"></script>
<script src="jquery-1.11.1.min.js"></script>
<script>
var MAP_NAME = "derp_walls2"
var matrix = null
var gObjects = []
var size = 6
var tile_width = 80
var tile_height = 36
var images = {}
var imageOffsets = {}
//var cameraX = 3375
//var cameraY = 105
// var cameraX = 3640
// var cameraY = 1560
var cameraX = 3490
var cameraY = 1200
var showHexOverlay = false

// tile grid geometry info
var transX = 48, transY = 24
var xdx = transX
var ydy = transY
var xdy = ydy - tile_height
var ydx = tile_width - xdx

function tileToScreen(x, y) {
	x = 99 - x // this algorithm expects x to be reversed
	var sx = 4752 + (32 * y) - (48 * x)
	var sy = (24 * y) + (12 * x)

   return {x: sx, y: sy}
}

function tileFromScreen(x, y) {
	var determinant = xdx*ydy - xdy*ydx
	var tx = (x * ydy + y * -ydx) / determinant
	var ty = (x * -xdy + y * xdx) / determinant

	return {x: Math.round(tx), y: Math.round(ty) - 1}
}

// hex grid geometry info
var hexTileW = 32
var hexTileH = 16
var hexTransX = 16
var hexTransY = 12
var _hexOffsetX = 32
var _hexOffsetY = 10
var hexOffsetX = 0
var hexOffsetY = 0
{'fraction_non_alphanumeric': 0.1391304347826087, 'fraction_numerical': 0.05134575569358178, 'mean_word_length': 3.12991452991453, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, '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': '1822112', 'n_tokens_mistral': 1061, 'n_tokens_neox': 948, 'n_words': 327}