Search found 1186 matches

by darkfrei
Fri May 24, 2024 8:07 pm
Forum: General
Topic: Help with my pool(billiards) game
Replies: 2
Views: 36

Re: Help with my pool(billiards) game

betobala wrote: Fri May 24, 2024 7:59 pm I need to draw the pool cue behind the cue ball, pointing at the mouse position. But I do not know the math to make that happens, can I get some help? :)
Make .love not .rar
by darkfrei
Fri May 24, 2024 9:24 am
Forum: General
Topic: Pool(Billiards) physics (Need help)
Replies: 7
Views: 730

Re: Pool(Billiards) physics (Need help)

I've made small example with circles collision detection and static/dynamic resolving: https://love2d.org/forums/viewtopic.php?p=240339#p240339 Two main collision functions: function pushback (collision) local particles = collision.particles local b1, b2 = particles[1], particles[2] local overlap = ...
by darkfrei
Wed May 01, 2024 7:05 pm
Forum: General
Topic: Image format size pickle
Replies: 19
Views: 2201

Re: Image format size pickle

You can use this PNG optimization script: https://forums.factorio.com/viewtopic.p ... 71#p250171
by darkfrei
Sun Apr 28, 2024 6:27 pm
Forum: Libraries and Tools
Topic: Voronoi Fortune Additional Events in Lua
Replies: 3
Views: 1315

Re: Voronoi Fortune Additional Events in Lua

First very special point event: vertical aligned beachline splitting. The new focus3.x is exactly same as point u8.x, it creates vertical edge. No arc is splitted, but new vertex is inserted on the cross point of two arcs. It creates no circle event. Beachline after event: (p1, u2, u9, u10, u6, p4) ...
by darkfrei
Sun Apr 28, 2024 9:17 am
Forum: General
Topic: Image format size pickle
Replies: 19
Views: 2201

Re: Image format size pickle

Making images with transparent key value - it looks like chroma key.
https://en.m.wikipedia.org/wiki/Chroma_key
by darkfrei
Fri Apr 26, 2024 3:53 pm
Forum: Libraries and Tools
Topic: Dithering with matrix
Replies: 9
Views: 10260

Re: Dithering with matrix

Dithering with pseudo-hexagonal matrix pattern: function dithering(data) local width, height = data:getDimensions() local canvasImageData = love.image.newImageData(width, height) local matrix = { -- 9 colors { 28, 85, 28, 85 }, { 142, 198, 142, 198 }, { 113, 57, 113, 57 }, { 227, 170, 227, 170 }, } ...
by darkfrei
Fri Apr 26, 2024 3:18 pm
Forum: Libraries and Tools
Topic: Image to polygon converter
Replies: 2
Views: 9086

Re: Image to polygon converter

Any post is better with examples. We are have an image: hexadecagon2.png Open file: 2024-04-26T17_15_39-Image to Polygon converter.png Drag-n-drop the image. Input 16 vertices and "Generate polygon": 2024-04-26T17_16_00-Image to Polygon converter.png Output formats: {36, 112, 58, 68, 84, 4...
by darkfrei
Thu Apr 25, 2024 2:00 pm
Forum: Libraries and Tools
Topic: Parabola functions in Lua
Replies: 11
Views: 95030

Re: Parabola functions in Lua

Two parabolas with common directrix have crossings on the same line: The the function to get crossing for the given horizontal line is: function focusFocusLineYCrossing (p1x, p1y, p2x, p2y, y) local cx = (p1x+p2x)/2 local cy = (p1y+p2y)/2 local m = (p2y-p1y)/(p2x-p1x) -- slope local x = cx - m*(y-p1...
by darkfrei
Tue Apr 23, 2024 4:30 pm
Forum: Libraries and Tools
Topic: Voronoi Fortune Additional Events in Lua
Replies: 3
Views: 1315

Re: Voronoi Fortune Additional Events in Lua

Another desmos graphic solutions:
https://www.desmos.com/calculator/kzff2hb9d3
https://www.desmos.com/calculator/onvynga3da
Animation (89).gif
Animation (89).gif (951.14 KiB) Viewed 1143 times
by darkfrei
Tue Apr 23, 2024 1:52 pm
Forum: Support and Development
Topic: Grid based movement
Replies: 3
Views: 834

Re: Grid based movement

Your code works, but try this code: function love.load() love.window.setTitle ('press WASD to move') gridSize = 64 player = { -- Initial grid position of the player gridPos = {x=1, y=1}, -- Change in grid position (due to movement) deltaGrid = {x=0, y=0}, -- Movement speed of the player (cells per s...