Some help needed


(Isaac) #1

Hello, need help. How can you limit the boundaries of the screen so the player cant go off-screen?


(Gil) #2
FP.clampInRect (myEntity, 0 + originX, 0 + originY, FP.width + width, FP.height + height);

Use this in your entity’s update function and you should be fine


(Isaac) #3

Thanks for the help. but I dont know why it’s not working. I didn’t type in exactly the code you showed me, I adjusted it with the project im in.


(David Williams) #4

If we could see the code where you applied it, that’d be a big help.