O.K Ive been looking throgh your code, I noticed the strafe was not working and as I wrote it I had to fix it.
I didnt know dbSprite() only took integers as arguments, this is why strafe is acting weird and it also explains some strange results I used to get when doing 2D stuff.
I think you should scrap the move function and do strafe like this:
void strafeLeft(int spriteID)
{
dbRotateSprite(spriteID,dbWrapValue(dbSpriteAngle(spriteID)-90));
dbMoveSprite(spriteID,1);
dbRotateSprite(spriteID,dbWrapValue(dbSpriteAngle(spriteID)+90));
}
//Strafing Right by Matty
void strafeRight(int spriteID)
{
dbRotateSprite(spriteID,dbWrapValue(dbSpriteAngle(spriteID)+90));
dbMoveSprite(spriteID,1);
dbRotateSprite(spriteID,dbWrapValue(dbSpriteAngle(spriteID)-90));
}
Its alot simpler and easy to understand.
Then in your loop you will have:
if (dbKeyState(17)) dbMoveSprite(1,1);
if (dbKeyState(31)) dbMoveSprite(1,-1);
if (dbKeyState(30)) PMM.strafeLeft(1); // Strafe Left
if (dbKeyState(32)) PMM.strafeRight(1); // Strafe Right
// I would use arrow keys instead (or as well), unless you have something planned for them
This is an improvement on what you had, its all I have time for, for now.
I'll try to look at your collision but I have not done much collision stuff myself, It can be very tricky.
Overall though, I like what you have done so far, you will definately make a good game developer.
ps. you were probably going to get around to it anyway but I would have a followCurser() function in my player class for this:
Angle = dbAtanFull(dbMouseX()-dbSpriteX(1),dbSpriteY(1)-dbMouseY());
dbRotateSprite(1,Angle);