Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get surrounding tiles x,y position and check if passable #62

Closed
rontrek opened this issue Aug 30, 2019 · 13 comments
Closed

Get surrounding tiles x,y position and check if passable #62

rontrek opened this issue Aug 30, 2019 · 13 comments

Comments

@rontrek
Copy link

rontrek commented Aug 30, 2019

How do I get the x and y position of the surrounding tiles of a player? I am trying to place a NPC beside a vacant tile and to take specific action, not collide or moving at the exact position of the player.

@Joncom
Copy link
Collaborator

Joncom commented Aug 31, 2019 via email

@rontrek
Copy link
Author

rontrek commented Sep 1, 2019

Thanks @Joncom, but that would just be with position only and not knowing about the info of the tile if it is passable. Basically, I would like to get info on the tile if can be walkable and then get the position to move to it. I read somewhere if you can get the tile index? you can get more info about the tile.

@Joncom
Copy link
Collaborator

Joncom commented Sep 1, 2019 via email

@rontrek
Copy link
Author

rontrek commented Sep 1, 2019

Thanks, I can see now the results. I understand now that the numbering is also from the collision map tile set image that is used if I'm not mistaken.

Does getTile and setTile only works on collision maps? I tried using on my LevelMyMap variable that is used in loadLevel() but getting undefined errors.

Can I also get info of a tile if it is also occupied by an Entity?

@Joncom
Copy link
Collaborator

Joncom commented Sep 1, 2019 via email

@Joncom
Copy link
Collaborator

Joncom commented Sep 1, 2019 via email

@rontrek
Copy link
Author

rontrek commented Sep 2, 2019

I got it now, thanks for the info.

So is there a way to know if a tile is occupied by an Entity? I need my entity to look ahead if a tile is occupied by another entity so it can decide to move to another tile.

@Joncom
Copy link
Collaborator

Joncom commented Sep 2, 2019 via email

@rontrek
Copy link
Author

rontrek commented Sep 2, 2019

Thanks. I see some examples on how to loop specific entities, but how do you check for a tile overlap vs entity? Is there a command or can you give a snippet example?

@Joncom
Copy link
Collaborator

Joncom commented Sep 2, 2019 via email

@rontrek
Copy link
Author

rontrek commented Sep 3, 2019

Thanks. I'm getting somewhere now, but still having issues with it.

btw, any thoughts on this diagonal issue thing? I'm tying my entity routines with hurik's a star plugin that you have commented a few days ago.

@Joncom
Copy link
Collaborator

Joncom commented Sep 3, 2019 via email

@rontrek
Copy link
Author

rontrek commented Sep 5, 2019

I see, how about your grid based movement plugin? Any tips on how to move NPCs?

I'm actually trying to make it work with the a star plugin, perhaps you can also give some pointers.

Thanks.

@Joncom Joncom closed this as not planned Won't fix, can't repro, duplicate, stale Nov 7, 2024
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

No branches or pull requests

2 participants