Search found 419 matches

by darkfrei
Tue Oct 12, 2021 9:12 pm
Forum: General
Topic: Fixing screen resolution ideas
Replies: 6
Views: 1460

Re: Fixing screen resolution ideas

Hmmm, I'll check out TLfres. So I should also scale ui? How would I make a camera work+tlfres/a scaling lib? @darkfrei, how does it work? It makes a virtual 1920x1080 screen and moves/scales this resolution to the current window. Also you can make any high-resolution canvases and render it too, so ...
by darkfrei
Tue Oct 12, 2021 1:50 pm
Forum: General
Topic: Fixing screen resolution ideas
Replies: 6
Views: 1460

Re: Fixing screen resolution ideas

My multiresolution (even 4K) rendering:
by darkfrei
Wed Oct 06, 2021 8:56 pm
Forum: Support and Development
Topic: Any subset sum calculator that considers multiplication? [clarified]
Replies: 5
Views: 1866

Re: Any subset sub calculator that considers multiplication?

target_n = 3 for i = 1, 10^6 do local str = "" str = str .. any_number () -- returns number for j = 1, 3 do str = str .. any_operator () -- returns operator: +, -, *, / str = str .. any_number () end print (str) local n = calculate (str) -- calculates the str as calculator if n == target_...
by darkfrei
Wed Oct 06, 2021 2:45 pm
Forum: Games and Creations
Topic: Railway Track
Replies: 7
Views: 3981

Re: Railway Track

BrotSagtMist wrote: Sun Sep 19, 2021 3:15 pm You can always add another canvas for order and instead of painting you can erase pixels too.
A quick hack in of my approach:
main.lua.zip
The problem:
by darkfrei
Wed Oct 06, 2021 10:03 am
Forum: Support and Development
Topic: Function to find these 4 points? (simple math problem)
Replies: 9
Views: 2244

Re: Function to find these 4 points? (simple math problem)

I want to generate them from a for() loop into a table, so it would look like this : function genPoints(x,y) --Coords of A local points = {} local point = {} -- not in the loop for i = 1, 4 do point.x, point.y = [?] point.otherData = [...] table.insert(points, point) end return points end Please no...
by darkfrei
Wed Oct 06, 2021 7:32 am
Forum: Support and Development
Topic: Function to find these 4 points? (simple math problem)
Replies: 9
Views: 2244

Re: Function to find these 4 points? (simple math problem)

also

Code: Select all

for i, p in ipairs ({{x=1,y=0}, {x=0,y=1}, {x=-1,y=0}, {x=0,y=-1}}) do
	table.insert(points, {x=p.x*50, y=p.y*50})
end
by darkfrei
Wed Oct 06, 2021 7:21 am
Forum: Support and Development
Topic: Function to find these 4 points? (simple math problem)
Replies: 9
Views: 2244

Re: Function to find these 4 points? (simple math problem)

Code: Select all

for i = 1, 4 do
  point.x, point.y = -50*math.cos(i*math.pi/2), 50*math.sin(i*math.pi/2)
  point.otherData = [...]
  table.insert(points, point)
 end
:awesome: But positive y is bottom, not at the top.
by darkfrei
Tue Oct 05, 2021 3:05 pm
Forum: General
Topic: How to get double-tap
Replies: 2
Views: 1987

Re: How to get double-tap

For mouse: function love.draw() love.graphics.print (tostring(mousepressed_presses), 0, 40) love.graphics.print (tostring(mousereleased_presses), 0, 80) end function love.mousepressed( x, y, button, istouch, presses ) mousepressed_presses = presses end function love.mousereleased( x, y, button, isto...
by darkfrei
Sun Oct 03, 2021 10:49 am
Forum: General
Topic: How to clamp camera?
Replies: 6
Views: 2679

Re: How to clamp camera?

Just wondering what methods there are to make a camera that follows a player to stop following the player at a certain place (like next to a wall)? I use camerax but the methods should work for all if you have any clues... if camera_following then -- do following else -- do not following end