Search found 39 matches
- Wed May 01, 2024 8:24 pm
- Forum: Support and Development
- Topic: I always get this error code
- Replies: 3
- Views: 877
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: 1906
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: 2383
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: 1906
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: 594
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: 954
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...
- Tue Feb 06, 2024 9:15 pm
- Forum: Support and Development
- Topic: Hardon collider Problem coming in dectectings collision properly
- Replies: 6
- Views: 1803
Re: Hardon collider Problem coming in dectectings collision properly
I still use HC for some of my projects, it works fine with the most recent version of love. Just ignore the official documentation because its woefully out of date. The reason your rectangle is overlapping is because you need to swap the order of your move and update callbacks in love.update: functi...
- Tue Feb 06, 2024 8:52 pm
- Forum: Support and Development
- Topic: Please Help me start my journey in love2D
- Replies: 1
- Views: 822
Re: Please Help me start my journey in love2D
As is mentioned here https://love2d.org/forums/viewtopic.php?t=85111 your solution is (probably) to use the folder path without main.lua. Love needs the project folder containing main.lua. This may be of use to you: https://love2d.org/wiki/Getting_Started Once you get the framework up and running, a...
- Sun Feb 04, 2024 2:11 am
- Forum: Libraries and Tools
- Topic: boon - A build tool for LÖVE
- Replies: 16
- Views: 196030
Re: boon - A build tool for LÖVE
Just tried this last night to build a mac version of one of my game jam games (my sister only has a macbook) and it was a piece of cake. Great stuff, thanks.
- Tue Jan 30, 2024 2:01 am
- Forum: General
- Topic: Using love while learning c++
- Replies: 6
- Views: 1401
Re: Using love while learning c++
My advice is to pick a specific project that you would like to accomplish. It can be over-ambitious (game engine) or low-stakes (pong). It doesn't necessarily need to be achievable at first, it just needs to not be "learn c++". Your goal is "do <something> via c++". It's through ...