LiamMcKenzie / ScaredKrow

ScaredKrow is a game made for the third year "ID737001 Game Development" paper at Otago Polytechnic
MIT License
1 stars 2 forks source link

Player Movement #11

Closed LiamMcKenzie closed 4 months ago

LiamMcKenzie commented 5 months ago

Linked Issues:

LiamMcKenzie commented 5 months ago

Here is the basic scene setup, I've added simple camera movement. I still need to add the player movement prototype

JohnathanGlasgow commented 4 months ago

Hey I've had a look at this and it's great. The animation has nice character and the player is maintaining the correct position relative the tiles. In regards to the issue with the player "disappearing", this is because when then gridchunks are repositioned the list of tile controllers is repopulated so the tiles maintain the correct coordinates. However the player is not updating its coordinates when this happens. So the player doesn't disappear so much as move to a tile offscreen, which also deactivates the player if the tile optimisation is turned on. A quick, somewhat inelegant solution to this is to fire an event when the RepositionGridChunk method is called is in TileManager. Then listen for this event in PlayerMovement and subtract 14 from the player's x coordinate when it's invoked. I haven't tested this rigorously but it seems to resolve the issue.