Newbie question - Visual Novel type setup not working!
Posted: Fri May 25, 2018 3:45 pm
Hi, I'm Swoffle - I've been trying lots of different things to solve this issue. None of them worked, so I thought: "Why not put my issue in the forums?". So here it is, folks:
I've given making a Visual Novel type game a shot - using the mighty jolly LÖVE engine! It's been going quite well, for now my code is set up so that the player has to press space to see the next image (in the future the player will also be able to, ofcourse, make choices). However, at the moment all I can do is press space three times before my code does nothing anymore. Here's the code for all you fine fellows wanting to help me: Many thanks in advance!
If you don't like taking the main.lua file, that's fine! You can find my code below:
local Intro1
local Intro2
local Intro3
local Louis1
local Louis2
local drawimage1 = true
local drawimage2 = false
local drawimage3 = false
local drawimageLouis1 = false
local drawimageLouis2 = false
function love.load()
Intro1 = love.graphics.newImage("Intro1.png")
drawimage1 = true
Intro2 = love.graphics.newImage("Intro2.png")
drawimage2 = false
Intro3 = love.graphics.newImage("Intro3.png")
drawimage3 = false
Louis1 = love.graphics.newImage("Louis1.png")
drawimageLouis1 = false
Louis2 = love.graphics.newImage("Louis2.png")
drawimageLouis2 = false
IntroMusic = love.audio.newSource("Night of Chaos.mp3")
IntroMusic:setVolume(0.3)
IntroMusic:setPitch(1)
end
function love.update(dt)
function love.keypressed( key )
if key == "space" then
IntroMusic:play()
if drawimage1 == true then
drawimage2 = true
drawimage1 = false
elseif drawimage2 == true then
if key == "space" then
drawimage3 = true
drawimage2 = false
elseif drawimage3 == true then
if key == "space" then
drawimageLouis1 = true
drawimage3 = false
elseif drawimageLouis1 == true then
if key == "space" then
drawimageLouis1 = false
drawimageLouis2 = true
elseif drawimageLouis2 == true then
if key == "space" then
end
end
end
end
end
end
end
end
function love.draw()
if drawimage1 == true then
love.graphics.draw(Intro1, 0, 0)
drawimageLouis1 = false
elseif drawimage2 == true then
love.graphics.draw(Intro2, 0, 0)
drawimage1 = false
elseif drawimage3 == true then
love.graphics.draw(Intro3, 0, 0)
drawimage2 = false
elseif drawimageLouis1 == true then
love.graphics.draw(Louis1, 0, 0)
drawimage3 = false
elseif drawimageLouis2 == true then
love.graphics.draw(Louis2, 0, 0)
drawimageLouis1 = false
end
end
I've given making a Visual Novel type game a shot - using the mighty jolly LÖVE engine! It's been going quite well, for now my code is set up so that the player has to press space to see the next image (in the future the player will also be able to, ofcourse, make choices). However, at the moment all I can do is press space three times before my code does nothing anymore. Here's the code for all you fine fellows wanting to help me: Many thanks in advance!
If you don't like taking the main.lua file, that's fine! You can find my code below:
local Intro1
local Intro2
local Intro3
local Louis1
local Louis2
local drawimage1 = true
local drawimage2 = false
local drawimage3 = false
local drawimageLouis1 = false
local drawimageLouis2 = false
function love.load()
Intro1 = love.graphics.newImage("Intro1.png")
drawimage1 = true
Intro2 = love.graphics.newImage("Intro2.png")
drawimage2 = false
Intro3 = love.graphics.newImage("Intro3.png")
drawimage3 = false
Louis1 = love.graphics.newImage("Louis1.png")
drawimageLouis1 = false
Louis2 = love.graphics.newImage("Louis2.png")
drawimageLouis2 = false
IntroMusic = love.audio.newSource("Night of Chaos.mp3")
IntroMusic:setVolume(0.3)
IntroMusic:setPitch(1)
end
function love.update(dt)
function love.keypressed( key )
if key == "space" then
IntroMusic:play()
if drawimage1 == true then
drawimage2 = true
drawimage1 = false
elseif drawimage2 == true then
if key == "space" then
drawimage3 = true
drawimage2 = false
elseif drawimage3 == true then
if key == "space" then
drawimageLouis1 = true
drawimage3 = false
elseif drawimageLouis1 == true then
if key == "space" then
drawimageLouis1 = false
drawimageLouis2 = true
elseif drawimageLouis2 == true then
if key == "space" then
end
end
end
end
end
end
end
end
function love.draw()
if drawimage1 == true then
love.graphics.draw(Intro1, 0, 0)
drawimageLouis1 = false
elseif drawimage2 == true then
love.graphics.draw(Intro2, 0, 0)
drawimage1 = false
elseif drawimage3 == true then
love.graphics.draw(Intro3, 0, 0)
drawimage2 = false
elseif drawimageLouis1 == true then
love.graphics.draw(Louis1, 0, 0)
drawimage3 = false
elseif drawimageLouis2 == true then
love.graphics.draw(Louis2, 0, 0)
drawimageLouis1 = false
end
end