13
« on: January 28, 2021, 07:59:32 pm »
The major difference between your code and mine is that your raycast is based off a static entity, whereas mine is being done from a constantly moving one, the player. The static values you have set for x2 and y2 don't work in my case. Trying to run what I believe is the corrected variation of your code crashes instantly.
To elaborate what I am trying to do, I need the game to constantly be checking where the player is pointing and marking the x and y coordinates of the first object in the player's line of sight, be it tiles or actors. As another side note, I am having issues trying to figure out the coordinates that should be entered if the player is looking at a 45 degree angle, as the x and y location of the line would be different from a simple check of the scene's height/width. If that's too much of an issue for this thread I'll make a separate one for it.