I have no Idea any more
Added QOL thing Added list of things to do
This commit is contained in:
parent
d8a9484970
commit
b660611e8a
1 changed files with 57 additions and 21 deletions
|
@ -1,4 +1,31 @@
|
||||||
-- Load some default values for our agent.
|
-- Load some default values for our agent.
|
||||||
|
|
||||||
|
|
||||||
|
-- Reminder:
|
||||||
|
|
||||||
|
-- Add a non gun animation to the agent
|
||||||
|
|
||||||
|
-- Add intimidation value, and intimidation range (hopefully upgradable)
|
||||||
|
|
||||||
|
-- Add sprinting? Or just slow player down on pulling the gun out?
|
||||||
|
|
||||||
|
-- Add pouncing (or at least fix It)
|
||||||
|
|
||||||
|
-- Add/Fix Collisions
|
||||||
|
|
||||||
|
-- Fix the fucking gun
|
||||||
|
|
||||||
|
-- Seek professional mental help (I'm In pain)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
local r, g, b = love.math.colorFromBytes(132, 193, 238)
|
local r, g, b = love.math.colorFromBytes(132, 193, 238)
|
||||||
love.graphics.setBackgroundColor(r, g, b)
|
love.graphics.setBackgroundColor(r, g, b)
|
||||||
local timer = 0
|
local timer = 0
|
||||||
|
@ -12,7 +39,7 @@ function love.load()
|
||||||
local dbgcol = {1,1,1}
|
local dbgcol = {1,1,1}
|
||||||
-- THE RIGHT ONE WILL
|
-- THE RIGHT ONE WILL
|
||||||
-- It's on github
|
-- It's on github
|
||||||
|
vr = 0
|
||||||
|
|
||||||
-- collision thing
|
-- collision thing
|
||||||
guard = {x = 100, y = 100, width = 64, height = 64}
|
guard = {x = 100, y = 100, width = 64, height = 64}
|
||||||
|
@ -65,7 +92,7 @@ function love.load()
|
||||||
bullet = {}
|
bullet = {}
|
||||||
|
|
||||||
spawnBullets(0, 0, 500, 0, 100, 0, 2)
|
spawnBullets(0, 0, 500, 0, 100, 0, 2)
|
||||||
bullet_numer = 0
|
bullet_numer = 6
|
||||||
end
|
end
|
||||||
|
|
||||||
function spawnBullets(x, y, vx, vy, ax, ay, r)
|
function spawnBullets(x, y, vx, vy, ax, ay, r)
|
||||||
|
@ -105,11 +132,10 @@ end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function love.update(dt)
|
function love.update(dt)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
updateBullets(dt)
|
updateBullets(dt)
|
||||||
|
|
||||||
agent.y = agent.y + 0 --this is gravity here at play trust
|
agent.y = agent.y + 0 --this is gravity here at play trust
|
||||||
|
@ -119,6 +145,7 @@ function love.update(dt)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if agent.anim == agent.animations.right then -- making the gun work
|
if agent.anim == agent.animations.right then -- making the gun work
|
||||||
gun.x = agent.x + 60
|
gun.x = agent.x + 60
|
||||||
end
|
end
|
||||||
|
@ -192,41 +219,47 @@ end
|
||||||
agent.vy = 0
|
agent.vy = 0
|
||||||
end
|
end
|
||||||
|
|
||||||
--if checkCollision(agent, guard) then
|
if checkCollision(agent, guard) then
|
||||||
--t = 0 + 1
|
t = 0 + 1
|
||||||
--pouncing = true
|
--pouncing = true
|
||||||
--if pouncing == true then
|
--if pouncing == true then
|
||||||
--love.graphics.print("You're poucing, up to kill, down to knock out", 280, 10)
|
--love.graphics.print("You're poucing, up to kill, down to knock out", 280, 10)
|
||||||
--end
|
--end
|
||||||
|
|
||||||
--end
|
end
|
||||||
-- collision checker thingy
|
-- collision checker thingy
|
||||||
|
|
||||||
-- pain, suffering and bullets
|
-- pain, suffering and bullets
|
||||||
|
|
||||||
|
magazine()
|
||||||
|
|
||||||
if love.mouse.isDown(2) then
|
|
||||||
|
if love.mouse.isDown(2) and not disableShooting then
|
||||||
--if pouncing == false then
|
--if pouncing == false then
|
||||||
if disableShooting == false then
|
|
||||||
if agent.anim == agent.animations.right then
|
if agent.anim == agent.animations.right then
|
||||||
spawnBullets(gun.x, gun.y, 500, 0, 0, 0, 2)
|
spawnBullets(gun.x, gun.y, 500, 0, 0, 0, 2)
|
||||||
bullet_numer = bullet_numer + 1
|
bullet_numer = bullet_numer - 1
|
||||||
elseif agent.anim == agent.animations.left then
|
elseif agent.anim == agent.animations.left then
|
||||||
spawnBullets(gun.x, gun.y, -500, 0, 0, 0, 2)
|
spawnBullets(gun.x, gun.y, -500, 0, 0, 0, 2)
|
||||||
bullet_numer = bullet_numer + 1
|
bullet_numer = bullet_numer - 1
|
||||||
end
|
end
|
||||||
|
|
||||||
--end
|
--end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
-- I swear, these monkey wrenched solutions will stop working at some point, but for now we shall enjoy
|
-- I swear, these monkey wrenched solutions will stop working at some point, but for now we shall enjoy
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function magazine()
|
||||||
|
if bullet_numer <= 0 then
|
||||||
|
disableShooting = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
-- Draw a coloured rectangle.
|
-- Draw a coloured rectangle.
|
||||||
|
@ -242,6 +275,7 @@ function love.draw()
|
||||||
love.graphics.print(gun.y, 10, 260)
|
love.graphics.print(gun.y, 10, 260)
|
||||||
love.graphics.print(bullet_numer, 20, 300)
|
love.graphics.print(bullet_numer, 20, 300)
|
||||||
|
|
||||||
|
|
||||||
love.graphics.setColor(255, 174, 66)
|
love.graphics.setColor(255, 174, 66)
|
||||||
drawBullets()
|
drawBullets()
|
||||||
collider.draw()
|
collider.draw()
|
||||||
|
@ -254,8 +288,10 @@ function love.draw()
|
||||||
drawDottedArc(agent.x, agent.y, mouseX, mouseY)
|
drawDottedArc(agent.x, agent.y, mouseX, mouseY)
|
||||||
if mouseX > agent.x + 2 then
|
if mouseX > agent.x + 2 then
|
||||||
love.graphics.draw(agent.jumped, agent.x, agent.y, nil, 1)
|
love.graphics.draw(agent.jumped, agent.x, agent.y, nil, 1)
|
||||||
|
agent.anim = agent.animations.right
|
||||||
elseif mouseX < agent.x - 2 then
|
elseif mouseX < agent.x - 2 then
|
||||||
love.graphics.draw(agent.jumped_left, agent.x, agent.y, nil, 1)
|
love.graphics.draw(agent.jumped_left, agent.x, agent.y, nil, 1)
|
||||||
|
agent.anim = agent.animations.left
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- if guard.ok == true then
|
-- if guard.ok == true then
|
||||||
|
|
Loading…
Add table
Reference in a new issue