Search found 12 matches

by vilonis
Thu Aug 22, 2024 12:34 am
Forum: General
Topic: What is your solution to inventory management?
Replies: 7
Views: 5780

Re: What is your solution to inventory management?

I’m making a roguelike dungeon crawler and I’m batting around number of different questions for my game, like if items should be sellable. That is, should the player have a reason to carry items they don’t intend to use. If no, the inventory should limit their ability to carry assistive items like p...
by vilonis
Wed Aug 21, 2024 2:42 pm
Forum: General
Topic: Atom alternatives
Replies: 10
Views: 7156

Re: Atom alternatives

Please don’t edit /etc/paths. If you’re trying to add something to your path, you would edit the environment variable PATH, but that shouldn’t be necessary for this. VS Code had a love2d extension that adds a command to run the love executable with the current project. You can just install love2d as...
by vilonis
Wed Aug 21, 2024 2:37 pm
Forum: General
Topic: Hesitate to come back on Love2D
Replies: 12
Views: 9451

Re: Hesitate to come back on Love2D

You absolutely do not have to use classes or OOP in Love2D. In fact, in my game, I don’t use any classes at all, just tables and functions. I generally dislike OOP. It is an okay system for code organization, but makes it really difficult to track object lifecycles in my experience. So just write yo...
by vilonis
Fri Aug 16, 2024 11:56 pm
Forum: Support and Development
Topic: Coroutines any advantage in my case ?
Replies: 7
Views: 5441

Re: Coroutines any advantage in my case ?

You probably shouldn’t use coroutines to solve architectural problems for your game. First of all, coroutines in Lua don’t give you parallel execution. You’re still running with one thread, that thread is just bouncing between different stacks as it moves from one coroutine to another. You need to u...
by vilonis
Tue Jul 09, 2024 9:25 pm
Forum: Support and Development
Topic: function outputs two values, but i dont know how to use booth
Replies: 3
Views: 1657

Re: function outputs two values, but i dont know how to use booth

That’s weird, does it change anything if you use multiple return values instead of returning a table?
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: 2790

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: 2908

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: 1197

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: 1949

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: 1261

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?