@@ -2,17 +2,25 @@ gameState = {time = 0}
marker = {}

function gameState.load()
ants.clear()
smallPlant()
plant.appendToGraph()
ants.testInit()
--plant.strikeRoots()
hudValueFont = love.graphics.newFont(30)
background.load()
hudValueFont = love.graphics.newFont(30)
end

function gameState.onEnter()
plant.stem = {}
plant.branches = {}
love.mouse.setPosition(love.window.getWidth()/2, love.window.getHeight()/2)
camera.position = {0, 0}

ants.clear()
smallPlant()
plant.appendToGraph()
ants.testInit()
plant.strikeRoots()

plant.headImageIndex = 1
plant.rootCanvas:clear(0, 0, 0, 0)
plant.rootLevel = 0
end

function gameState.update()
@@ -42,18 +50,21 @@ function gameState.update()
resources.glucose = resources.glucose + simulationDt * 2.0 * leaves
resources.h2o = resources.h2o - simulationDt * leaves
end

if music:tell("seconds") > 150.336 then
music:seek(14.780 + music:tell("seconds") - 150.336, "seconds")
end
end


resources = {
h2o = 100,
glucose = 100,
minerals = 100
h2o = 1000,
glucose = 1000,
minerals = 1000
}


function gameState.draw()
-- Game World
function drawGame()
-- Game World
love.graphics.setColor(100,136,240)
love.graphics.rectangle("fill", 0, 0, love.window.getWidth(), love.window.getHeight())
love.graphics.setColor(255, 255, 255, 255)
@@ -83,7 +94,8 @@ function gameState.draw()
plant.targetShake = 0.0
plant.defaultFace()
end, 2.0)
end
end,
image = abilityIcons.shake,
}
end

@@ -94,7 +106,8 @@ function gameState.draw()
plant.strikeRoots()
plant.happyFace()
lush.play("ability.wav")
end
end,
image = abilityIcons.root,
}
end

@@ -111,6 +124,11 @@ function gameState.draw()

-- Interface
textWidgets.draw()
end


function gameState.draw()
drawGame()

-- love.graphics.setLineWidth(2)
-- love.graphics.setColor(255, 255, 255, 255)
@@ -142,11 +160,4 @@ function gameState.draw()
end

function gameState.keypressed(key)
if key == "u" then plant.screamFace() end
if key == "i" then plant.sadFace() end
if key == "o" then plant.defaultFace() end
if key == "p" then plant.happyFace() end
if key == "up" then plant.headImageIndex = clamp(plant.headImageIndex + 1, 1,3); lush.play("levelup.wav", {tags = {}}) end
if key == "down" then plant.headImageIndex = clamp(plant.headImageIndex - 1, 1,3) end
if key == "n" then plant.strikeRoots() end
end
@@ -0,0 +1,82 @@
startState = {time = 0}

function startState.load()
shoe = love.graphics.newImage("images/boot.png")
titel = love.graphics.newImage("images/Titel.png")
bigFont = love.graphics.newFont(32)
smallFont = love.graphics.newFont(18)
shoePos, shoeVel = -6000, 0
end

function startState.onEnter()
generatePlant()

plant.headImageIndex = 3
plant.rootCanvas:clear(0, 0, 0, 0)
for i = 1, 6 do plant.strikeRoots() end
plant.happyFace()
end

shoeScale = 2.3

function startState.update()
camera.move(0, -1)
plant.update(simulationDt)
--camera.control(simulationDt, 1000)
if music:tell("seconds") > 9.674 then
music:seek(3.993 + music:tell("seconds") - 9.674, "seconds")
end

if shoeFall then
shoeVel = shoeVel + 10000 * simulationDt
shoePos = shoePos + shoeVel * simulationDt
end
if shoePos > -shoe:getHeight() * shoeScale + 200 then
shoePos = -shoe:getHeight() * shoeScale + 200
music:pause()
delay(function() enterState(gameState) end, 3.0)
end
end

function startState.keypressed(key)
lush.play("shoe.wav")
delay(function() shoeFall = true end, 2.0)
end

function startState.draw()
drawGame()
camera.push()
love.graphics.draw(shoe, -650*shoeScale, shoePos, 0, shoeScale, shoeScale)
camera.pop()

local curFont = love.graphics.getFont()
love.graphics.setFont(bigFont)
if not shoeFall then
love.graphics.draw(titel, love.window.getWidth()/2 - titel:getWidth()/2, love.window.getHeight()/2 - titel:getHeight()/2)
local t = "This game was developed as part of Indie Speed Run 2015 (www.indiespeedrun.com)"
shadowText(t, love.window.getWidth()/2 - bigFont:getWidth(t)/2, 5)
local start = "Press any key to start"
if math.sin(currentState.time*5.0) > 0 then
shadowText(start, love.window.getWidth()/2 - bigFont:getWidth(start)/2, love.window.getHeight() - bigFont:getHeight()*4)
end

love.graphics.setFont(smallFont)
lines = {
"Programming - Joel Schumacher",
"Art - Lukas Schnitzler",
"Programming - Markus Over",
"Music - Philipp Koerver",
}
for i = 1, 4 do
shadowText(lines[i], love.window.getWidth() - smallFont:getWidth(lines[i]) - 5, love.window.getHeight() - i * 30)
end
end
love.graphics.setFont(curFont)
end

function shadowText(t, x, y)
love.graphics.setColor(0, 0, 0, 255)
love.graphics.print(t, x+2, y+2)
love.graphics.setColor(255, 255, 255, 255)
love.graphics.print(t, x, y)
end
@@ -32,4 +32,14 @@ Blätter streicheln
Markus:


Partikel: Schuh, Mampfen, Levelup, neue Dinger
Partikel: Schuh, Mampfen, Levelup, neue Dinger

----------------



Wetter (1h)
Raupe (wenn Lukas es packt) (1h)
Pilze (1h)
Spinne (1,5)
Giftige Blätter