aboutsummaryrefslogtreecommitdiff
path: root/scenes
diff options
context:
space:
mode:
authorIndrajith K L2022-03-21 21:41:57 +0530
committerIndrajith K L2022-03-21 21:41:57 +0530
commit2fdf16620ba5b3e888f70cee2bc1f6832814913d (patch)
tree8f43915041adb6a383a981ad7c89655b1f615cef /scenes
parent37bf7eab28727f428cf456c61f698e0a3be55bb0 (diff)
downloadYEAD-master.tar.gz
YEAD-master.tar.bz2
YEAD-master.zip
Player, Enemy AnimationsHEADmaster
Collision Changes
Diffstat (limited to 'scenes')
-rw-r--r--scenes/level1_scene.lua12
-rw-r--r--scenes/menu_scene.lua10
2 files changed, 15 insertions, 7 deletions
diff --git a/scenes/level1_scene.lua b/scenes/level1_scene.lua
index 58fb639..0519ca3 100644
--- a/scenes/level1_scene.lua
+++ b/scenes/level1_scene.lua
@@ -1,10 +1,12 @@
level1 = {} -- Level1 State
require("core.screen_shaker")
Map = require("core.map")
+--require("scenes.menu_scene")
+local Gamestate = require("libs.hump.gamestate")
-- imports
require("core.constants")
require("core.ambience")
-
+local map
function level1:init()
constants.resetColors()
screenShake = ScreenShaker()
@@ -13,6 +15,7 @@ function level1:init()
end
function level1:enter(previous)
+
end
function level1:update(dt)
@@ -27,10 +30,13 @@ end
function level1:keypressed(key, scancode)
map:keypressed(key, scancode)
+ if scancode=="r" then
+ love.audio.stop( )
+ Gamestate.switch(menu)
+ end
end
function level1:leave()
- map = nil
end
-return level1 \ No newline at end of file
+return level1
diff --git a/scenes/menu_scene.lua b/scenes/menu_scene.lua
index e90b805..5c30674 100644
--- a/scenes/menu_scene.lua
+++ b/scenes/menu_scene.lua
@@ -4,8 +4,6 @@ local Timer = require "libs.hump.timer"
local Gamestate = require("libs.hump.gamestate")
Moonshine = require("libs.moonshine")
require("core.constants")
--- scenes
-require("scenes.level1_scene");
local titleFontSize1 = 35
local titleFontSize2 = 40
@@ -18,7 +16,7 @@ function menu:init()
titleFont1 = love.graphics.newFont('assets/fonts/C800.ttf', titleFontSize1)
titleFont2 = love.graphics.newFont('assets/fonts/Lazer84.ttf', titleFontSize2)
startMsgFont = love.graphics.newFont('assets/fonts/C800.ttf', msgFontSize)
- music = love.audio.newSource("assets/music/Stevia Sphere - Drum machine dreams.ogg", "stream")
+ music = love.audio.newSource("assets/music/title.ogg", "stream")
titleText1 = love.graphics.newText(titleFont1, "Your Enemy is in Another")
titleText2 = love.graphics.newText(titleFont2, "Dungeon")
msgText = love.graphics.newText(startMsgFont, "Press X to START")
@@ -87,6 +85,10 @@ function menu:keyreleased(key, scancode)
end
end
+function love.touchpressed( id, x, y, dx, dy, pressure )
+ Gamestate.switch(level1)
+end
+
function generateStarfield()
image = love.graphics.newImage("assets/images/particle.png")
psystem = love.graphics.newParticleSystem(image, 2500)
@@ -104,4 +106,4 @@ function generateStarfield()
return psystem
end
-return menu \ No newline at end of file
+return menu