5 ms·
Thanks! Phaser.io has a great tweening/animation system I use for some things, but the momentum animation was just a few lines of custom code. You basically jus
by kyle_u 11y ago
Thanks! Phaser.io has a great tweening/animation system I use for some things, but the momentum animation was just a few lines of custom code. You basically just set the angle to a smoothed (distance travelled in last 500ms).
- tempestn 11y agoWould it be possible/difficult to reverse the direction of the lean if the card is 'grabbed' on the bottom half?
- kyle_u 11y agoGood idea, and a simple change. Thanks!
- tempestn 11y agoNo problem! Of course the really awesome feature would be the ability to drag piles of cards and have it automatically determine whether there is enough space up top to do the swaps. (ie if you have 3 spaces open at the top-left, you can drag a 6543 onto a 7 in one step.) Similarly automatically putting cards up on the top right once they're exposed and there are no lower-value cards left. Obviously those would be rather more work though!
- acqq 11y agoSo which "phaser" have you used then and what have you used it for?
- kyle_u 11y agoI use http://phaser.io http://phaser.io for scene management (animated resizing of the game, tweening cards to predefined points on the table, etc) and the particle effects, as well as dynamically building the card images. I've been really impressed with Phaser.