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

2014/2/8

How do you pass one actor to another actor ??

Gerrit Gerrit

2014/2/8

#
hello , at the moment it's like one actor grabs one actor and gives it to another actor after the second actor gets it it should move and add points
Gerrit Gerrit

2014/2/8

#
public void grabaCrate()                   
    {

        if (crate == null && Greenfoot.mouseClicked(crate)) 
        {
            move(getImage().getWidth()/2);  
            container = (Crates) getOneObjectAtOffset(0, 0, Crates.class);  
            move(-getImage().getWidth()/2); 
            if (crate != null)
            {
                crate.schip = null;
            }  

            if (crate != null && Greenfoot.isKeyDown("space"))
            {
                crate = null;
            }
        }
    }
    
    private void adjustContainerPosition()  
    {  
        if (crate == null)
        {
            return;
        }
        crate.setLocation(getX(), getY());  
        crate.setRotation(getRotation());  
        crate.move(getImage().getWidth()/2);  
        crate.setRotation(0);  
    } 
Gerrit Gerrit

2014/2/8

#
this is what i got in my machine class
Gerrit Gerrit

2014/2/8

#
at the moment the actor only grabs it \ i want that if it gets to another actor it has to let it go and pass it to the truck
Gerrit Gerrit

2014/2/8

#
i have no idea how to get this done can anyone help me
You need to login to post a reply.