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

2012/8/13

score not subtracting

davemib123 davemib123

2012/8/13

#
Hi, got the bar from scenario 4114. I've tried to subtract the health when a bullet makes impact with the hero but it doesn't seem to work. Could someone take a look: http://www.greenfoot.org/scenarios/5799
davemib123 davemib123

2012/8/13

#
ah fixed it nvm
davemib123 davemib123

2012/8/13

#
how do I make the health bar follow the hero? I've read about turntowards - not sure if that is what I need?
SPower SPower

2012/8/13

#
With following, do you mean set it to a location near to the boss? If yes, do this:
the boss object:
Boss boss = ....;
// the thing you want to stick to the boss:
setLocation(boss.getX(), boss.getY() -boss.getImage().getWidth() /2 -20);
and btw, turnTowards will turn the Actor to face a location, it doesn't move to it.
You need to login to post a reply.