<commit_before>import Tile

class Entity(object):

	def __init__(self,level,x,y):
		self.level=level
		self.x=x
		self.y=y
		self.centreX = x
		self.centreY = y
		self.ticks = 0
		self.steps = 0
		self.movingDir = 0

	def tick(self):
                self.ticks+=1

	def move(self,xa,ya):
		if xa != 0 and ya != 0:
			self.move(xa, 0)
			self.move(0, ya)

			return True

		if not self.hasCollided(xa, ya):
			if ya < 0:
				self.movingDir = 1
			if ya > 0:
				self.movingDir = 0
			if xa < 0:
				self.movingDir = 2
			if xa > 0:
				self.movingDir = 3

			if self.ticks%self.getTileUnder().getSpeed() ==0:
                                self.x += xa
                                self.y += ya
				self.steps+=1


			return False


		return True


	def getTileUnder(self):
		return self.level.getTile(self.centreX>>5, self.centreY>>5)


	def hasCollided(self,xa, ya):
		return False

	def isSolidTile(self,xa, ya, x, y):
		lastTile = self.level.getTile((self.x + x) >>5, (self.y + y) >>5)
		nextTile = self.level.getTile((self.x + x + xa) >>5,(self.y + y + ya) >> 5)
		if not self.level.canPassTile(nextTile,(self.x + x + xa) >>5,(self.y + y + ya) >> 5,self):
			return True

		return False<commit_msg>Fixed stuck in wall bug<commit_after>import Tile

class Entity(object):

	def __init__(self,level,x,y):
		self.level=level
		self.x=x
		self.y=y
		self.centreX = x
		self.centreY = y
		self.ticks = 0
		self.steps = 0
		self.movingDir = 0

	def tick(self):
                self.ticks+=1

	def move(self,xa,ya):
		if xa != 0 and ya != 0:
			self.move(xa, 0)
			self.move(0, ya)

			return True

		if not self.hasCollided(xa, ya):
			if ya < 0:
				self.movingDir = 1
			if ya > 0:
				self.movingDir = 0
			if xa < 0:
				self.movingDir = 2
			if xa > 0:
				self.movingDir = 3

			if self.ticks%self.getTileUnder().getSpeed() ==0:
                                self.x += xa
                                self.y += ya
				self.steps+=1


			return False


		return True


	def getTileUnder(self):
		return self.level.getTile(self.centreX>>5, self.centreY>>5)


	def hasCollided(self,xa, ya):
		return False

	def isSolidTile(self,xa, ya, x, y):
		lastTile = self.level.getTile((self.x + x) >>5, (self.y + y) >>5)
		nextTile = self.level.getTile((self.x + x + xa) >>5,(self.y + y + ya) >> 5)
		if lastTile != nextTile and nextTile.isSolid:
			return True
		for i in self.level.entitiesOnTiles:
			if i == ((self.x + x + xa) >>5,(self.y + y + ya) >> 5):
				return True

		return False
{'fraction_non_alphanumeric': 0.14572460859092734, 'fraction_numerical': 0.020875150541951024, 'mean_word_length': 2.2447916666666665, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 39, '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': '993778', 'n_tokens_mistral': 1154, 'n_tokens_neox': 965, 'n_words': 244}