Search found 5 matches
- Sat Apr 11, 2020 4:54 pm
- Forum: Support and Development
- Topic: Removing item from table while iterating
- Replies: 5
- Views: 4811
Re: Removing item from table while iterating
Thanks for answering guys! So, if I use MrFariator solution: -- traverse the table backwards local t = {1,5,2,5,3,5,4,5,6,5,7,5,8} for i = #t, 1, -1 do if t[i] == 5 then table.remove(t, i) end end and I only remove the elements after all updates (or ticks in my case), everything should be fine? Note...
- Fri Apr 10, 2020 11:32 pm
- Forum: Support and Development
- Topic: Removing item from table while iterating
- Replies: 5
- Views: 4811
Removing item from table while iterating
Hi everyone, So I have a question about inner game mechanics: I have a global table with all my game elements. I use this table to update all the elements (basically I iterate over it and update all elements). Imagine one of the elements in my loop is a bullet. When the bullet is destroyed, a functi...
- Mon Aug 05, 2019 6:40 pm
- Forum: Support and Development
- Topic: selfmade collision system doesn't work well
- Replies: 2
- Views: 4459
Re: selfmade collision system doesn't work well
Thanks for answering! I kept trying and I improved the code a bit. It is not perfect yet (sometimes the player is a bit placed into the wall (like one pixel)) but the stuttering and blocking of movement is gone. I think if you add sprites and animation then the problem of being placed into the wall ...
- Sun Aug 04, 2019 3:41 pm
- Forum: Support and Development
- Topic: Command line parameters not working
- Replies: 3
- Views: 5273
Re: Command line parameters not working
I tried the following command in my cmd: "C:\Program Files\LOVE\love.exe" "tester" a b and it worked for me. I put the main.lua in a folder called tester with the following code: function love.load(arg) for i,v in pairs(arg) do print(v) end end function love.update(dt) end functi...
- Sat Aug 03, 2019 3:42 pm
- Forum: Support and Development
- Topic: selfmade collision system doesn't work well
- Replies: 2
- Views: 4459
selfmade collision system doesn't work well
Hello! I'm new to programming with LÖVE (but not with programming in general, however I consider myself not that good. I still have a lot to learn). After getting to know Lua and LÖVE I decided to create a little platformer game to exercise. At first I followed a platformer tutorial but after a bit ...