Are static variables secure?

If I make use of int variables, with the values reflecting purchasable upgrades, and which are static, am I making the variables more prone to tampering?

Should I use a different way to access these variables from other classes?

Anything is prone to tampering. But since you need to somehow persist a purchase, presumably (i.e. write the value to disk somehow), that is usually the thing that gets tampered with. Encrypt such files if you are worried about it.

Static variables aren’t particularly more or less vulnerable than a non-static variable. If you’re think your variables are vulnerable, encrypt them! One way is saving your variables in an XML file and encrypting the XML text.

If you want to access your variables from other classes differently, you could try instantiating the child classes. This isn’t really more or less secure though.