Welcome to the new platform of Programmers Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use it's exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
Set min/max value for a field
Is it possible to set a minimum and maximum possible value for an integer field? Can I do it within the contructor? I have googled it but everything I find seems for more advanced and technical than what I am looking for.
I am trying to set a minimum of "0" and a maximum of "10" for the field "happiness".
x = 0;
y = 1;
z = 5;
texture = "models/tux/tux.png";
model = "models/tux/tux.obj";
//Additional fields added for "Peppy"
hunger = 5;
happiness = 5;
thirst = 0;