def main():
	""" Main function, called at start :P
	"""
	print("Welcome to Heart Matters!")
	width = 1024
	height = 768
	size = width, height
	gameOver = False

	# The screen is a pygame surface object.
	screen = pygame.display.set_mode(size, pygame.RESIZABLE)
	pygame.display.set_caption('Heart Matters')
	sound = SoundObject("heartbeat.ogg", (0,0))
	titleScreen(screen,"thtmInfoScreen1.png")#, "heartbeat.ogg") # Instruction page.
	titleScreen(screen,"thtmInfoScreen2.png")#, "heartbeat.ogg") # Story page.
	sound.stopSound()
	sound = None
	hmgame = HMGame(screen) # <- init game

	running = True
	while running:
		hmgame.update()
		if DEBUG > 2:
			print(pygame.time.get_ticks())
		if pygame.time.get_ticks() > 30000:
			hmgame = None
			sound = SoundObject("Cardiac_Arrest(Sampler).ogg", (0,0))
			titleScreen(screen,"thtmULostScreen.png")#, "Cardiac_Arrest(Sampler).ogg")
			titleScreen(screen,"thtmCredits1.png")#, "Cardiac_Arrest(Sampler).ogg")
			titleScreen(screen,"thtmCredits2.png")#, "Cardiac_Arrest(Sampler).ogg")
			sound.stopSound()
			sound = None
			running = False
Example #2
0
def main():
	""" Main function, called at start :P
	"""
	print("Welcome to Heart Matters!")
	width = 1024
	height = 768
	size = width, height
	gameOver = False
	clock = pygame.time.Clock()

	# The screen is a pygame surface object.
	screen = pygame.display.set_mode(size, pygame.RESIZABLE)
	pygame.display.set_caption('Heart Matters')
	titleScreen(screen,"thtmInfoScreen1.png", "heartbeat.ogg") # <- starts Title screen
	titleScreen(screen,"thtmInfoScreen2.png", "heartbeat.ogg") # <- starts Title screen
	hmgame = HMGame(screen) # <- init game

	#for background music: ->
	#backgroundSound = pygame.mixer.Sound("res/sound/Spooky Theme.ogg")
	#backgroundSound.play(-1)

	while 1:
		hmgame.update()
		if clock.tick() > 30000:
			hmgame.QUIT()
			titleScreen(screen,"barrel.png", "Cardiac_Arrest(Sampler).ogg")
			hmgame = HMGame(screen)