Hi, I am EXTREMELY new to love2D.
I have been watching tutorials, I have a neat game in development. But one thing that is a MUST in this development process is the prevention of the game character from walking off screen.
Is there any possible way to set a boundry on set sides of my game window?
Setting a boundry
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Setting a boundry
Yes, just don't let it walk outside. So whenever you want to move your character, first calculate the next x and y coordinates that the character would have after the movement, then check that those coordinates are within the window, and if so, do the movement.
My game called Hat Cat and the Obvious Crimes Against the Fundamental Laws of Physics is out now!
Re: Setting a boundry
I figured it out. Thanks anyways!
Who is online
Users browsing this forum: Bing [Bot] and 0 guests