Search found 43 matches
- Sat Nov 16, 2024 3:13 am
- Forum: Support and Development
- Topic: The character passes through the slab along the x coordinate
- Replies: 1
- Views: 8917
Re: The character passes through the slab along the x coordinate
Re-order your update function like so: function love.update(dt) cam:lookAt(player.x, player.y) if love.keyboard.isDown("a") then player.x = player.x - player.speed*dt elseif love.keyboard.isDown("d") then player.x = player.x + player.speed*dt elseif love.keyboard.isDown("w&q...
- Mon Sep 30, 2024 1:13 am
- Forum: Games and Creations
- Topic: Chazzla - Playable Chess AI
- Replies: 8
- Views: 10739
Re: Chazzla - Playable Chess AI
You are welcome. I have just cloned again the git repository. The window size issue has been fixed, but the font issue is still here! That's very strange - Git didn't recognize the filename change from ".TTF" to ".ttf" and so ignored the push to repository. I had to manually del...
- Sat Sep 28, 2024 8:02 pm
- Forum: Games and Creations
- Topic: Chazzla - Playable Chess AI
- Replies: 8
- Views: 10739
Re: Chazzla - Playable Chess AI
Fixed the font! The game window is also now resizable and launches at a smaller size - updated release build is available.Roland Chastain wrote: ↑Sat Sep 28, 2024 6:08 am Looks great! Congratulations.
- Under Linux, I had to rename CHEQ_TT.TTF to CHEQ_TT.ttf.
- The game doesn't fit to my (little) screen.
Also thank you!
- Thu Sep 26, 2024 9:35 pm
- Forum: Games and Creations
- Topic: Chazzla - Playable Chess AI
- Replies: 8
- Views: 10739
Chazzla - Playable Chess AI
After a few months of work, I've finished v1 of my playable Chess engine. The whole project was written from scratch using Lua/Love2d, though heavily inspired by Sebastian Lague's Chess Programming Video . Download and try your hand at defeating it! :3 https://i.imgur.com/wbfdOJb.png Repo: https://g...
- Wed May 01, 2024 8:24 pm
- Forum: Support and Development
- Topic: I always get this error code
- Replies: 3
- Views: 1407
Re: I always get this error code
Change your update function to this: function love.update(dt) if love.keyboard.isDown('right') then square.squarex = square.squarex + square.squarespeed * dt end end You need to access the properties of the table like you are in the draw function. Also consider the following: local square = { x = 0,...
- Tue Mar 12, 2024 10:17 pm
- Forum: Support and Development
- Topic: hump gamestate and push library?
- Replies: 3
- Views: 2307
Re: hump gamestate and push library?
Thanks for the suggestion for roomy, I'll check it out. One of the things I'm struggling with at the moment as someone new to Love2D, is just how many libraries there are out there that tackle the same thing. I don't want to reinvent the wheel if there are existing commonly used libraries out there...
- Sat Mar 09, 2024 10:47 pm
- Forum: Support and Development
- Topic: Finding which object in the table is closest
- Replies: 5
- Views: 3448
Re: Finding which object in the table is closest
What vilonis said. I happen to have a function for exactly this that I was using for an Auto-Battler prototype. For the purposes of library independence I added the relevant vector functions locally: local function len(x,y) return math.sqrt(x*x + y*y) end local function dist(x1,y1, x2,y2) return len...
- Sat Mar 09, 2024 9:39 pm
- Forum: Support and Development
- Topic: hump gamestate and push library?
- Replies: 3
- Views: 2307
Re: hump gamestate and push library?
I think it's because I need to use push:start() and push:finish() in both the gamestate's draw method and in the love.draw() and they do something weird when used together. You've already identified the problem and the solution -- don't call those functions in both places. I don't know what they ar...
- Fri Feb 16, 2024 4:08 am
- Forum: Support and Development
- Topic: Spawning Endless Object With Conditions
- Replies: 2
- Views: 853
Re: Spawning Endless Object With Conditions
What you are looking for is a soft implementation of OOP. Try the following: local Pipe = {} Pipe.__index = Pipe function Pipe.new(x, y, sprite, gap, velocity) local pipe = { x = x, y = y, sprite = sprite, gap = gap, velocity = velocity } return setmetatable(pipe, Pipe) end function Pipe:update(dt) ...
- Fri Feb 09, 2024 7:33 pm
- Forum: Support and Development
- Topic: Random terrain collision
- Replies: 5
- Views: 3811
Re: Random terrain collision
While I applaud you for attempting to write collision detection + resolution entirely on your own, I can't say I recommend it unless you are very experienced with game development and the related math. You should definitely consider using Box2D (love's built in physics engine) or something like bump...