Hello,
I want to let an object know it has weight, at the max weight the object will remove. How do I let the object know it has a weight.
Is is something with gravity??
// declare the instance variable:
private int weight;
// where you want to remove the object
if (weight >= limit) {
getWorld().removeObject(this);
}
// where you need to replace 'limit' (without the '') with the maximum weight.
// to add something to the weight:
weight += toAdd;
// replace 'toAdd' (without '')private int limit;