4 ms·
Kyle, this is brilliantly done. Honestly, I didn't expect the level of polish and fluidity that I experienced when I tapped that link on my iPad. The slight "le
by spdustin 11y ago
Kyle, this is brilliantly done. Honestly, I didn't expect the level of polish and fluidity that I experienced when I tapped that link on my iPad. The slight "lean" when cards are dragged around, butter-smooth animations... Well done.
I'd love to see some of your notes behind wiring up the pseudo-physics of the cards. Or was that provided by a library?
EDIT: I need to read more carefully - looks like it's part of http://www.phaser.io http://www.phaser.io, and now I've just wrecked my productivity for the day! Great job on the solitaire game.
- kyle_u 11y agoThanks! 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.
- nchelluri 11y agojust gotta say, you bastard, what a lovely comment. if i were developer of any project and got a note like this it would make my day (so im a little envious of kyle_u), if he used a library that does whatever it was that impressed you or not. :P
- spdustin 11y agoThat's a nice way to start my day, thanks. :) I think what strikes me most about a program, and what tends to speak to many people, are the little touches that are a delight to discover. Especially when you're not expecting them. So many comments have said "check this thing I made" and the thing proves to be well done, but somewhat utilitarian. Now, I like utilitarian as much as the next gold tunic wearing Terran, but these little touches created by the personal choice of a developer make a random human-computer interaction seem, even if by proxy, a little more human-human.
- nchelluri 11y agoYou're welcome. I appreciate what you're saying. I am not sure that I feel quite as strongly about the importance of the personal, loving little touches as you do, but the idea resonates with me. I actually might agree with you completely, given time to fully digest the idea, but it brings up a similar but maybe tangential point: Over the last few years, probably most clearly highlighted after I was introduced to and started working with Bootstrap to create half-decent looking webpages (it is an HTML/JS/CSS UI toolkit/library/framework that makes it possible for web devs without a whole lot of design chops to simply create nice looking pages - https://getbootstrap.com/ https://getbootstrap.com/), I have been coming round to the idea that making something aesthetically pleasing and pleasant to visually/tactiley experience for the first time is not just beneficial or a small-but-helpful part of designing a well-liked and good webapp, but a key part of the experience. I really feel like if I have a good looking site versus an ugly one where the clickity-click part of the UX is identical, the good looking one will just really be more inherently comfortable, appealing, and embraceable for people. And not just other people - but me, the dev, who has seen behind the curtain and knows where all the ugly parts of the code or UX are. It's quite possible that if this is really true that it's obvious to loads of people, but it has been a slow realization for me, who used to get haircuts ridiculously infrequently/not shave very often, etc., in some cases thinking "well I eat well and exercise - what's inside is good stuff! Anybody who doesn't appreciate that is <adjective-indicating-poor-appraisal-skils>." I guess what I'm saying is, spending time on quality presentation is a key part of appreciating your user IMO, and in terms of spurring project motivation I think it can be really useful and inspiring to get a static webpage with dummy UI that just looks and feels good. I really do feel a little silly saying this because in hindsight it seems like it is one of those things that might be obvious to everyone else, but it was not to me, and maybe there are others out there like me :)
- acqq 11y agoThanks, I also didn't know about phaser.io, and just searching for phaser brought me to the wrong one: https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Phaser.html https://docs.oracle.com/javase/7/docs/api/java/util/concurre...