Search found 58 matches

by Lua Hal
Wed Jul 13, 2011 7:47 pm
Forum: Support and Development
Topic: I'm new to Lua, and do not understand what I'm doing wrong.
Replies: 16
Views: 4437

Re: I'm new to Lua, and do not understand what I'm doing wro

I'm not sure what you mean, using Lua as a parser. Also, I re-wrote it trying to make it more efficient, but it still doesn't even do the most simple part. function npcparse() npcdata={} data={} for line in love.filesystem.lines("config.txt") do table.insert(data,line) end for i = 1,#data...
by Lua Hal
Wed Jul 13, 2011 6:32 pm
Forum: General
Topic: has anyone made an API for rotation?
Replies: 12
Views: 2334

has anyone made an API for rotation?

Something like...

Code: Select all

Object = love.new.graphics.newImage("blah.jpg")
Object.Rotation = 90 --degrees
love.graphics.draw(Object,400,400)
Is this possible?

I have no idea how to use the current rotation, and this would make things easier for me.
by Lua Hal
Wed Jul 13, 2011 6:13 pm
Forum: Support and Development
Topic: I'm new to Lua, and do not understand what I'm doing wrong.
Replies: 16
Views: 4437

Re: I'm new to Lua, and do not understand what I'm doing wro

I'm not sure what you mean, using Lua as a parser. Also, I re-wrote it trying to make it more efficient, but it still doesn't even do the most simple part. function npcparse() npcdata={} data={} for line in love.filesystem.lines("config.txt") do table.insert(data,line) end for i = 1,#data ...
by Lua Hal
Wed Jul 13, 2011 12:42 pm
Forum: Support and Development
Topic: I'm new to Lua, and do not understand what I'm doing wrong.
Replies: 16
Views: 4437

Re: I'm new to Lua, and do not understand what I'm doing wro

With something that complicated, it would be easier to just make the file Lua, and use require(). If you want to write to it as well, that's possible but slightly harder. See http://lua-users.org/wiki/TableSerialization for examples for writing a table to a file. I don't plan on writing to it. It m...
by Lua Hal
Wed Jul 13, 2011 1:16 am
Forum: Support and Development
Topic: I'm new to Lua, and do not understand what I'm doing wrong.
Replies: 16
Views: 4437

Re: I'm new to Lua, and do not understand what I'm doing wro

function npcparse() npcdata={} data={} for line in love.filesystem.lines("config.txt") do table.insert(data,line) end for i = 1,#data do if string.lower(string.sub(data[i],0,6)) == "spawnx" then spawnx=string.sub(data[i],7) elseif string.lower(string.sub(data[i],0,6)) == "s...
by Lua Hal
Wed Jul 13, 2011 12:28 am
Forum: Games and Creations
Topic: Tilt reboot (alpha 4) - need as many testers as possible!
Replies: 32
Views: 6188

Re: Tilt reboot (alpha 2) - need as many testers as possible

I didn't find a bug, but I suggest a setting for the weight of the ball, it seemed far to light.
Also, maybe alternately use the arrow keys or WASD to control the movement of the paddles, the mouse seemed clunky and hard to use.
by Lua Hal
Tue Jul 12, 2011 11:58 pm
Forum: Support and Development
Topic: I'm new to Lua, and do not understand what I'm doing wrong.
Replies: 16
Views: 4437

Re: I'm new to Lua, and do not understand what I'm doing wro

Thanks, but It is part of a larger parser to read from a file for making NPCs with data: spawnx=6 spawny=6 newNPC[ name;Shopkeeper X;30 Y;30 type;Shop selling( 1 2 3 ) texture;Shopkeeper.png ] newNPC[ name;Blacksmith X;34 Y;34 type;Shop selling( 4 5 6 7 8 9 10 11 12 13 14 15 16 ) texture;Blacksmith....
by Lua Hal
Tue Jul 12, 2011 10:37 pm
Forum: Support and Development
Topic: I'm new to Lua, and do not understand what I'm doing wrong.
Replies: 16
Views: 4437

I'm new to Lua, and do not understand what I'm doing wrong.

tab = {"HI;7","New;8"} npcdata={} function love.draw() for index = 1,# tab do npcdata[string.sub(tab[index],0,string.find(tab[index],";"))] = string.sub(tab[index],string.find(tab[index],";")) end love.graphics.print("Hi:" .. npcdata["HI"])...