You are browsing as a guest. Sign up (or log in) to start making projects!

3h 27m 17s logged

Dev Log #9
.
Not the best keyboard clacking session, but not the worst. Looking at you Dev Log #4 >:[
.
Today I added pixel perfect collision.
.
First I got the players mask and a list of the rectangle tiles touching my player rectangle. I then listed these rectangles and was able to detect collision based on if they made contact with the players mask.
.
The next step was collision resolution.
.
After a detected collision, the location of collision is then increase the y co-ordinate of the player mask, effectivly keeping the player above the ground. This is how collision resolution works for all the other directions, just with varying positions.
.
With this I then attempted to add a feature that stopped rotation as a surface was hit, to prevent a constanly spinning gun that sits on the floor.
.
This is still a WIP, but I have been able to make the gun stop all movement once on contact on a wall, but this is unrealistic as in real life if an object makes contact with a wall it does not loose all its momentum.
.
I will try to combat this isse by adding a bounce effect that gradually reduces momentum on wall contact, rather than causing it to loose all of it.
.
Next devlog I hope to have a working wall bounce system and maybe a finish goal that, when entered, plays a victory noise and victory screen.
.
Holding out hope for the future!!

0
11

Comments 0

No comments yet. Be the first!