Skip to content

JassWeb

  • Home
  • Solved
    • javascript
    • c++
    • java
    • git
    • php
    • arrays
    • html
    • python
    • jquery
    • mysql
    • .net
    • json
    • ajax

collision-detection

[Solved] Why can’t I pass a int to a float in the same statement? [closed]

January 6, 2023 by Kirat

You can’t assign a float value to an int variable because some of the information will be lost. For the same reason, you can’t pass a float value to a method whose argument is declared as an int. (your question is rather unclear due to the incorrect use of terminology, but I think you are … Read more

Categories Solved Tags 2d-games, collision-detection, java

[Solved] JavaScript – determine if two circles will intersect along their path

December 7, 2022 by Kirat

Position of the first circle is described as x1 = x1_0 + vx1 * t y1 = y1_0 + vy1 * t where x10 is initial x-coordinate, vx1 is x-component of velocity vector, t is time. Make similar expression for the second circle center, build expression for squared distance and find time when squared distance … Read more

Categories Solved Tags collision-detection, javascript, linear-algebra, math

[Solved] Ball sometimes bounces sometimes doesn’t

October 10, 2022 by Kirat

The code that checks bouncing is off by a bit. First of all, ball.getCenterX()+ball.getRadius() is effectively the right side of the ball, and that’s the only part that you’re comparing to the paddle’s location. That means that the effective paddle location is off by an amount equal to the radius of the ball. You can … Read more

Categories Solved Tags animation, bounce, collision-detection, java

Recent Posts

  • [Solved] Check to see if two lists have the same value at the same index, if so return the index. If not return -1
  • [Solved] Generics C# organization of methods that depends on type [closed]
  • [Solved] Database – SQL Table to Perl Script
  • [Solved] Comment xml elements programmatically
  • [Solved] Logging printout of an executed python file within another file and printing out the result in terminal simultaneously

Archives

  • November 2023
  • June 2023
  • April 2023
  • March 2023
  • February 2023
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • August 2022
  • November 2021
  • August 2020
  • March 2020
  • June 2019
  • February 2019
  • September 2018
  • August 2018
  • July 2018
  • March 2018
  • February 2018
  • December 2017
  • October 2017
  • August 2017
  • January 2017
  • September 2016
  • May 2016
  • January 2016
  • October 2015
  • July 2015
  • February 2015
  • December 2014
  • November 2014
  • September 2014
  • August 2014
  • July 2014
  • June 2014
  • May 2014
  • March 2014
  • January 2014
  • January 2013
  • October 2012
  • March 2012
  • October 2011
  • March 2011
  • January 2010
  • September 2009
  • May 2009
  • February 2009
  • January 2009
  • October 2007
  • January 2007
  • November 2004
  • May 2002
  • September 2001
  • May 2001

Categories

  • Solved
  • WordPress

Quick Links

© 2025 JassWeb • Built with GeneratePress