--
-- Project: menu.lua
-- Description: 
--
-- Version: 1.0
-- Managed with http://CoronaProjectManager.com
--
-- Copyright 2014 Paul Graham. All Rights Reserved.
-- 
local menu = require "menu"
	function end_menu()
		menu = false
		--play_button:removeEventListener("tap", end_menu)
		next_scene = "miners"
		play_end = display.newImage(menu_group,"play_active.png")
		play_end.x = w/2
		play_end.y = h/2+130
		play_end:scale(.8,.8)
		play_end.alpha = 0transition.to(play_end,{time = 500, alpha = 1})
		transition.to(about,{time = 500, alpha = 0})
		transition.to(settings,{time = 500, alpha = 0})
		transition.to(play_button,{time = 500, alpha = 0})
		timer.performWithDelay ( 600, change_scene)
	end
	
	function go_about()
		menu = false
		--about:removeEventListener("tap", go_about)
		next_scene = "about"
		play_end = display.newImage(menu_group,"play_active.png")
		play_end.x = w/5
		play_end.y = h/2+180
		play_end:scale(.75,.75)
		play_end.alpha = 0
		transition.to(play_end,{time = 500, alpha = 1})
		transition.to(about,{time = 500, alpha = 0})
		transition.to(settings,{time = 500, alpha = 0})
		transition.to(play_button,{time = 500, alpha = 0})
		--transition.to(menu_group,{time = 500, alpha = 0})
		timer.performWithDelay ( 600, change_scene)
	end
	
	function go_settings()
		menu = false
		--settings:removeEventListener("tap", go_settings)
		next_scene = "settings"
		play_end = display.newImage(menu_group,"play_active.png")
		play_end.x = settings.x
		play_end.y = settings.y
		play_end:scale(.75,.75)
		play_end.alpha = 0
		transition.to(play_end,{time = 500, alpha = 1})
		transition.to(about,{time = 500, alpha = 0})
		transition.to(settings,{time = 500, alpha = 0})
		transition.to(play_button,{time = 500, alpha = 0})
		--transition.to(menu_group,{time = 500, alpha = 0})
		timer.performWithDelay ( 600, change_scene)
	end