Works like a charm! Thank you so much for taking the time to not only help me fix the problem, but sift through all my code and help me fix it step by step!
I do have one bug, however, which I have semi-fixed. With the whole gridx - 1 and gridy - 1, Whenever I start the game, the player jumps to a coordinate that isn't the direction I want it to go when first pressing an arrow key, then from then on it's fine. When I took away the gridx-1 and gridy-1, it worked fine, except for that when you go to the very left or very top, you get an error.
Collision grid
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Collision grid
You have to put the gridx-1 also in the place where you initialize the player. (beginning of player.lua)
Check out my blog on gamedev
Who is online
Users browsing this forum: Ahrefs [Bot] and 3 guests