|
Are you sure you didn't mean to post that in the coding horrors thread?
|
# ¿ Mar 14, 2014 17:50 |
|
|
# ¿ Apr 27, 2024 23:19 |
|
emanresu tnuocca posted:I probably shouldn't do the arcsin/arccos. Vectors make everything much easier. In the general case you could use the reflection formula for light to bounce vectors around. In this special case where the walls are always at 90 degree angles you can turn your intuition directly into code: just as you said, when a circle hits a wall its motion on the contacting axis is negated. When the motion is a vector that's just negating a variable.
|
# ¿ Aug 26, 2014 16:26 |
|
If they all implement some common interface, you can make an ArrayList<CommonInterface> and put any implementing class in there. e: soo late.
|
# ¿ Sep 1, 2014 21:30 |
|
Zaphod42 posted:You don't want to manually code all those positioning values and stuff.
|
# ¿ Apr 24, 2015 15:13 |