Develop #4
@@ -79,6 +79,32 @@ function bell.update(dt, game, cam)
|
||||
end
|
||||
end
|
||||
end
|
||||
-- Logic
|
||||
local num_enable = 0
|
||||
for key, bell in pairs(bells) do
|
||||
for key, item in pairs(bell.enable) do
|
||||
-- Count enables
|
||||
num_enable = num_enable + 1
|
||||
-- if key == 1 and item and bell.enable[tools.table_length(bell.enable)] == false then
|
||||
-- end
|
||||
end
|
||||
if num_enable > 1 then
|
||||
-- Search emptys
|
||||
local count_singles = 0
|
||||
for key, item in pairs(bell.enable) do
|
||||
if key > 1 and bell.enable[key] and bell.enable[key - 1] == false then
|
||||
count_singles = count_singles + 1
|
||||
end
|
||||
end
|
||||
if count_singles >= 2 then
|
||||
for key, item in pairs(bell.enable) do
|
||||
bell.enable[key] = false
|
||||
end
|
||||
end
|
||||
count_singles = 0
|
||||
end
|
||||
num_enable = 0
|
||||
end
|
||||
end
|
||||
|
||||
function bell.draw()
|
||||
|
||||
@@ -29,12 +29,6 @@ function controls.update(dt, game, camera)
|
||||
local cam_x, cam_y = camera.gcam:getPosition()
|
||||
local mouse_x, mouse_y = love.mouse.getPosition()
|
||||
controls.mouse:moveTo(cam_x + mouse_x - 640 , mouse_y)
|
||||
print('mouse')
|
||||
print(love.mouse.getPosition())
|
||||
print('camera')
|
||||
print(camera.gcam:getPosition())
|
||||
print('collision')
|
||||
print(mouse_x + 640 - cam_x .. ' ' .. (cam_y * 2) + mouse_y)
|
||||
|
||||
if control_left then
|
||||
if game.canvas.x > game.window.width / 2 then
|
||||
|
||||
Reference in New Issue
Block a user