Wednesday, November 30, 2022
HomeGame DevelopmentFundamental tutorial for tile map - Cocos Creator

Fundamental tutorial for tile map – Cocos Creator


I’m utilizing cocos creator v2.4.9. All of the documentation and tutorial for tile map is incomplete. It explains how one can add .tmx file to creator.
It could be nice if somebody might level me in direction of a tutorial or challenge which has

  1. collision detection between cocos node and objects in tile map.
  2. Dynamic creation of a particular tile on tilemap click on and so forth.

I’m attempting to make recreation just like this : [Make Your Own TileMap with Vanilla Javascript | by Tyler Conti | Geek Culture | Medium](https://Cat Crusador)


You probably have no particular motive to remain to creator V2, I recommend you to maneuver to V3, not since you’ll discover extra tutorial (you’ll not) however as a result of any longer V3 is the usual.

That stated I’ve struggled for weeks to seek out some documentation on tile map (how one can combine to Tiled, to be extra exact) on how one can do collisions and issues like that. There are one or two examples within the check repository however they’re from v2 and the code is meh. To be sincere you simply can’t use Tiled and have collisions out of the field however I’m engaged on a plugin to repair this. Within the wait yow will discover an excellent instance on how one can do collisions utilizing Tiled right here on this repository GitHub – theRenard/cocos-creator-tiled-collider-creator: Cocos Creator + Tiled and collisions, it is vitally minimal you need to end up at residence even in case you have been utilizing V2.

Good luck on your recreation :slight_smile:

I feel the workforce will improve the documentation of tiledmap. however solely in v3.x, v2 is legacy model ,received’t be modified anymore.
in case your challenge is simply within the startup part, I strongly suggest you to make use of v3 as a substitute.

Okay. Thanks for the reply

Thanks for the answer. Are you able to please point out which model of v3 is best to make use of as newest model might not be steady generally.

Will be sure that to do that.

Thanks.

I’m, utilizing V3.6.2 proper now and is sees just about steady for my wants

I used the identical model.
Proper now I’m getting this subject.

That is the challenge in tiled.

I’ve up to date just like your code

however the collision is about to complete map
Hull Concavity = 1, neighborhoodRadius = 50 and clusterNeighborsPoints = 10

Hull Concavity = 1, neighborhoodRadius = 40 and clusterNeighborsPoints = 10

I’m unsure how one can set the Hull Concavity, neighborhoodRadius and clusterNeighborsPoints.

Are you able to please information me a bit of right here?

Thanks

Yeah positive, it’s a must to attempt with totally different values, in my case 1 – 30 – 10 works properly. If you’d like you’ll be able to open a difficulty on my repository and share your Tiled map it is going to be attention-grabbing to check with different maps than mine.

You can even attempt to separate the platforms from the border, when you’ve one thing like a closing sample (the border as rectangle), the algorithm tries to fill it and you’ve got the error in 1st picture

Are you able to clarify what these 3 factors are and the way it results?

Will do that, Thanks!

EDIT:
Separating borders labored! Thanks loads for the assistance.

you’re welcome!

concavity is approximation within the cloud of factors, you normally need it at 1 (you’ll be able to learn extra on it right here Hull.js by Andrii Heonia).

neighborhoodRadius set the radius of an imaginary circle across the level the place it appears for different factors to contemplate it as its neighbours

clusterNeighborsPoints works with the latter parameter and set what number of factors you wish to kind a cluster (extra right here GitHub – uhho/density-clustering: Density Based mostly Clustering in JavaScript)

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments