CombinationName / mysteryProject

duel/dool
0 stars 0 forks source link

SPRINT: May 15 - May 29 #2

Open scrapmaester opened 7 years ago

scrapmaester commented 7 years ago

Leave notes on what you've done here. Try to structure it as:

May 17th

WHAT I DID

ISSUES

WHAT I PLAN TO DO NEXT

Happy hunting!

scrapmaester commented 7 years ago

@dbrodie122 I think I found out why your character was falling through the platforms:

https://phaser.io/tutorials/making-your-first-phaser-game/part5

function update() { // Collide the player and the stars with the platforms var hitPlatform = game.physics.arcade.collide(player, platforms); }

The update function is called by the core game loop every frame. The Physics.collide function is the one that performs the magic. It takes two objects and tests for collision and performs separation against them. In this case we're giving it the player sprite and the platforms Group. It's clever enough to run collision against all Group members, so this one call will collide against the ground and both ledges. The result is a firm platform.