Noita Lines In Love2D??

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
imDread
Prole
Posts: 6
Joined: Mon May 20, 2024 10:39 am

Noita Lines In Love2D??

Post by imDread »

Im wondering how can i draw Noita-like lines in love2d, i tried using the "rough" line style, but didnt gave me the result that i was expecting.

Code: Select all

function love.load()
	love.window.setMode(500,500)
	love.graphics.setLineStyle("rough")
end

function love.draw()
	mx,my = love.mouse.getPosition()
	love.graphics.setLineWidth(0.1)
	love.graphics.line(0,0,mx,my)
end
Anyways this is the code.
MrFariator
Party member
Posts: 526
Joined: Wed Oct 05, 2016 11:53 am

Re: Noita Lines In Love2D??

Post by MrFariator »

Might be helpful to provide an example of what you are trying to accomplish. There are fair few wand types in Noita, so it may depend on what effect you're trying to emulate.
imDread
Prole
Posts: 6
Joined: Mon May 20, 2024 10:39 am

Re: Noita Lines In Love2D??

Post by imDread »

im not trying to create any wand, im just confused how did they render every pixel on the screen , and simulate them to create diffrent lines and effects, if you know how just give me a very simple example.
MrFariator
Party member
Posts: 526
Joined: Wed Oct 05, 2016 11:53 am

Re: Noita Lines In Love2D??

Post by MrFariator »

Okay, so you are not asking about lines, but how to make an engine that simulates every pixel on the screen, and apply effects on top of it? You'd effectively have to make something similar to a voxel engine, but limit it to singular pixels for rendering. That's quite a broad subject, but the creators of the game did a talk at GDC, if you are interested.
RNavega
Party member
Posts: 291
Joined: Sun Aug 16, 2020 1:28 pm

Re: Noita Lines In Love2D??

Post by RNavega »

That's particles. You draw particles that are 1-pixel wide on screen, and animate them in your code by simulating physical forces like "magnetism" etc. so the points converge to the shapes that you're trying to form.

The fastest way to draw point particles in LÖVE is with a custom Mesh object created with the "points" draw mode, where each flying vertex is drawn as a pixel on screen, and you animate the points by manipulating the vertex coordinates.
It's also an advanced use, and I have no idea how dedicated you are at learning new things.

A much simpler way is using love.graphics.points(), there's an example at the bottom of this page:
https://love2d.org/wiki/love.graphics.points
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests