If possible, create your objects before starting the actual game. Or at least try to reuse old objects. Object creation is expensive on Android. Try to pool objects if possible. jPCT-AE offers some help for this. For example, there's a static create()-method in SimpleVector as an alternative to the constructor. Using this method allows jPCT to optimize SimpleVector usage to a small degree.
+
If possible, create your objects before starting the actual game. Or at least try to reuse old objects. Object creation is expensive on Android. Try to pool objects if possible. jPCT-AE offers some help for this. Many methods that return a Matrix or a SimpleVector exist in two flavours now: One that simply returns a new instance and one that takes an instance as an argument and fills and returns that one. You can save the creation of unneeded, short lived objects with that.
−
In addition, many methods that return a Matrix or a SimpleVector exist in two flavours now: One that simply returns a new instance and one that takes an instance as an argument and fills and returns that one. You can save the creation of unneeded, short lived objects with that.