Search found 20 matches

by SirRanjid
Fri Jan 12, 2018 3:55 pm
Forum: General
Topic: [HELP]Rotating circles around the middle and not corner
Replies: 4
Views: 241

Re: [HELP]Rotating circles around the middle and not corner

That it's rotating around the upper left corner is good because it's the origin(x=0 and y=0). Just translate the origin to the desired position the way you're doing it. Or if you wanna have rotation and translation in the same line: planetX = math.cos(angle) * rotation_radius + rotation_center_offse...
by SirRanjid
Thu Jan 11, 2018 11:39 am
Forum: Support and Development
Topic: Multicore/Threading help?
Replies: 7
Views: 334

Re: Multicore/Threading help?

The snowflakes-eyecandy example was just an easy example i made up without testing mostly to get the concept right. Reading that it probably works serves it's purpose. But how is it unoptimal? Unoptimal in the sense of rather don't use threads here or can I actually improve the code above to be fast...
by SirRanjid
Thu Jan 11, 2018 7:38 am
Forum: Support and Development
Topic: Multicore/Threading help?
Replies: 7
Views: 334

Re: Multicore/Threading help?

Ok thanks for this addition. Now I don't understand why I got to copy tables in lua as they're always passed by reference. How exactly do I retrieve passed variables on the other thread? I mean I pass them with Thread:start(arg_1,...,arg_n) ...meh found it as note didn't think it would be as easy as...
by SirRanjid
Wed Jan 10, 2018 7:53 pm
Forum: Support and Development
Topic: Multicore/Threading help?
Replies: 7
Views: 334

Re: Multicore/Threading help?

Wow. Thanks for that explanation. I think I kinda get it. But all have essentially the same idea. Data is copied. One way to do this is by creating a queue or stack which points at data. By doing so we first copy the data and then simply push the reference onto the stack. That's what's happening her...
by SirRanjid
Wed Jan 10, 2018 3:01 pm
Forum: Support and Development
Topic: Multicore/Threading help?
Replies: 7
Views: 334

Multicore/Threading help?

Hello I tried wrapping my mind around outsourcing tasks to other threads for efficiency reasons. But I never made something like it before and I can't get the basic concept to work in my mind. Suppose having stuff drawn that shuld be calculated on another thread. My intuition would be like(semi-pseu...
by SirRanjid
Thu Dec 28, 2017 11:44 am
Forum: Support and Development
Topic: 2d arrays of arbitrary size
Replies: 6
Views: 296

Re: 2d arrays of arbitrary size

A bit more optimized would be having a table like you mentioned that stores chunks of predefined sized 2d tables which use ivans method. bigtable = { [x64] = { [y64]= {["x64y64"] = {[x+y*64] = {<TILE>}}} } } Just load/generate chunks from that bigtable as you need them for rendering. This makes it m...
by SirRanjid
Tue Dec 26, 2017 12:48 pm
Forum: Support and Development
Topic: Make speed constant no matter the FPS
Replies: 5
Views: 367

Re: Make speed constant no matter the FPS

My guess would be you're using the dt of the update function inside the draw.
by SirRanjid
Mon Dec 25, 2017 11:34 am
Forum: Support and Development
Topic: Noborder Window Size
Replies: 1
Views: 126

Noborder Window Size

So I have a simple Border/Noborder toggle button which works but I'd rather have the noborder-window the size of the normal window + the border.

Image

Is there a way to get the size of the widow border? Or at least a smarter solution than measuring it for any os?
by SirRanjid
Wed Dec 20, 2017 6:16 pm
Forum: Support and Development
Topic: shader that leaves trails behind objects like like lightworld does
Replies: 7
Views: 560

Re: shader that leaves trails behind objects like like lightworld does

I've just come to a similar problem here's my try on it: First create some canvases in an array (i just used 10) local tcvs = {} local tcvsp = 1 --moving array index for I = 1 , 10 do tcvs[I] = love.graphics.newCanvas( ) end Then in the draw functionI do something like this (the functions lack love....
by SirRanjid
Fri Dec 15, 2017 4:34 pm
Forum: Support and Development
Topic: Saving a game
Replies: 6
Views: 316

Re: Saving a game

I've made a more general purpose data save/load script, which relies on serpent (MIT license) as serializer. Here you can find it. Basic usage: (nm is the name of the data table and the savefile like %appdata%/data/<nm>.txt) GAME.EZF:CreateNewData(nm[,tbl]) --creates a new data table for data to sto...