New answers tagged

2

Shared pointers make sense when you have unclear ownership and unclear lifespan; otherwise they're just a dead weight you're dragging around. For most games you want to have a defined build-up and tear-down points where you load all your data and dump all your data. For example, at level load and level complete. In this case you can just use a nice, clean, ...


0

Your issue is that you are over complicating your requirements. If a hero occupies a cell, then the cell is blocked. Do not allow "hero" objects to occupy the same cell. A* only cares if the cell is blocked or not, so all you need to do is tell it if the cell is walkable. Whenever a hero moves(changes cell), update your grid. Mark it's previous position(...


Top 50 recent answers are included