This site requires JavaScript, please enable it in your browser!
Greenfoot back
limingbogf
limingbogf wrote ...

2016/4/14

a varible in Actor class,How to use it in world class?

limingbogf limingbogf

2016/4/14

#
i create a varible in Actor class,but i want to use it in world class. how to do it?
danpost danpost

2016/4/14

#
What is the field for? What is the name of the Actor subclass the field is in? How many instances of that class will be active at any one time (will there always be just one instance of the class in the world at any time)? What code are you trying to use in your World subclass to access it?
limingbogf limingbogf

2016/4/14

#
just one Actor subclass(player.class).i define int score=0,do something increase it. then i want to showtext(the score) in the world. beause of some reasons i don't want to use getWorld().showtext().can i find other ways?
danpost danpost

2016/4/15

#
limingbogf wrote...
just one Actor subclass(player.class).i define int score=0,do something increase it. then i want to showtext(the score) in the world. beause of some reasons i don't want to use getWorld().showtext().can i find other ways?
You might want to check out my Value Display Tutorial scenario which explains how to do that.
limingbogf limingbogf

2016/4/15

#
think you very much!l have solved it.
You need to login to post a reply.