This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| local classic = require("modules.classic.classic") | |
| local guiMana = classic:extend() | |
| function guiMana:new() | |
| self.max = 100 | |
| self.current = 100 | |
| self.percent = 1 | |
| self.x = game.gWidth/2 + 8 | |
| self.y = game.gHeight - 3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --LOVE2D api/wiki trimmer | |
| --Also useful for other batch deletion using lua and lfs | |
| --Created by Brandon Blanker Lim-it @flamendless | |
| local lfs = require("lfs") | |
| local toRemove = { | |
| "_deutsch", | |
| "_portugu", | |
| "_fran", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| local Pswap = {} | |
| local orig_pal | |
| local new_pal | |
| local image | |
| local image2 | |
| local lookup = {} | |
| function Pswap:load() | |
| local orig_pal_data = love.image.newImageData("orig.png") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Create 256 shuffled numbers | |
| local perm = {} | |
| for i = 1, 256 do | |
| table.insert(perm, math.random(#perm + 1), i) | |
| end | |
| -- Repeat the list | |
| for i = 1, 256 do | |
| perm[i+256] = perm[i] | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| local data = love.image.newImageData(w, h) | |
| data:mapPixel(function(x,y,r,g,b,a) | |
| local a = love.math.noise(x, y) | |
| return a, a, a, 1 | |
| end) | |
| if isSaveIt then | |
| data:encode("png", filename or "noise.png") | |
| local image = love.graphics.newImage(data) | |
| return image | |
| else |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| local processPoints = function(shape1, shape2) | |
| local d = #shape1/#shape2 * 2 | |
| local all = {} | |
| for i = 1, #shape1, 2 do | |
| all[i] = false | |
| if i % d == 1 then | |
| all[i] = true | |
| end | |
| end | |
| return all |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function love.load() | |
| for k, file in pairs(love.filesystem.getDirectoryItems("source")) do | |
| convert(file) | |
| end | |
| end | |
| function convert(file) | |
| local data = love.image.newImageData("source/" .. file) | |
| local width = data:getWidth() | |
| local div = 255/width |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --[[ | |
| example use | |
| ]] | |
| local recolour = require("recolour") | |
| --we want to recolour this asset image | |
| local to_recolour = love.image.newImageData("path/to/image.png") | |
| --using this palette image | |
| local palette = love.image.newImageData("path/to/palette.png") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| extern number minRadius = 0.05; | |
| extern number maxRadius = 0.1; | |
| extern number mul = 0.01; | |
| extern vec2 center = vec2(0.5,0.5); | |
| number dist(vec2 a, vec2 b){ | |
| return sqrt(pow(b.x-a.x,2)+pow(b.y-a.y,2)); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package midisequenceextractor; | |
| import java.io.File; | |
| import java.io.IOException; | |
| import java.util.ArrayList; | |
| import java.util.HashMap; | |
| import java.util.List; | |
| import java.util.Map; | |
| import javax.sound.midi.InvalidMidiDataException; | |
| import javax.sound.midi.MidiChannel; |
OlderNewer