Search found 26 matches

by prixt
Fri Dec 29, 2017 1:50 pm
Forum: Libraries and Tools
Topic: Boids
Replies: 16
Views: 10834

Re: Boids

KayleMaster wrote: Fri Dec 29, 2017 12:08 pm Can this be used as a pathfinding alternative for grid based games?
Well this technically isn't pathfinding: https://en.wikipedia.org/wiki/Boids
The grid here exists so only entities within a certain range will be iterated.
But you could get creative and use this combined with other algorithms.
by prixt
Thu Dec 28, 2017 12:16 pm
Forum: Libraries and Tools
Topic: Boids
Replies: 16
Views: 10834

Re: Boids

Haven't been able to code properly for sometime, finally got access to my own laptop.
Here's a new one.
by prixt
Thu Dec 28, 2017 8:26 am
Forum: Support and Development
Topic: 2d arrays of arbitrary size
Replies: 6
Views: 7854

Re: 2d arrays of arbitrary size

local row_mt = { __index = function(self,k) local cell = {} self[k] = cell cell[self] = true return cell end, __mode = "v" } local matrix_mt = { __index = function(self,k) local row = setmetatable({},row_mt) self[k] = row row[self] = true return row end, __mode = "v" } matrix = ...
by prixt
Sat Dec 02, 2017 1:54 am
Forum: Support and Development
Topic: How would I make a pixel dithering pattern shader?
Replies: 3
Views: 4289

Re: How would I make a pixel dithering pattern shader?

Thank you! I was unfamiliar to GLSL. That step function is going to be handy!
by prixt
Fri Dec 01, 2017 10:40 am
Forum: Support and Development
Topic: How would I make a pixel dithering pattern shader?
Replies: 3
Views: 4289

How would I make a pixel dithering pattern shader?

What I'm aiming for: https://forums.tigsource.com/index.php?topic=40832.msg1363742#msg1363742 My code so far: extern Image img; extern vec2 img_size; vec4 effect(vec4 color, Image texture, vec2 texture_coords, vec2 screen_coords) { vec4 pixel = Texel(texture, texture_coords); screen_coords = mod(scr...
by prixt
Fri Jan 27, 2017 8:42 am
Forum: Libraries and Tools
Topic: Lists; a fast way to store objects.
Replies: 36
Views: 20136

Re: Lists; a fast way to store objects.

--==List==-- local list = {} list.__index = list list.__len = function(self) return self.size end list._init = function(self) self.p,self.n = {},{} self.size = 0 self.current = false self.p[self] = self self.n[self] = self end list.has = function(self,item) if not item or item == self or not self.p...
by prixt
Thu Mar 10, 2016 10:02 am
Forum: Libraries and Tools
Topic: [library] binser - Customizable Lua Serializer
Replies: 13
Views: 8792

Re: [library] binser - Customizable Lua Serializer

Can binser serialize weak tables?
by prixt
Thu Feb 25, 2016 12:38 pm
Forum: General
Topic: How does this bresenham code even work?
Replies: 1
Views: 1918

How does this bresenham code even work?

https://github.com/kikito/bresenham.lua ... senham.lua

I understand what the bresenham algorithm is and how it works, but I just cannot wrap my head around why this code actually works.
by prixt
Wed Feb 17, 2016 12:47 am
Forum: Libraries and Tools
Topic: bitser: faster, harder, better serialization with LuaJIT
Replies: 16
Views: 21820

Re: bitser: faster, harder, better serialization with LuaJIT

Is it possible to register custom classes that don't use libraries you mentioned? I prefer to create classes on a case by case basis, so don't use outside libraries.
by prixt
Mon Jan 18, 2016 4:08 pm
Forum: Libraries and Tools
Topic: Boids
Replies: 16
Views: 10834

Boids

Just a visual toy. Made for fun.