Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialBozena Jablonski
4,944 PointsMy platforms fly off when the player touches them!
By adding the extra coins and platforms I must've messed something up because now the platforms fly off when I touch them. It clearly says 'body.immovable', and I don't think I've edited that part at all.
Any help would be much appreciated, thanks!
2 Answers
Steven Parker
231,275 PointsIt looks like you managed to discover something that could be used for some very interesting future games or modifications!
But you had the right idea about calling "platforms.setAll('body.immovable', true);
", you just need to move that down to the end of the "addPlatforms" function so it is called after the platforms are created.
Ian Johnson
2,749 PointsOh man, this 'error' is so cool!
I know this is an old post, but you can sort of make a new mini game by placing platforms.setAll('body.immovable', true); at different points between the platform code and try get the coins before the platforms slide off/drop/raise up - depending on how you hit them.
Cheers!
Bozena Jablonski
4,944 PointsBozena Jablonski
4,944 PointsHi Steven, Thanks! I did think it looked cool, can you think of a way in particular it could be used or harnessed in combination with other effects? Are there similar ones that can be added in a similar way to functions like this?
Steven Parker
231,275 PointsSteven Parker
231,275 PointsA few ideas:
Have you ever seen the original "Commander Keen" games? They do a lot of clever things and most of them can probably be implemented with Phaser.