I have been trying out this application for over a week ( like it a lot) and now I am trying to have ago at creating my own game (just a very simple tank move and shoot game). My question is this: I have given the players tank a private variable (health) a value of 100. When this tank gets shot by a computer controlled tank this variable decreases by ten etc until the tank is distroyed. My problem is I cant seem to get a text object to display the current value of the tank private variable. Im sure there is a way you could do this with python code, but is there a blinding obvious way you can do it with the on screen statements. I first thought i could use the "Set text" statement, but as far as i can see this will only allow you to enter text and not point to a private variable. Any ideas?
to answer your question, you can actually use an expression instead of just entering text; to get the value of a private variable from an object, you could use e.g. Sprite('variableName')
but i would really like to recommend that you try some of the tutorials (link), which cover this and similar basic topics; they are immensely helpful in getting to know construct & the way it thinks, and usually don't steal too much of your time in the process.
Yes the Ghost shooter tut covers this. Btw python, is generally reserved for things that can't be done in events, and that list is very very short.
Develop games in your browser. Powerful, performant & highly capable.
> healthText: Set text to playerTank.Value('health')
where "healthText" is whatever the name of your text object is and "playerTank" is whatever the name of your player object is.
But yes, a tutorial is a good idea.
Hi everybody, many thanks (especially for the speedy reply). Just completed the ghost shooter tutorial, it has answered quite a few other questions I was going to ask, again thanks for you help!