Search found 15 matches
- Sun Jun 09, 2024 1:02 pm
- Forum: General
- Topic: Is there any way to use the vscode terminal for debugging with love2d?
- Replies: 1
- Views: 2286
Re: Is there any way to use the vscode terminal for debugging with love2d?
To make it so you can output message to the terminal with print commands you just need the following line at the start of your main.lua file: io.stdout:setvbuf("no") For full debugging (breakpoints and stepping through functions etc.) I use https://marketplace.visualstudio.com/items?itemNa...
- Mon Mar 25, 2024 1:02 pm
- Forum: Libraries and Tools
- Topic: Dithering with matrix
- Replies: 10
- Views: 24590
Re: Dithering with matrix
I was thinking about dithing the other day and played around with the idea of error being pushed to the right and downwards through a maze (where the mazes passability allows it). CurveDither.png The attached uses this for a few different wall layouts, "t" toggles showing the layout on the...
- Fri Mar 15, 2024 7:48 am
- Forum: General
- Topic: Code Doodles!
- Replies: 197
- Views: 326804
Re: Code Doodles!
This next one is some anemones trying to grab some balls (plankton maybe) using inverse kinematics. IK.png -- Disable output buffer so debug messages print in real time io.stdout:setvbuf("no") function love.load() bodies = {} balls = {} -- spawn some balls (targets) for i = 1, 20 do table....
- Sun Mar 10, 2024 2:21 pm
- Forum: General
- Topic: Need help with tiled
- Replies: 1
- Views: 2722
Re: Need help with tiled
I've not used tiled but it looks like you're only seeing the very top left of your tilemap. It might be there's some function in tiled that lets you set the desired size of your tiles. Another way you can see more is by calling "love.graphics.scale(scale_value)" at the start of your draw f...
- Sun Mar 10, 2024 12:54 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
Just to add a little bit more. If you want to do a lot of checks per frame and need it to be a little bit faster you don't need to take the square root for each object, since closer things will have a smaller distance squared than farther things. You can then take the square root of the winner at th...
- Wed Mar 06, 2024 7:00 am
- Forum: General
- Topic: Code Doodles!
- Replies: 197
- Views: 326804
Re: Code Doodles!
Another quick doodle. This time soft-body physics with Verlet Integration. The gif didn't come out great but it's quite fun to play with. You can grab and drag any particle with the mouse. F1 resets the cloth, F2 toggles a fan that blows from the side and F3 toggles colour. I'm pretty sure I could h...
- Mon Mar 04, 2024 11:25 am
- Forum: General
- Topic: Code Doodles!
- Replies: 197
- Views: 326804
Re: Code Doodles!
There's been L-systems earlier in the thread ( https://love2d.org/forums/viewtopic.php?p=166023#p166023 ) but I thought I'd add these anyway because they're kind of nice to look at. Triforce.gif To increase the generation press F2, to reset to 0 press F1. To try a different L-system change the setup...
- Tue Feb 27, 2024 9:59 am
- Forum: Libraries and Tools
- Topic: Dithering with matrix
- Replies: 10
- Views: 24590
Re: Dithering with matrix
I was playing around with Dithering the other day and thought I'd add my script here. It's nothing that hasn't been done (better) above but it was fun to create. There are a few different dithers and colour reduction methods you can do by changing the arguments of the dither function. My dither matr...
- Thu Feb 15, 2024 11:51 am
- Forum: Libraries and Tools
- Topic: Maze Thread
- Replies: 50
- Views: 54269
Re: Maze Thread
Thanks pgimeno for pointing out this thread. I'd put a recursive backtracker in the code doodles thread (https://love2d.org/forums/viewtopic.php?p=258691#p258691) The algorithm itself is really simple, though much of my implementation could probably be improved. I was toying around with it this morn...
- Mon Feb 12, 2024 2:58 pm
- Forum: General
- Topic: Code Doodles!
- Replies: 197
- Views: 326804
Re: Code Doodles!
I was toying around with mazes the other day and found the recursive backtracker to be pretty easy to implement and generally nice to look at. It guarantees a maze where every spot is filled in and all spots are on a single network. f1 to generates a new maze. RecursiveBacktracker.png function love....