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

2015/6/1

How do you make an another object come out of a player?

_E_X_B_R_Arjay _E_X_B_R_Arjay

2015/6/1

#
Ok this is like a bullet image coming out of the Player's gun or Player and I'm having trouble making it happen. I don't have the code for it because i have no idea at all. I need help!
_E_X_B_R_Arjay _E_X_B_R_Arjay

2015/6/1

#
also need help with two images colliding together... but its not working.. i got code.
/**
     * Check whether we can see Survivor. If we can, eat it.
     */
    public void tryToEatSurvivor()
    {
        if (canSee(Survivor.class) )
        {
            eat(Survivor.class);
            Greenfoot.playSound("game-over.wav");
            Greenfoot.stop();
        }
    }
danpost danpost

2015/6/1

#
For the two images colliding together: (1) what class does this class (that the 'tryToEatSurvivor' method is in) extend? (2) show the codes for the 'canSee' and 'eat' methods For the bullet image, you first need a subclass of Actor that will create the bullet objects.
_E_X_B_R_Arjay _E_X_B_R_Arjay

2015/6/1

#
danpost i figured out the two image collide thx to tutorials. But i wanna know how i can make the bullet come out straight from the player itself. And yes i have created a sub class for the bullet but i have not know exactly what to put in and im confused. @Danpost
danpost danpost

2015/6/1

#
Give the bullet an image, put what actions you want it to do in the act method. Get a working bullet class before dealing with what the class creates (the bullets) coming from the player. For the actions, ask yourself what the bullet is supposed to do (after it is created) at each instance in time throughout its existence.
_E_X_B_R_Arjay _E_X_B_R_Arjay

2015/6/2

#
Thx so much danpost! you really help a lot. i finished my game now thx to you.
You need to login to post a reply.