How to switch ipairs without having to rewrite?
Posted: Thu May 23, 2019 6:21 am
Hello, This is my first post to the Love2d forums and even though I've been using this framework for about 4 years, I ran into an issue im having difficulty solving on my own.
I want to find a way for the ipairs to switch the name to something else.
for example:
to
I want to find a way to have the value in the parantheses change but I can't figure out how.
is there a way or something similar that can achieve this effect?
I want to find a way for the ipairs to switch the name to something else.
for example:
Code: Select all
for i,v in ipairs(opp) do
if majormel84:getCurrentFrame() >= 42 and majormel84:getCurrentFrame() <= 44
and CheckCollision (v.x, v.y, v.w, v.h,majormel.l + 45 , light.y , light.w, light.h)
and majormel.x < opp.x and light.active == false and v.blocked==false then
Code: Select all
for i,v in ipairs(player1) do
if majormel84:getCurrentFrame() >= 42 and majormel84:getCurrentFrame() <= 44
and CheckCollision (v.x, v.y, v.w, v.h,majormel.l + 45 , light.y , light.w, light.h)
and majormel.x < opp.x and light.active == false and v.blocked==false then
is there a way or something similar that can achieve this effect?