Skip to content

Conversation

@co012
Copy link
Collaborator

@co012 co012 commented May 4, 2022

Description

Checklist

  • Included code to test these changes
  • Updated Jira

@co012 co012 marked this pull request as ready for review May 4, 2022 14:46
Copy link
Collaborator

@mhawryluk mhawryluk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done! 🥇

Comment on lines +4 to +9
{ "tag": "object-1", "position": { "row": 1, "col": 8 }, "type": "collectible", "assetPath": "assets/diamond.png" },
{ "tag": "object-2", "position": { "row": 6, "col": 3 }, "type": "collectible", "assetPath": "assets/key.png" },
{ "tag": "object-3", "position": { "row": 1, "col": 1 }, "type": "dialog", "assetPath": "assets/zombie.png" },
{ "tag": "object-4", "position": { "row": 3, "col": 2 }, "type": "dialog", "assetPath": "assets/zombie.png" },
{ "tag": "object-5", "position": { "row": 8, "col": 8 }, "type": "dialog", "assetPath": "assets/chest.png" }
],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some objects don't fit on the map. map size is currently dependent on the asset dimensions, it should probably be specified in config instead, but that's a problem for another task ;)

LocationView nextView = this.tagToLocationViewMap.get(action.destinationLocationTag);
LocationModel nextModel = this.tagToLocationModelMap.get(action.destinationLocationTag);

playerController.teleportTo(nextModel, nextView, action.playerPosition);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could also check here if the location is unlocked, for example whether the player has enough points or a specific item in his equipment

@co012 co012 merged commit 5b83806 into master May 5, 2022
@co012 co012 deleted the @co012/RPG-108-teleport-action branch May 5, 2022 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants