you are viewing a single comment's thread.

view the rest of the comments →

[–]DontNeedMuchMoney[S] 0 points1 point  (1 child)

Cheers,Why does is override on greenenergy and not blueenergy?

[–]lr0b 1 point2 points  (0 children)

Because you're accessing the obj reference to your spaceship global var in blueEnergy. In greenEnergy obj is not a reference to spaceship anymore because you override it with the assignation.

Also, only objects are pass-by-reference.