Develop #4

Merged
wariosolis merged 35 commits from develop into master 2017-01-04 00:04:34 +01:00
2 changed files with 26 additions and 6 deletions
Showing only changes of commit 088390f9c3 - Show all commits
+26
View File
@@ -79,6 +79,32 @@ function bell.update(dt, game, cam)
end end
end 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 end
function bell.draw() function bell.draw()
-6
View File
@@ -29,12 +29,6 @@ function controls.update(dt, game, camera)
local cam_x, cam_y = camera.gcam:getPosition() local cam_x, cam_y = camera.gcam:getPosition()
local mouse_x, mouse_y = love.mouse.getPosition() local mouse_x, mouse_y = love.mouse.getPosition()
controls.mouse:moveTo(cam_x + mouse_x - 640 , mouse_y) 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 control_left then
if game.canvas.x > game.window.width / 2 then if game.canvas.x > game.window.width / 2 then