Search found 41 matches

by xFade
Mon Jun 16, 2014 9:09 pm
Forum: General
Topic: Load And Play GIFS with GSLIB
Replies: 6
Views: 3868

Re: Load And Play GIFS with GSLIB

jjmafiae wrote:Is this faster than running a spritesheet, comrade?
I couldn't tell you. I have never used sprite sheets.
by xFade
Sun Jun 15, 2014 11:03 pm
Forum: General
Topic: Load And Play GIFS with GSLIB
Replies: 6
Views: 3868

Re: Load And Play GIFS with GSLIB

Another Neat Example:
by xFade
Sun Jun 15, 2014 10:41 pm
Forum: General
Topic: Load And Play GIFS with GSLIB
Replies: 6
Views: 3868

Re: Load And Play GIFS with GSLIB

Small Update :P print("GSLIB LOADED...") local gs = {} gs.__index = gs local i = "" function gs:Init(x) i = x print(x.." Initialized!") end setmetatable(gs, { _call = function(cls,...) return cls.new(...) end, }) function gs.NewGif(init,loop) local self = setmetatable({...
by xFade
Sun Jun 15, 2014 10:29 pm
Forum: General
Topic: Load And Play GIFS with GSLIB
Replies: 6
Views: 3868

Load And Play GIFS with GSLIB

I created a gif loading library with the help of DaedalusYoung. print("GSLIB LOADED...") local gs = {} gs.__index = gs local i = "" function gs:Init(x) i = x print(x.." Initialized!") end setmetatable(gs, { _call = function(cls,...) return cls.new(...) end, }) function ...
by xFade
Sun Jun 15, 2014 9:03 pm
Forum: General
Topic: Tables And Metatables
Replies: 4
Views: 2624

Re: Tables And Metatables

You don't need metatables to store graphics, just load them in a regular table and access them by the index number. Yes but how do I do it without having to write it out. In a form of a loop. How can I store all the images in the table with a loop? Like so... local frames = love.filesystem.getDirec...
by xFade
Sat Jun 14, 2014 11:18 pm
Forum: General
Topic: Tables And Metatables
Replies: 4
Views: 2624

Tables And Metatables

local gs = {} gs.__index = gs local i = "" function gs:Init(x) i = x print(x.." Initialized!") end setmetatable(gs, { _call = function(cls,...) return cls.new(...) end, }) function gs.NewGif(init) local self = setmetatable({},gs) local frames = love.filesystem.getDirectoryItems(...
by xFade
Thu May 15, 2014 11:23 am
Forum: General
Topic: Fast way to require files?
Replies: 7
Views: 4546

Re: Fast way to require files?

Code: Select all

function love.load()
  print("Loading...")
  for i,v in ipairs(files) do
    print("Requiring..."..v)
    v = v:sub(1,-5)
    require(fdir..v)
  end
  gamestate = "intro"
  IntroScreen:start()
end
Thank you all for replying, the above code works fine.
by xFade
Thu May 15, 2014 1:42 am
Forum: General
Topic: Fast way to require files?
Replies: 7
Views: 4546

Re: Fast way to require files?

Code: Select all

function love.load()
  print("Loading...")
  for i,v in ipairs(files) do
    print("Requiring..."..v)
    require(v) -- This being line 20
  end
end
It requires it however.... It gives me an error 'main.lua:20: module'intro.lua' not found
by xFade
Thu May 15, 2014 12:37 am
Forum: General
Topic: Fast way to require files?
Replies: 7
Views: 4546

Fast way to require files?

local files = love.filesystem.getDirectoryItems(fdir) function love.load() print("Loading...") for i,v in ipairs(files) do print("Requiring..."..v) -- require = files This does not work :,( end end Is there a nice way to require files using a for loop? I tried the above it did n...
by xFade
Wed May 07, 2014 1:32 am
Forum: General
Topic: Saving a stat
Replies: 2
Views: 2177

Saving a stat

player = {} player.points = 0 e = love.filesystem.exists("points.lua") if e then chunk = love.filesystem.load("points.lua") chunk() elseif not e then pp = love.filesystem.newFile("points.lua") end success = love.filesystem.write("points.lua",table.show(player,...