[SOLVED] Help with rotation
Posted: Sun Oct 18, 2015 1:41 pm
Hi I was working on a simple dungeon crawler maze, I am basically drawing walls on the screen with love.draw.polygon().
I placed everything into neat tables so i don't have to retype the co-ordinates. The units go by width 100, height 100.
You can use the arrow keys to move around (navigate the table when key is released). I am sort of stuck with the rotation part. I am using the , and . keys to rotate (, is rotate counter clockwise . is rotate clockwise).
The problem is when I rotate the co-ords go off, Is there an easy way to do this?
I want to rotate into a new table and keep the orientation right with x and y.
Also Im really wasting a lot of space with empty polygons just to keep things square. This means the collision does not work and you can go straight through walls.
My aim is to make a simple FPS Dungeon Crawler like some of the first DOS games. x = x array in table (left and right)
y = y array in table (forward and backwards)
t = table chunk with a bunch of walls for each step.
v[t][x][y][j] would get you a point. v[t][x][y] would get you a bunch of points in a tables (one polygon).
I placed everything into neat tables so i don't have to retype the co-ordinates. The units go by width 100, height 100.
You can use the arrow keys to move around (navigate the table when key is released). I am sort of stuck with the rotation part. I am using the , and . keys to rotate (, is rotate counter clockwise . is rotate clockwise).
The problem is when I rotate the co-ords go off, Is there an easy way to do this?
I want to rotate into a new table and keep the orientation right with x and y.
Also Im really wasting a lot of space with empty polygons just to keep things square. This means the collision does not work and you can go straight through walls.
My aim is to make a simple FPS Dungeon Crawler like some of the first DOS games. x = x array in table (left and right)
y = y array in table (forward and backwards)
t = table chunk with a bunch of walls for each step.
v[t][x][y][j] would get you a point. v[t][x][y] would get you a bunch of points in a tables (one polygon).