Ok. the sixth iteration is over. In this one I added some "solid" objects to the map and manage the collisions between the player and the map. Since the collisions are tile based this iteration ended way easier than I initially thought. Here is a small description of what I did:
In my last post I mentioned that most of the logic of the Pokemon maps is tile based instead of continuum. This is exactly why is so easy to use "look ahead points" to manage the collisions instead of going for a "pixel perfect" approach. I basically started doing this:
Instead of checking the whole avatar to see if it's colliding with some "solid tile" I just check the pink points n_n. Also I don't always check the four points. I just check the ones that are relevant to the direction of the player.
Later I noticed that having only one point per direction could lead to some wacky collisions don't being recognized...>_<. So I added two more relevant points.
![]()
And It was perfect ^_^...there is still room for improvement though. Here is a short list of things that COULD be done, but I wont now. (I'll probably do them in my first "complete" RPG)
- I think that the middle collision point isn't THAT useful now that I have 3 per side. It could be removed. But It must be tested
- Also, I noticed some bumps with the camera system when the player is colliding with a solid tile. Right now the camera want to ALWAYS have the avatar sprite at it's center.
I could try to add a "smooth" value. So that the camera only moves when the player is actually moving.
That's all for now...the next iteration will focus on animated tiles. I don't really know how many iterations will take to finish the system...BUT there are only have 7 main features left :D so it MAY be 7-10 iterations :)







That isn't a 100% accurate diagram. I've changed some things but is good enough so that you can see what is happening :) (If you understand UML). Also I want to share with you the "milestones" of this iteration: