Search found 79 matches

by unixfreak
Wed Oct 28, 2020 11:12 pm
Forum: Support and Development
Topic: Using shader in Love2D
Replies: 5
Views: 4057

Re: Using shader in Love2D

grump wrote: Wed Oct 28, 2020 3:10 pm Due to precision errors after long uptime, passing the time like this can result in laggy animation. Get the timer value from love.timer.getTime() when the game starts, and subtract it from the current time when passing it to the shader.
Hmm, interesting. Never thought about that one. :awesome:
by unixfreak
Wed Oct 28, 2020 12:42 pm
Forum: Support and Development
Topic: Using shader in Love2D
Replies: 5
Views: 4057

Re: Using shader in Love2D

I can walk you through the steps to port this shader: 1. The main body of a shader such as void main() typically becomes vec4 effect( vec4 color, Image tex, vec2 texture_coords, vec2 screen_coords ) 2. You'll want to switch out fragColor for color and fragCoord 's for texture_coords 3. Often shadert...
by unixfreak
Tue Aug 20, 2019 1:12 pm
Forum: Support and Development
Topic: Camera panning not so smooth in map object
Replies: 1
Views: 2430

Re: Camera panning not so smooth in map object

Looks like you're missing deltatime when the camera position changes; Something like this: Map:update(dt) function Map:update(dt) --moves the map 1 pixel in any direction if input:down('PAN_RIGHT') then self.camX = self.camX + 2 *dt print(self.camX) elseif input:down('PAN_LEFT') then self.camX = sel...
by unixfreak
Thu Aug 01, 2019 4:13 pm
Forum: Libraries and Tools
Topic: Metaballs
Replies: 4
Views: 4024

Re: Metaballs

Looks nice! I played around with it for a bit and made some optimizations. The calculation is now done in a shader, and the texture is not recreated every frame. It's quickly hacked in though, so the code is far from optimal and not very pretty. ;) Hey, that's cool. Yeah, runs much faster as a shad...
by unixfreak
Wed Jul 31, 2019 6:01 pm
Forum: Libraries and Tools
Topic: Metaballs
Replies: 4
Views: 4024

Metaballs

https://raw.githubusercontent.com/Jigoku/love2d_metaballs/master/preview.gif This module creates a drawable surface with some HSL bouncing metaballs. Maybe someone will find this useful as a starting point for something else. Code can be found here: https://github.com/Jigoku/love2d_metaballs Basic ...
by unixfreak
Mon Jul 22, 2019 8:03 pm
Forum: Support and Development
Topic: Row of enemies
Replies: 2
Views: 1789

Re: Row of enemies

You'll want to loop over some rows and columns, which place an enemy into a table. That way you can loop over the table easily; One way to setup a grid of enemies is something like this; function love.load() enemies = {} enemies.w = 50 -- width of enemy enemies.h = 30 -- height of enemy enemies.rows...
by unixfreak
Sat Jul 20, 2019 11:01 pm
Forum: Support and Development
Topic: Trace a curve which pass through all of the points.
Replies: 8
Views: 2822

Re: Trace a curve which pass through all of the points.

Not sure if this is any use, but a while back i was trying to understand the use of moving an object along a bezier curve (typically a rocket/missile), this example that someone fixed for me may be useful in plotting the points along the curve: https://love2d.org/forums/viewtopic.php?f=4&t=83825...
by unixfreak
Thu May 30, 2019 6:39 pm
Forum: General
Topic: What's everyone working on? (tigsource inspired)
Replies: 1729
Views: 805603

Re: What's everyone working on? (tigsource inspired)

Red screen flashing is annoying as hell. Could replace with cracked screen or something else. It's just the flashing thats overdone. Agreed with you on that. Really was just an idea i had at the time. Cracks are a good idea... although i will probably make the flashing more subtle (hardly noticable...
by unixfreak
Tue May 28, 2019 10:54 pm
Forum: General
Topic: What's everyone working on? (tigsource inspired)
Replies: 1729
Views: 805603

Re: What's everyone working on? (tigsource inspired)

Here's a top-down/side scrolling space shooter, with infinite gameplay. (will eventually have a story mode too). All the background scenery is procedurally generated. I abandoned this for a while, but got motivated to fix some of the broken enemies, and recently reworked many visuals; hopefully i'll...
by unixfreak
Thu Feb 28, 2019 6:14 pm
Forum: Support and Development
Topic: Shaders: having trouble porting existing shaders
Replies: 2
Views: 3054

Re: Shaders: having trouble porting existing shaders

Many thanks for all of that information, sorry for the late reply. This will be very useful to me, although, i think i'm going to go and look at GLSL shaders to try and understand things more about how shaders are generally put together. Your shader example does work, although i'm not sure how to im...