Feel free to look at my code to Find the Exit for inspiration.
You should be able to use just one hitbox for collision detection against the top, left, right, and bottom edges. I like to make a separate function to see how far the player can move each direction. I also separate the tests so checking left or right then up or down clipping on any collision.
The pictures look nice, I should download it and see if I can find anything I can help with.
Replying to:seggiepantsFeel free to look at my code to Find the Exit for inspiration.
You should be able to use just one hitbox for collision detection against the top, left, right, and bottom edges. I like to make a separate function to see how far the player can move each direction. I also separate the tests so checking left or right then up or down clipping on any collision.
The pictures look nice, I should download it and see if I can find anything I can help with.
Thanks! I'll take a look at your code later for some help.
I found a few bugs.
You are missing a routine for collision on the right side which let's you walk through walls.
You don't check if the player has hit the ground before letting them jump again which allows continuous jumping which crashes things when you exit the top of the screen
You can hang in midair if you are jumping left against a wall.
The worst one, if you let the program run for about ten minutes you get a stack overflow in a random unrelated part of the code. This is because you are using GOTO. If you need help using functions or loops let me know and I can write something up for you. You are GOSUBing a routine to show the player Sprite which instead of RETURNing, it does a GOTO your game loop instead. This eats up a little bit of memory every time through your game loop until everything crashes.
Watch as the haters call me names for saying GOTO is bad now.