Compare commits
No commits in common. "594e47ffd13d732cbd74f3921c5b02cf211b0d8f" and "cbf45ae44f25ce2a1c6e0029e6abfe179f25d324" have entirely different histories.
594e47ffd1
...
cbf45ae44f
4 changed files with 11 additions and 40 deletions
|
@ -1,16 +1,16 @@
|
||||||
local Object = require "classic"
|
local Object = require "classic"
|
||||||
local Button = Object:extend()
|
local Button = Object:extend()
|
||||||
|
|
||||||
function Button:new(x, y, r, b, c)
|
function Button:new(x, y, r, b)
|
||||||
self.x = x
|
self.x = x
|
||||||
self.y = y
|
self.y = y
|
||||||
self.r = r
|
self.r = r
|
||||||
self.b = b
|
self.b = b
|
||||||
self.c = c or {1, 1, 1}
|
|
||||||
self.press = false
|
self.press = false
|
||||||
end
|
end
|
||||||
|
|
||||||
function Button:update(dt)
|
function Button:update(dt)
|
||||||
|
|
||||||
if self.b == "triggerleft" or self.b == "triggerright" then
|
if self.b == "triggerleft" or self.b == "triggerright" then
|
||||||
if fightstick:getGamepadAxis(self.b) == 1 then
|
if fightstick:getGamepadAxis(self.b) == 1 then
|
||||||
self.press = true
|
self.press = true
|
||||||
|
@ -33,7 +33,6 @@ function Button:draw()
|
||||||
else
|
else
|
||||||
mode = "line"
|
mode = "line"
|
||||||
end
|
end
|
||||||
love.graphics.setColor(self.c)
|
|
||||||
love.graphics.circle(mode, self.x + self.r, self.y + self.r, self.r)
|
love.graphics.circle(mode, self.x + self.r, self.y + self.r, self.r)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
12
conf.lua
12
conf.lua
|
@ -1,14 +1,10 @@
|
||||||
WINDOWSCALE = 1
|
|
||||||
WINDOWWIDTH = 373*WINDOWSCALE
|
|
||||||
WINDOWHEIGHT = 212*WINDOWSCALE
|
|
||||||
BORDERLESS = true
|
|
||||||
BLACK = true
|
|
||||||
function love.conf(t)
|
function love.conf(t)
|
||||||
t.window.width = WINDOWWIDTH
|
t.window.width = 373
|
||||||
t.window.height = WINDOWHEIGHT
|
t.window.height = 212
|
||||||
t.window.borderless = BORDERLESS
|
t.window.borderless = true
|
||||||
t.window.title = "input display"
|
t.window.title = "input display"
|
||||||
t.window.icon = "icon.png"
|
t.window.icon = "icon.png"
|
||||||
|
|
||||||
t.modules.physics = false
|
t.modules.physics = false
|
||||||
|
|
||||||
end
|
end
|
BIN
icon.png
BIN
icon.png
Binary file not shown.
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 9.9 KiB |
30
main.lua
30
main.lua
|
@ -1,9 +1,9 @@
|
||||||
function love.load()
|
function love.load()
|
||||||
|
|
||||||
joysticks = love.joystick.getJoysticks()
|
joysticks = love.joystick.getJoysticks()
|
||||||
fightstick = joysticks[1]
|
fightstick = joysticks[1]
|
||||||
|
|
||||||
require("sdl")
|
require("sdl")
|
||||||
|
require("invis")
|
||||||
local Button = require "button"
|
local Button = require "button"
|
||||||
|
|
||||||
love.window.setPosition(1440, 960-373)
|
love.window.setPosition(1440, 960-373)
|
||||||
|
@ -16,7 +16,7 @@ function love.load()
|
||||||
Button(127, 144, 30, "dpup"),
|
Button(127, 144, 30, "dpup"),
|
||||||
}
|
}
|
||||||
|
|
||||||
--attack keys, add {x,x,x} value to change color of button
|
--attack keys
|
||||||
attack = {
|
attack = {
|
||||||
Button(159, 29, 24, "x"),
|
Button(159, 29, 24, "x"),
|
||||||
Button(208, 8, 24, "y"),
|
Button(208, 8, 24, "y"),
|
||||||
|
@ -29,31 +29,7 @@ function love.load()
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
--switches the borderless window setting, remembering the position
|
|
||||||
function love.keypressed(key)
|
|
||||||
if key == "space" then
|
|
||||||
if BORDERLESS then
|
|
||||||
BORDERLESS = false
|
|
||||||
love.window.setMode(WINDOWWIDTH, WINDOWHEIGHT, {borderless=false, x=windowx, y=windowy})
|
|
||||||
else
|
|
||||||
BORDERLESS = true
|
|
||||||
love.window.setMode(WINDOWWIDTH, WINDOWHEIGHT, {borderless=true, x=windowx, y=windowy})
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if key == "c" then
|
|
||||||
if BLACK then
|
|
||||||
BLACK = false
|
|
||||||
love.graphics.setBackgroundColor(0,1,0)
|
|
||||||
else
|
|
||||||
BLACK = true
|
|
||||||
love.graphics.setBackgroundColor(0,0,0)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function love.update(dt)
|
function love.update(dt)
|
||||||
windowx, windowy, _ = love.window.getPosition()
|
|
||||||
|
|
||||||
--movement keys
|
--movement keys
|
||||||
for i, v in ipairs(movement) do
|
for i, v in ipairs(movement) do
|
||||||
v:update(dt)
|
v:update(dt)
|
||||||
|
@ -66,7 +42,7 @@ function love.update(dt)
|
||||||
end
|
end
|
||||||
|
|
||||||
function love.draw()
|
function love.draw()
|
||||||
love.graphics.scale(WINDOWSCALE, WINDOWSCALE)
|
love.graphics.setBackgroundColor(1, 179/255, 102/255)
|
||||||
|
|
||||||
--movement keys
|
--movement keys
|
||||||
for i, v in ipairs(movement) do
|
for i, v in ipairs(movement) do
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue