Hello
On my scene I have local score = 0;
On a class I would like to change the score to say 1.
If I run say Score:updateScore(score) it passes the value of score rather than the memory address.
Basically I'm trying to update score without using a global.
Thanks!!
Tom
Comments
What you are trying to achieve doesn't sounds complex and should work with a quick fixes.
Is that what you are trying to achieve?
I have a class that spawns characters on screen. Here's some of it...
Thanks for the example but I need to update the scene from the spawn class, not the other way around - if that makes sense.
Thanks Mells
Likes: Tom2012
What you are trying to do can be solved but I think you should study more about the value of "self" (like, what is "self" at self.scoreText:setText(tostring(score))) and solve it yourself, so you will be able to solve the same kind of scope issues that you'll have to face in the future.
Thank you. That's exactly what I was looking for.
Can't believe it was so simple. :0)