matheusmauer Posted November 24, 2014 Share Posted November 24, 2014 Hi Folks, im trying to do a kind of Mini Golf game, im using the 'tiled map editor' to make the map of my game, but is not working like i expect. http://aula.inf.poa.ifrs.edu.br/~0196142/JogoDeGolf/ I try everythin that was mentioned in tutorials: http://aula.inf.poa.ifrs.edu.br/~0196142/JogoDeGolf/game.js Someone can help-me? Sorry for the incorrect english usage! Link to comment Share on other sites More sharing options...
valueerror Posted November 24, 2014 Share Posted November 24, 2014 huh.. actually .. i don't know where to start.. first of all you mix arcade physics with p2 physics in a weird way... an arcade body can not collide with a p2 body afaik. then you enable p2 AND arcade for "player" - i believe this is not possible then you introduce collisionGroups for the player... the moment you activate collisiongroups nothing collides anymore.. you will have to give collisiongroups to everything that should collide again. that means your tile bodies too...game.physics.p2.convertTilemap(map, layer);this creates an array of bodies from your tilemap.. you need to cycle over them in a for loop and apply a collisiongroup to all the bodies if you want them to collide with your player... Link to comment Share on other sites More sharing options...
matheusmauer Posted November 24, 2014 Author Share Posted November 24, 2014 Yeah, i made this because i wanna do a differente behavior to the hole: use collision groups to fade with the ball when it collide with the hole.But my first problem now is the walls. Sorry for the messed code, but i'm trying everything that I see on internet. I Fix some staffs and put the 'convertTilemap', but didnt change anything:http://aula.inf.poa.ifrs.edu.br/~0196142/Teste2/indexe.html I cant do collision groups with arcade mode? Link to comment Share on other sites More sharing options...
valueerror Posted November 24, 2014 Share Posted November 24, 2014 no you can't... please have a look at your browsers console.. it shows at least the obvious errors.. like "this.map" should be just "map" and ther is no cache-key "map" for an image... you can not give the player an arcade body and the tilemap tiles p2 bodies.. chose either one otherwise they won't collide.. it's probably best you stick completely to arcade physics for now.. Link to comment Share on other sites More sharing options...
matheusmauer Posted November 24, 2014 Author Share Posted November 24, 2014 Oh, thenks, that help made my week, hahaha!I just dont know now: what kind of interation exists to make a behavior when the ball collide with the hole? Link to comment Share on other sites More sharing options...
valueerror Posted November 24, 2014 Share Posted November 24, 2014 i dont understand.. whats the problem with the ball vs hole collision.. use overlap instead of collide and let the ball slowly zoom out and get transparent.. it will look like its falling down.. Link to comment Share on other sites More sharing options...
valueerror Posted November 24, 2014 Share Posted November 24, 2014 i just tried your game again.. seems that you get it done right now unfortunately i just figured that you will not be happy with arcade physics in your case because arcade supports aabb shapes only.. rectangles... you definitely need a circle... and diagonal shapes (polylines) so you should probably go with p2 physics.. even if its a little bit harder at the beginning. Link to comment Share on other sites More sharing options...
matheusmauer Posted November 27, 2014 Author Share Posted November 27, 2014 Well, theres no way to do a tilemap in diagonal?or make the phaser recognize some object layer? Another doubt that i have is, are another 'launcher follows' on phaser?cause in my game there's a problem, the ball is pushed and not pulled:http://aula.inf.poa.ifrs.edu.br/~0196142/JogoDeGolf/ i dont know how to do something like this guy did:http://janpeter.net/golf/ I try to copy his code, but i dont understand nothing at all. Link to comment Share on other sites More sharing options...
valueerror Posted November 27, 2014 Share Posted November 27, 2014 There is a way. You just need to use p2 physics.. Link to comment Share on other sites More sharing options...
matheusmauer Posted November 28, 2014 Author Share Posted November 28, 2014 And what about the launcher? there's some solution to imitate the janpeter game? Link to comment Share on other sites More sharing options...
totor Posted November 28, 2014 Share Posted November 28, 2014 look at the phaser tutorials at examples.phaser.io, it's all there (launcher, physics, etc). Link to comment Share on other sites More sharing options...
Recommended Posts