Exemplo n.º 1
0
Arquivo: maze.py Projeto: kxtells/Maze
def colision_handling():
	if PLAYER.rect.colliderect(LEVEL.END) and len(LEVEL.CHECKPOINTS)==0:
		MESSAGE.set_text(get_end_string())
		SOUNDS.play_fx(12)
		PLAYER.set_to_start()
		new_level()
	
	maze_colision()
	checkpoints_colision()
Exemplo n.º 2
0
Arquivo: maze.py Projeto: kxtells/Maze
def checkpoints_colision():
	for index,c in enumerate(LEVEL.CHECKPOINTS):
		if PLAYER.rect.colliderect(c):
			LEVEL.VISITED.append(LEVEL.CHECKPOINTS.pop(index))
			MESSAGE.set_text(get_checkpoint_string(len(LEVEL.VISITED)))
			if len(LEVEL.CHECKPOINTS) > 0:
				SOUNDS.play_fx(1)
			else:
				SOUNDS.play_fx(2)
Exemplo n.º 3
0
Arquivo: maze.py Projeto: kxtells/Maze
def maze_colision():
	collided = False

	for r in LEVEL.MAZERECTS:
		if PLAYER.rect.colliderect(r):
			collided = True

	if PLAYER.rect.x < 0 \
	or PLAYER.rect.y <0 \
	or PLAYER.rect.x > width\
	or PLAYER.rect.y > height:
		collided = True
	
	if collided:
		SOUNDS.play_fx(0)
		MESSAGE.set_text(get_death_string(len(LEVEL.VISITED)))
		PLAYER.set_to_start()
		LEVEL.reset()
Exemplo n.º 4
0
	def move_right(self):
 		self.my = 0
		self.mx = self.speed 
		self.add_point_to_path(self.rect.center)
		if self.sounds: SOUNDS.play_fx(11)