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

Laurence's Comments

Back to Laurence's profile

public class Lamp extends Actor { int dir = 0; /** * Act - do whatever the Lamp wants to do. This method is called whenever * the 'Act' or 'Run' button gets pressed in the environment. */ public void act() { setRotation(90); } } I've made a simple 'lamp' image and indeed it turns 90 degrees but the beam stares straight forward weirdly enough.
Would it be possible for this to follow an actor and point in the direction of the cursor?