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

2015/2/4

Cant call a method from other class

ds06 ds06

2015/2/4

#
Hi, does somebody know why this doesnt work? What im trying to do is to increase the variable points by 1 everytime a "Placeable" is placed on an object from the class "Free" Thx ind advance
davmac davmac

2015/2/4

#
The Actor class has no method called 'addPoint'. That method is in the Settings class. So, you need to declare the 'sett' variable (line 9 of your World) and 'f' (line 17 of your Placeable) to be a Settings reference instead of an Actor reference.
ds06 ds06

2015/2/4

#
Thanks davmac, ive got it to work :) For anyone who is interested:
You need to login to post a reply.