Search found 245 matches

by glitchapp
Sat Feb 12, 2022 12:08 pm
Forum: General
Topic: Help implementing game logic from fish fillets
Replies: 193
Views: 105984

Re: Help implementing game logic from fish fillets

function moveAgent (dx, dy) -- global defined agent local agent = self.agent local x, y = agent.x, agent.y -- real changing of the agent's position: agent.x = x + dx agent.y = y + dy end --function moveBlock (block, dx, dy) -- exactly this block --block.x = block.x + dx --block.y = block.y + dy --e...
by glitchapp
Sat Feb 12, 2022 12:58 am
Forum: General
Topic: Help implementing game logic from fish fillets
Replies: 193
Views: 105984

Re: Help implementing game logic from fish fillets

function moveAgent (dx, dy) -- global defined agent local x = agent.x local y = agent.y -- real changing of the agent's position: agent.x = x + dx agent.y = y + dy end --function moveBlock (block, dx, dy) -- exactly this block --block.x = block.x + dx --block.y = block.y + dy --end function pb:upda...
by glitchapp
Fri Feb 11, 2022 10:03 am
Forum: General
Topic: Help implementing game logic from fish fillets
Replies: 193
Views: 105984

Re: Help implementing game logic from fish fillets

function moveAgent (dx, dy) -- global defined agent agent.x = self.agent.tx + dx --agent.y = self.agent.ty + dy end --function moveBlock (block, dx, dy) -- exactly this block --block.x = block.x + dx --block.y = block.y + dy --end function pb:updateAgents (dt) if problemdebug=="1" then if...
by glitchapp
Fri Feb 11, 2022 9:07 am
Forum: General
Topic: Help implementing game logic from fish fillets
Replies: 193
Views: 105984

Re: Help implementing game logic from fish fillets

Yes, I need to write where is the actual code and where is the placeholder code. We can make the game like in the first version of FF. All movements are ultra fast, the fish jumps to the next cell without any between positions, such movement is much easier. Placeholder code (calling not existing fu...
by glitchapp
Fri Feb 11, 2022 6:26 am
Forum: General
Topic: Help implementing game logic from fish fillets
Replies: 193
Views: 105984

Re: Help implementing game logic from fish fillets

Hei, thanks again! you are helping me solve the hardest problem of my game: collisions The actual code for the blocks is this: function pb:drawBlocks () love.graphics.setLineWidth(2) local tileSize = self.grigSize for i, block in ipairs (self.blocks) do local btx = block.tx local bty = block.ty love...
by glitchapp
Wed Feb 09, 2022 9:36 pm
Forum: General
Topic: Help implementing game logic from fish fillets
Replies: 193
Views: 105984

Re: Help implementing game logic from fish fillets

Here: -- this is the new code in which players move inside the grid, I am trying to insert the collisions above in this new code: if moves =="right" then self.agent.tx = self.agent.tx + dt*self.agent.vx Why you move the agent without any checking? Maybe the better solution: local dx, dy =...
by glitchapp
Wed Feb 09, 2022 7:07 am
Forum: General
Topic: Help implementing game logic from fish fillets
Replies: 193
Views: 105984

Re: Help implementing game logic from fish fillets

I'm back to the game logic, I thought I would never going to solve this, Some conditional had >= instead of <= and that was causing the problems with the movement inside the grid. The fish now moves inside the grid. Here is the code: function pb:updateAgents (dt) if problemdebug=="1" then ...
by glitchapp
Tue Feb 08, 2022 10:38 pm
Forum: General
Topic: Mars Lander. Any collaborators? Noobs welcome.
Replies: 137
Views: 108280

Re: Mars Lander. Any collaborators? Noobs welcome.

milon wrote: Tue Feb 08, 2022 5:15 pm
glitchapp wrote: Sun Feb 06, 2022 4:39 am ... I want to develop that naval strategy game that has been built so many times in electronic devices, I'm not sure how it's called but I find it very interesting and not so hard to develop...
I think you're talking about Battleship.
exactly! That was the game!
by glitchapp
Tue Feb 08, 2022 12:59 pm
Forum: General
Topic: Help implementing game logic from fish fillets
Replies: 193
Views: 105984

Re: Help implementing game logic from fish fillets

darkfrei wrote: Tue Feb 08, 2022 12:56 pm This:

Code: Select all

    for y, row in ipairs(level) do
        for x, cell in ipairs(row) do
           love.graphics.setFont(love.graphics.newFont(15))
are you really need to set the font on every cell?
I will delete that right now, that shouldn't be there, thanks for making me aware!
by glitchapp
Tue Feb 08, 2022 12:33 pm
Forum: General
Topic: Help implementing game logic from fish fillets
Replies: 193
Views: 105984

Re: Help implementing game logic from fish fillets

Before touching of blender and 3d, just make the 2d version with any placeholder graphics, that the game will be ready and playable. The process to make it better is pretty infinite :) You are right, I will, I just needed a pause with the game logic, but I will be back to it I'm not thinking on sta...