You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yes there is. I have written it in the feature/dualTarget branch under mobile. It is currently written in c++ in the SampleMath.cpp file. My current idea would be to do the calculation in the c++ and then set a flag in the JSON object if the phone was to close and pass it up to the java. How do you feel about that approach?
Well, the calculation should definitely happen in c++, but so far we've kept all the JSON work in Java. Also, since everybody in class feels the distance limitation should be implemented on the phone,it doesn't necessarily have to go in the JSON. We could put it in there for kicks though, in case anyone wants it.
It makes the most sense to me to call a JNI from java the same way we get the phone location. That way we can keep the gameplay/UX logic at a higher level and stick to rendering and calculations in c++. Does that sound right? So all you would have to do is return the unit distance from the phone to the player (or to any object if you have that kind of time on your hands).
If it's simpler, it could also take the form of getDistanceToPosition( x, y, z) so that we have to pluck the position out of the JSON in onGameStateChange.
For example: getDistanceToObject("player")
This isn't super urgent, but we'll need it at some point.
The text was updated successfully, but these errors were encountered: