Connection Paint
Connection Paint
A picture is worth a thousand words.
Click to able or disable connections.
If you like change the configurations of the game and put it full screen I like that...
- Attachments
-
- Connection Paint.love
- (915 Bytes) Downloaded 161 times
Bomberman in LÖVE:
http://migre.me/7Beiu
http://migre.me/7Beiu
Re: Connection Paint
I like it. I attempted to make the check 2 squares instead of 1 and almost got it, but then some stupid bugs got in the way and I realized I should be debugging my game instead.
Re: Connection Paint
Hmm there is, i think.
- Attachments
-
- Connection Paint 2.love
- (991 Bytes) Downloaded 134 times
Bomberman in LÖVE:
http://migre.me/7Beiu
http://migre.me/7Beiu
Re: Connection Paint
I was thinking more along the lines of something you could change via a menu. Set the size of the spatial hash (I think that's the name for what you are doing, but maybe not), then the game will build the "dirs".
Something like:
Something like:
Code: Select all
for i = -size, size do
for j = -size, size do
table.insert(dirs, {i,j})
end
end
Re: Connection Paint
I've got an Intel graphic card and I can't see 1-pixel-wide horizontal or vertical lines...
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
Re: Connection Paint
P.S: try changing this
with this:
I'm playing on my 1024x600 netbook monitor now
Code: Select all
local GAME_GRID = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
}
Code: Select all
local GAME_GRID = {}
for y = 1, math.ceil(love.graphics.getHeight() / 20) do
GAME_GRID[y] = {}
for x = 1, math.ceil(love.graphics.getWidth() / 20) do
GAME_GRID[y][x] = 0
end
end
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
Re: Connection Paint
Pretty cool. I have a prototype that's quite similar to your app.
Just a small suggestion:
It's usually better to allocate tables that don't change only once.
Lua is an interpreted language so it doesn't know that 'dirs' is constant so it will recreate the table each time you call checkAround.
Secondly, you might want to look into neightbor valuing to represent the grid:
http://www.saltgames.com/2010/a-bitwise ... -tilemaps/
In short, instead of 0 and 1, each tile could have a value between 0-256 (2^8) to represent which adjacent nodes it's connected to.
Just a small suggestion:
Code: Select all
function checkAround(px, py)
local dirs = {
[1] = {0, -1},
[2] = {1, -1},
...
Lua is an interpreted language so it doesn't know that 'dirs' is constant so it will recreate the table each time you call checkAround.
Secondly, you might want to look into neightbor valuing to represent the grid:
http://www.saltgames.com/2010/a-bitwise ... -tilemaps/
In short, instead of 0 and 1, each tile could have a value between 0-256 (2^8) to represent which adjacent nodes it's connected to.
Who is online
Users browsing this forum: Majestic-12 [Bot] and 1 guest