Search found 5 matches

by chingydongy
Thu Feb 22, 2018 4:01 pm
Forum: Support and Development
Topic: Collision detection problem
Replies: 4
Views: 3409

Re: Collision detection problem

Well, after going through all of your guys advice, I looked at my player.lua, where the player table isn't inserted in the same way as the bullets and the enemies are through said tables (the player was declared as a player = {x,y,w,h}, not as player = {} with a table.insert() afterwards). Of course...
by chingydongy
Wed Feb 21, 2018 8:52 pm
Forum: Support and Development
Topic: Collision detection problem
Replies: 4
Views: 3409

Collision detection problem

Hello everyone, I have been on this code for the past few months, since I never have the time to work on it, I mostly left it as it is, with only small improvements anytime I can get my hands on it. My question here is, why in all hell isn't the collision detection working with the player/enemy as i...
by chingydongy
Mon Jan 22, 2018 1:31 pm
Forum: Support and Development
Topic: Enemies chasing player
Replies: 3
Views: 3826

Re: Enemies chasing player

Well, I managed to get it to work by doing this: function enemymove(dt) for i,v in ipairs(enemy) do enemyDirectionX = player.x - v.x enemyDirectionY = player.y - v.y distance = math.sqrt(enemyDirectionX * enemyDirectionX + enemyDirectionY * enemyDirectionY) end if distance ~= 0 then for i,v in ipair...
by chingydongy
Mon Jan 22, 2018 8:38 am
Forum: Support and Development
Topic: Enemies chasing player
Replies: 3
Views: 3826

Re: Enemies chasing player

Hello! I also just recently got into Lua/Love2D, but here's my two cents on the subject... Is the error being reported on line 58 or 59, by any chance? If that's so, I noticed your "for" variables on line 57 are "_" and "enememe" for the index and object respectively. ...
by chingydongy
Sat Jan 20, 2018 5:01 pm
Forum: Support and Development
Topic: Enemies chasing player
Replies: 3
Views: 3826

Enemies chasing player

Now I am stuck on a part where enemies are supposed to chase the player but the when i run the thing, it gives me an error where it tries to do an arithmetic on field 'x' and says its a nil value, but the enemies should probably be spawned already by the time the last piece is loaded. require("...