Quantcast
Channel: Bouncing stacking boxes - Code Review Stack Exchange
Browsing all 2 articles
Browse latest View live

Answer by Pimgd for Bouncing stacking boxes

if (this.velocity > dampening) { this.velocity -= dampening;} else { this.velocity = 0;}this.velocity = -this.velocity;Seems like you could use Math functions for this:this.velocity =...

View Article


Bouncing stacking boxes

I'm not sure if it would be better to make the envelope into an extension of the Rectangle constructor.The physics seem a bit dodgy, it works well most of the time, but sometimes the boxes overlap and...

View Article
Browsing all 2 articles
Browse latest View live




<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>