Search found 107 matches

by Przemator
Mon Dec 03, 2012 6:16 pm
Forum: Support and Development
Topic: Drawing Smooth Curves
Replies: 11
Views: 8247

Re: Drawing Smooth Curves

When I decided to draw a bezier curve in Love, at some point the game started lagging. This was because I was drawing each segment separately in a for loop. Drawing as little as a few hundred segments already seemed a problem. Then I discovered you could put many points inside the love.graphics.line...
by Przemator
Fri Nov 30, 2012 8:11 pm
Forum: Support and Development
Topic: Multiple keys as one command
Replies: 8
Views: 3070

Re: Multiple keys as one command

This is handy for english keyboard input. However, it doesn't work with anything above 126, as Lua lacks unicode support. You can convert the unicode into string, you can try a function, like this: function love.load() tab = {} txt = "" font = love.graphics.newFont("consola.ttf"...
by Przemator
Thu Nov 29, 2012 11:33 am
Forum: Support and Development
Topic: Filesystem outside love directory
Replies: 11
Views: 3613

Re: Filesystem outside love directory

A related question. There are two locations: - the read-only .love archive - the read-write Save directory If I use functions like love.filesystem.exists("foo.bar") or love.filesystem.read("foo.bar") , LOVE will first look inside the SAVE directory and if it's missing, in the .LO...
by Przemator
Wed Nov 28, 2012 9:34 pm
Forum: Support and Development
Topic: Packets in LUBE
Replies: 17
Views: 7319

Re: Packets in LUBE

Oh okay so you use all three. And do you always have to do the "string.format("%s\n\n%s\n\n%s\n\n%s")" bit for everything you send over or is that specific to that example? I have a feeling like you didn't analyse the code thoroughly ;). You don't use all three functions, you on...
by Przemator
Wed Nov 28, 2012 2:42 pm
Forum: Support and Development
Topic: for loop seems to not work quite right
Replies: 10
Views: 4832

Re: for loop seems to not work quite right

OK, but why do you do this:

Code: Select all

for i in ipairs(spawned) do
   an = spawned[i]   
When it could be done like this:

Code: Select all

for index, value in ipairs(spawned) do
   -- no need for an, as value stores spawned[i]   
by Przemator
Wed Nov 28, 2012 2:37 pm
Forum: Support and Development
Topic: Packets in LUBE
Replies: 17
Views: 7319

Re: Packets in LUBE

Thanks a lot! I've got everything working (I think). I've downloaded Serpent and figured out how to serialize (serpent.line(message)), but I can't figure out how to deserialize, do you happen to know the name of the deserialization function? It's there in the link I gave you ;). local serpent = req...
by Przemator
Tue Nov 27, 2012 11:47 pm
Forum: Support and Development
Topic: Packets in LUBE
Replies: 17
Views: 7319

Re: Packets in LUBE

Oh! That clears it up quite a lot! Could you explain "message = "M" .. tostring(move)" this line though, is that what gives (1,1)? (not really sure here). Well, since you can only send strings via LUBE, and you want to put more than one variable in a packet, you have to concaten...
by Przemator
Tue Nov 27, 2012 10:12 pm
Forum: Support and Development
Topic: Packets in LUBE
Replies: 17
Views: 7319

Re: Packets in LUBE

Assuming we have 3 players online, let's assume they all send these things: P1 Sends: Moving, Combat, Skills P2 Sends: Combat, Skills, Moving P3 Sends: Skills, Moving, Combat As you can see they all send data in a different order. How does the server know to execute the function that handles Moving...
by Przemator
Tue Nov 27, 2012 8:34 pm
Forum: Support and Development
Topic: Packets in LUBE
Replies: 17
Views: 7319

Re: Packets in LUBE

So if I wanted to send different things in different orders I couldn't? Would that mean that I would just have to send everything every time I want to send something? What are you saying here? :P I don't understand. You receive a packet, then you read what it is, then you do something with it. With...
by Przemator
Tue Nov 27, 2012 8:01 pm
Forum: Support and Development
Topic: Packets in LUBE
Replies: 17
Views: 7319

Re: Packets in LUBE

When you read from a TCP socket, you're guaranteed to read the data in order it was sent. If ALL of your data has to be delivered, then you have to use TCP. UDP is good for data that expires after a short time (if it's old, it's useless) or that is replaced by new data. If you send player state via ...