Search found 6 matches

by Vilent
Thu Jan 10, 2019 10:03 pm
Forum: General
Topic: TicTacToe Question
Replies: 7
Views: 1812

Re: TicTacToe Question

Oh i figured it out here is what I have so far as the grid goes. I used both of your guys' advice with cellsize and width and height and managed to do some math to get this where I want it. https://i.gyazo.com/d060de897f9ef8138eba74cd17bd4bf2.png I will get back to this for the mousepresses thank yo...
by Vilent
Thu Jan 10, 2019 9:42 pm
Forum: General
Topic: TicTacToe Question
Replies: 7
Views: 1812

Re: TicTacToe Question

Could use a 2d array like board = { {0, 0, 0}, {0, 0, 0}, {0, 0, 0} } and draw it like for y=1, #board do for x=1, #board[1] do love.graphics.rectangle("fill", x * cellSize, y * cellSize, cellSize - 1, cellSize - 1) end end where cellSize is how large each cell of the board is. so I ran into the pr...
by Vilent
Thu Jan 10, 2019 9:16 pm
Forum: General
Topic: TicTacToe Question
Replies: 7
Views: 1812

Re: TicTacToe Question

To be fair, the one rectangle and 2x2 internal separator lines worked perfectly fine, but it seems to me that your issue is more about how to position things in a general sense, than anything. Use love.graphics.getDimensions to get the width and height of your window, then position everything relat...
by Vilent
Thu Jan 10, 2019 9:11 pm
Forum: General
Topic: TicTacToe Question
Replies: 7
Views: 1812

Re: TicTacToe Question

Could use a 2d array like board = { {0, 0, 0}, {0, 0, 0}, {0, 0, 0} } and draw it like for y=1, #board do for x=1, #board[1] do love.graphics.rectangle("fill", x * cellSize, y * cellSize, cellSize - 1, cellSize - 1) end end where cellSize is how large each cell of the board is. I actually did somet...
by Vilent
Thu Jan 10, 2019 2:39 am
Forum: General
Topic: TicTacToe Question
Replies: 7
Views: 1812

Re: TicTacToe Question

Also sidenote, I guess what I'm really interested in NOW after an hour of thinking is, Is there a way to make an array of rectangles instead of doing.. what I did? I understand how to make one of them but how about 3 by 3 grid of the same rectangles/squares?
by Vilent
Thu Jan 10, 2019 1:09 am
Forum: General
Topic: TicTacToe Question
Replies: 7
Views: 1812

TicTacToe Question

Hello there fellow lua-ers... love-ers. I recently got into lua and was wondering the best way about making the tictactoe board for tictactoe... Except mine is called kittytactoe but that's besides the point. So far, I have done this. local MENU_PLAY = 0 local MENU_SETTINGS = 1 local MENU_QUIT = 2 l...