Search found 69 matches

by unixfreak
Sat Apr 22, 2017 5:09 am
Forum: Support and Development
Topic: [SOLVED] Bezier Curves, how to trace a line?
Replies: 21
Views: 4507

Re: Bezier Curves, how to trace a line?

But it is referenced, by the ipairs iterator. You are basically pulling elements out under the iterator, which also moves all indices back by one, making it skip entries. Then i suppose it must be good practice to iterate over all tables backwards where items are added/removed in a loop every time?...
by unixfreak
Fri Apr 21, 2017 6:48 am
Forum: Support and Development
Topic: [SOLVED] Bezier Curves, how to trace a line?
Replies: 21
Views: 4507

Re: Bezier Curves, how to trace a line?

Read the following post it covers the problem https://love2d.org/forums/viewtopic.php?f=4&t=83667&p=210479&hilit=ipairs+game#p210511 I'm fully aware of how that can cause problems in some use cases, but it isn't important here. The i value is only being used to remove that index from the list, it's...
by unixfreak
Fri Apr 21, 2017 2:13 am
Forum: Support and Development
Topic: [SOLVED] Bezier Curves, how to trace a line?
Replies: 21
Views: 4507

Re: Bezier Curves, how to trace a line?

Thanks that makes sense now, i changed it a little so that the target is always added at the exact end of the bezier curve. Many thanks. I understand the ipairs function, i don't see what you mean there though. But this is working great nicely now. :awesome: function missiles.update(dt) for i, missi...
by unixfreak
Thu Apr 20, 2017 12:35 am
Forum: Support and Development
Topic: [SOLVED] Bezier Curves, how to trace a line?
Replies: 21
Views: 4507

Re: Bezier Curves, how to trace a line?

Thank you both, very much this has helped alot. I think i understand this more now. I only stumbled upon this function for bezier curves yesterday, and it's not something i'm familiar with. Using your examples i managed to implement something roughly that works... although my implementation seems to...
by unixfreak
Wed Apr 19, 2017 8:50 am
Forum: Support and Development
Topic: [SOLVED] Bezier Curves, how to trace a line?
Replies: 21
Views: 4507

Re: Bezier Curves, how to trace a line?

May be something like you want. (old love with extraneous code) Click on control points to see effect, Thanks, i'll have a look at the code later, that should be useful. And now another episode of Two and a Half coordinates: Or i just clobbered together a snippet in about 30 seconds and ran it once...
by unixfreak
Wed Apr 19, 2017 2:08 am
Forum: Support and Development
Topic: [SOLVED] Bezier Curves, how to trace a line?
Replies: 21
Views: 4507

[SOLVED] Bezier Curves, how to trace a line?

How can i make a point traverse across a bezier curve? I whipped up a small example which hopefully will show what i want to achieve. I'm trying to get an object to travel along a defined bezier curve, but having trouble figuring out how i would do this. Basically, i want to plot 2 points, then move...
by unixfreak
Wed Apr 19, 2017 12:55 am
Forum: Games and Creations
Topic: Space Worm
Replies: 4
Views: 1243

Re: Space Worm

Fantastic. Really like the overall style of the game. Very nice job!
by unixfreak
Sat Apr 08, 2017 5:30 pm
Forum: Support and Development
Topic: [SOLVED] Dynamic camera scaling dependent on resolution?
Replies: 3
Views: 756

Re: Dynamic camera scaling dependent on resolution?

Here's how I do it. I also usually do letterboxing but that's an extra step I'll just drop for now. Side thing: if you're making a horizontal platformer, maybe you'd prefer to only ever use scale_x, so that the distance between the player and the edge of the screen is fixed and same deal for a vert...
by unixfreak
Sat Apr 08, 2017 5:05 pm
Forum: Support and Development
Topic: [SOLVED] Dynamic camera scaling dependent on resolution?
Replies: 3
Views: 756

Re: Dynamic camera scaling dependent on resolution?

Well more fiddling about this seems to work: local scale = (default_width / (love.graphics.getWidth() * love.graphics.getHeight()) *1000) camera.scaleX = scale camera.scaleY = scale Although the width is not perfect, how can i improve that to get the exact horizontal view distance in any resolution?
by unixfreak
Sat Apr 08, 2017 4:32 pm
Forum: Support and Development
Topic: [SOLVED] Dynamic camera scaling dependent on resolution?
Replies: 3
Views: 756

[SOLVED] Dynamic camera scaling dependent on resolution?

Math has never been my strong point, and i'm in a pickle figuring this out for a platformer engine i've been making. The default window size is 1024 x 768, when not fullscreen. Let's say the user had 1920 x 1080 as their resolution, when toggling into fullscreen (desktop) mode the window will simply...