Calculate top, left, right, bottom wall coords
parent
e960811934
commit
8d79f8b633
12
main.lua
12
main.lua
|
|
@ -89,14 +89,16 @@ function love.load(arg)
|
||||||
local bubbles_high = #game.levels[game.current_level]
|
local bubbles_high = #game.levels[game.current_level]
|
||||||
game.level_width = bubbles_wide * game.bubble_diameter
|
game.level_width = bubbles_wide * game.bubble_diameter
|
||||||
game.level_height = (bubbles_high - 1) * game.row_gap + game.bubble_diameter
|
game.level_height = (bubbles_high - 1) * game.row_gap + game.bubble_diameter
|
||||||
game.level_x = (game.window_width - game.level_width) / 2
|
game.level_left = (game.window_width - game.level_width) / 2
|
||||||
game.level_y = game.bubble_radius
|
game.level_top = game.bubble_radius
|
||||||
|
game.level_right = game.level_left + game.level_width
|
||||||
|
game.level_bottom = game.level_top + game.level_height
|
||||||
|
|
||||||
game.launcher_image = love.graphics.newImage('images/launcher.png')
|
game.launcher_image = love.graphics.newImage('images/launcher.png')
|
||||||
game.launcher_height = game.launcher_image:getHeight()
|
game.launcher_height = game.launcher_image:getHeight()
|
||||||
game.launcher_width = game.launcher_image:getWidth()
|
game.launcher_width = game.launcher_image:getWidth()
|
||||||
game.launcher_x = game.window_width / 2
|
game.launcher_x = game.window_width / 2
|
||||||
game.launcher_y = game.level_y + game.level_height + game.bubble_diameter
|
game.launcher_y = game.level_top + game.level_height + game.bubble_diameter
|
||||||
game.launcher_offset_x = 90 -- rotation point in launcher image
|
game.launcher_offset_x = 90 -- rotation point in launcher image
|
||||||
game.launcher_offset_y = game.launcher_height / 2
|
game.launcher_offset_y = game.launcher_height / 2
|
||||||
game.launcher_rotation = -tau / 4 -- up
|
game.launcher_rotation = -tau / 4 -- up
|
||||||
|
|
@ -170,8 +172,8 @@ function love.draw()
|
||||||
love.graphics.setColor(0, 0, 0, 1)
|
love.graphics.setColor(0, 0, 0, 1)
|
||||||
love.graphics.rectangle(
|
love.graphics.rectangle(
|
||||||
'line',
|
'line',
|
||||||
game.level_x,
|
game.level_left,
|
||||||
game.level_y,
|
game.level_top,
|
||||||
game.level_width,
|
game.level_width,
|
||||||
game.level_height
|
game.level_height
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue