-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.lua
More file actions
45 lines (35 loc) · 1.23 KB
/
main.lua
File metadata and controls
45 lines (35 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
-- @Author: Ritesh Pradhan
-- @Date: 2016-04-08 13:51:34
-- @Last Modified by: Ritesh Pradhan
-- @Last Modified time: 2016-04-21 14:13:01
local physics = require( "widget" )
local physics = require( "physics" )
physics.start( )
physics.setGravity( 0, 0 )
-- physics.setDrawMode( 'hybrid' )
--------- globals and utils -----------
local hemeDatabox = require('libs.databox') -- This library automatically loads and saves it's storage into databox.json inside Documents directory
local sounds = require( "libs.sounds" );
local composer = require( "composer" )
local scene = composer.newScene()
-- -------------- Initialization -----------
hemeDatabox()
sounds.isSoundOn = hemeDatabox.isSoundOn
sounds.isMusicOn = hemeDatabox.isMusicOn
-- ------------------------------------------
local function enterMenu(event)
display.remove( hemeSplash );
hemeSplash = nil;
local sceneOpt = {
effect = "crossFade",
time = 1500
}
-- load first scene
composer.gotoScene( "scenes.menu", sceneOpt);
end
local hemeSplash = display.newImage( "images/splashScreen.png", display.contentCenterX, display.contentCenterY)
timer.performWithDelay(1000,
function()
transition.fadeOut( hemeSplash, {time=1000, onComplete=enterMenu} );
end
, 1)