Search found 651 matches

by Inny
Mon Feb 27, 2017 11:21 pm
Forum: General
Topic: Is there a way to group lines of code in Löve?
Replies: 18
Views: 12453

Re: Is there a way to group lines of code in Löve?

do end blocks.

Code: Select all

function something(parameter)
  local result

  do -- region one
    local inner_scope_variable = "whatever"
    result = inner_scope_variable
  end

  return result
end
by Inny
Sat Feb 04, 2017 4:07 pm
Forum: Support and Development
Topic: HUMP class and arguments
Replies: 6
Views: 4994

Re: HUMP class and arguments

You don't need a class library to do your syntax.

Code: Select all

function Obj()
  local self = {}
  self.x = 100
  self.add = function(var) self.x = self.x + var end
  return self
end

instance = Obj()
by Inny
Wed Feb 01, 2017 8:21 pm
Forum: General
Topic: What controllers do you support?
Replies: 8
Views: 6325

Re: What controllers do you support?

If you're going to use the Gamepad, please dynamically load gamecontrollerdb.txt, (so users can patch their own controllers into it) and also ship the most recent one from https://github.com/gabomdq/SDL_GameControllerDB The code to do this is pretty much as easy as dropping this in your love.load fu...
by Inny
Wed Feb 01, 2017 8:17 pm
Forum: General
Topic: Necroposting!
Replies: 21
Views: 14309

Re: Necroposting!

I'm a fan of snarky images, like this one:

Image
by Inny
Fri Jan 20, 2017 12:26 am
Forum: Libraries and Tools
Topic: Tic Tac Toe 1k Challenge
Replies: 17
Views: 7937

Re: Tic Tac Toe 1k Challenge

love.math.decompress is just outside the spirit of the challenges yet As for using lua-minifier , I'm cool with it Come on you can't be for real. This minifying tool does same exact thing as real compression except worse because it only removes redundant characters from the stream but doesn't optim...
by Inny
Thu Jan 19, 2017 7:02 pm
Forum: Libraries and Tools
Topic: Tic Tac Toe 1k Challenge
Replies: 17
Views: 7937

Re: Tic Tac Toe 1k Challenge

Just to put my opinion in there on compression: The decompression code probably has to be in your main.lua and be run, so that it gets counted as part of your character count. The same would be true for all clever string manipulation that gets done (which happened in some of the 1k terminal entries)...
by Inny
Tue Jan 17, 2017 5:28 pm
Forum: Libraries and Tools
Topic: Tic Tac Toe 1k Challenge
Replies: 17
Views: 7937

Re: Tic Tac Toe 1k Challenge

Looking good so far. I like raidho36 indicates turn by making the cursor be the current player's symbol, it's very clever.
alberto_lara wrote:you should add a .love file instead of a zip
Sorry, I just forgot to rename it, but yeah it's a zip file with a main.lua in it, so it should run just fine.
by Inny
Sun Jan 15, 2017 8:05 pm
Forum: Libraries and Tools
Topic: Tic Tac Toe 1k Challenge
Replies: 17
Views: 7937

Tic Tac Toe 1k Challenge

I had a spare hour today, so I thought I'd give you guys all a little challenge. This is Tic Tac Toe (or Crosses and Naughts if you live on the other side of the pond). Here's my twist: everyone should do their challenge straight from memory, without checking each other's results first and iterating...
by Inny
Sat Dec 31, 2016 5:50 pm
Forum: Libraries and Tools
Topic: Lists; a fast way to store objects.
Replies: 36
Views: 20158

Re: Lists; a fast way to store objects.

All of the lhs and rhs (of the equals sign) get evaluated first (for example a #t on the left is evaluated before any assignments), but then assignments are made from right to left: a, b, c = 1, 2, 3 -- is equivalent to c = 3 b = 2 a = 1 Just to clarify this, Lua evaluates left to right, and then a...
by Inny
Fri Dec 30, 2016 12:51 am
Forum: Libraries and Tools
Topic: 1K Asteroids Challenge
Replies: 20
Views: 12927

Re: 1K Asteroids Challenge

1024 on the nose. Output from lua-min L=love;G=L.graphics;M=math;c=M.cos;s=M.sin;T=table;R=T.remove;I=T.insert;X=130;function K(G,e,f)for g=0,e*2,2 do j=M.pi*g/e;f[g+1]=f.r*c(j)f[g+2]=f.r*s(j)end;f.d=f.v*c(f.o)f.e=f.v*s(f.o)I(G,f)end;function r()B={}K(B,3,{x=400,y=300,r=9,o=0,v=0})P=B[1]A={}for g=0,...