Original Post
I have a function within an object that is supposed to build a box that the player won't fall through. The function works great except that I can't repeat it and create more boxes due to the way the function is layed out as so:
[script]
if(jumper.x+30 > x1+Map.x && jumper.x < x2+Map.x && jumper.y+60 > y1+Map.y && jumper.y < y2+Map.y){col = 5;}else{col = 0;}
[/script]
as you can see I have used ELSE to change the collision to 0 when he isn't touching the box. This causes any other boxes made to be in collidable and my player just falls through.
please help me fix this problem, I have tried using ELSE IF to find all the times that he isn't touching the block, but that doesn't work. I have also tried only detecting collision of objects within 50 pixels of the player, but that doesn't work either. What is the industry standard way of making multiple solid objects?
collide[2].collisionBox(1000,350,1100,370);
^^^^^the function^^^^^^^
[script]
if(jumper.x+30 > x1+Map.x && jumper.x < x2+Map.x && jumper.y+60 > y1+Map.y && jumper.y < y2+Map.y){col = 5;}else{col = 0;}
[/script]
as you can see I have used ELSE to change the collision to 0 when he isn't touching the box. This causes any other boxes made to be in collidable and my player just falls through.
please help me fix this problem, I have tried using ELSE IF to find all the times that he isn't touching the block, but that doesn't work. I have also tried only detecting collision of objects within 50 pixels of the player, but that doesn't work either. What is the industry standard way of making multiple solid objects?
collide[2].collisionBox(1000,350,1100,370);
^^^^^the function^^^^^^^