Search found 7 matches

by vilonis
Wed Feb 28, 2024 5:05 pm
Forum: Support and Development
Topic: Finding which object in the table is closest
Replies: 5
Views: 1683

Re: Finding which object in the table is closest

You don’t even have to sort the list of enemies. For each tower, walk through the list of all enemies (using a for loop), keeping track of the “closest enemy so far” and how far away from the tower they are. When you get to the end of the list, you know “closest so far” is actually the closest, peri...
by vilonis
Fri Feb 23, 2024 4:32 pm
Forum: Support and Development
Topic: Trying to figure out collision with tiles in platformer game
Replies: 11
Views: 2224

Re: Trying to figure out collision with tiles in platformer game

Honestly don’t worry about performance at first, there re ways to make collision checking faster later (using some kind of spatial partitioning data structure for everything your player could collide with). Having blocks that each have their own dimensions and a position that isn’t necessarily snapp...
by vilonis
Mon Feb 05, 2024 1:23 am
Forum: Support and Development
Topic: How to get the position of a moving object once? without it being updated
Replies: 2
Views: 961

Re: How to get the position of a moving object once? without it being updated

If you’re hung up on efficiency, hence having trouble choking from your 10 ideas, try not to worry about it!

If that’s not possible, implement Bobbie68’s idea as a ring buffer.
by vilonis
Sat Feb 03, 2024 6:16 pm
Forum: General
Topic: Please help with my code
Replies: 3
Views: 1601

Re: Please help with my code

I don’t k is what anim8 is, but it expects its first parameter to be a positive integer and you aren’t passing anything.
by vilonis
Sat Feb 03, 2024 5:53 pm
Forum: General
Topic: why is my code not working? (i am following sheepolution tutorial on how to make a game)
Replies: 2
Views: 974

Re: why is my code not working? (i am following sheepolution tutorial on how to make a game)

Is this all of the code? If not then you need to provide everything you’ve written. Right now I don’t see self.x and self.y being set anywhere.

Also, for context, what, if any, programming background do you have?
by vilonis
Tue Jan 30, 2024 1:39 am
Forum: General
Topic: Using love while learning c++
Replies: 6
Views: 1249

Re: Using love while learning c++

I don’t know that love is packaged in a way to make that easy, but presumably you could download the source use the C++ directly instead of going through the Lia interface.

But you might be better off using a different cross platform library, like SDL2.
by vilonis
Mon Jan 22, 2024 3:40 pm
Forum: Support and Development
Topic: 2D lighting engines
Replies: 12
Views: 28121

Re: 2D lighting engines

Actually, I could do with some help for it - currently the lighting is very smooth, and I'd rather it's pixellated and alligned with the texture, which could help with optimising if its at it's native resolution, however short of rendering each texture to a canvas every frame, I can't think of a go...