Suddenly, I can seem to keep the character from running off the screen to the right and down, but not up and to the left. That is, the "if position is less than zero, position is zero" isn't working. I'll upload my code, keep in mind the values are all screwed up because I've been messing with them trying to figure out the problem. The code in question is on playercolin.lua. Here it is by itself:
Code: Select all
if playercolin.positionx > 700*scale then
playercolin.positionx = 700*scale
end
if playercolin.positionx < 100*scale then
playercolin.positonx = 100*scale ---- WHY ISN'T THIS WORKING?
end
if playercolin.positiony > (1000-playercolin.colin_size/2)*scale then
playercolin.positiony = (1000-playercolin.colin_size/2)*scale
end
if playercolin.positiony < 100*scale then
playercolin.positony = 100*scale ---- WHY ISN'T THIS WORKING?
end