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

2020/5/17

how would i fix a void type not allowed here issue

1
2
3
4
5
danpost danpost

2020/5/20

#
Weeb3.exe wrote...
how would i get it to set it to try and go to the persons last known location?
Is not the enemy which is shooting the bullet facing that way?
Weeb3.exe Weeb3.exe

2020/5/20

#
danpost wrote...
Weeb3.exe wrote...
how would i get it to set it to try and go to the persons last known location?
Is not the enemy which is shooting the bullet facing that way?
i would need it in the bulllet rotation to face towards the last known location of the player but how would i get that data?
danpost danpost

2020/5/20

#
Weeb3.exe wrote...
i would need it in the bulllet rotation to face towards the last known location of the player but how would i get that data?
Take this player and get its rotation.
Weeb3.exe Weeb3.exe

2020/5/20

#
danpost wrote...
Weeb3.exe wrote...
i would need it in the bulllet rotation to face towards the last known location of the player but how would i get that data?
Take this player and get its rotation.
How?? i don't know how to
danpost danpost

2020/5/20

#
Weeb3.exe wrote...
How?? i don't know how to
Come on, now. I just practically gave it to you.
Weeb3.exe Weeb3.exe

2020/5/20

#
ok give me a couple of minutes
Weeb3.exe Weeb3.exe

2020/5/20

#
ok tried something like this
public class EnemyCharacters extends Actor
{
    
    Betty player = (Betty)getWorld().getObjects(Betty.class).get(0);
    int BettyX = player.getX();
    int BettyY = player.getY();
    /**
     * Act - do whatever the EnemyCharacters wants to do. This method is called whenever
     * the 'Act' or 'Run' button gets pressed in the environment.
     */
    public void act() 
    {
        // Add your action code here.
    }
    
    public void shoot()
    {
        if ( fire == false)
        {
            do
            {
                fireTimer--;
            } while (fireTimer > 0);
            fireTime();
            fire = true;
            fireTimer = 50;
            
        }
    }

    public void fireTime()
    {

        EnemyBullet bullet = new EnemyBullet();
        getWorld().addObject(bullet, getX(), getY());
        bullet.move(06);
        bullet.setRotation(BettyX,BettyY);
    }
danpost danpost

2020/5/20

#
What are you trying to do? -- make a mess out of everything? Maybe I was thrown off and, in turn, threw you off.
danpost wrote...
Take this player and get its rotation.
I should have given this:
Take this enemy and get its rotation.
It is the enemy who is shooting the bullet (and facing the player).
Weeb3.exe Weeb3.exe

2020/5/20

#
danpost wrote...
What are you trying to do? -- make a mess out of everything? Maybe I was thrown off and, in turn, threw you off.
danpost wrote...
Take this player and get its rotation.
I should have given this:
Take this enemy and get its rotation.
It is the enemy who is shooting the bullet (and facing the player).
OHhhhh would this work
bullet.setRotation(this);
Weeb3.exe Weeb3.exe

2020/5/20

#
Weeb3.exe wrote...
danpost wrote...
What are you trying to do? -- make a mess out of everything? Maybe I was thrown off and, in turn, threw you off.
danpost wrote...
Take this player and get its rotation.
I should have given this:
Take this enemy and get its rotation.
It is the enemy who is shooting the bullet (and facing the player).
OHhhhh would this work
bullet.setRotation(this);
wait that has a problem it says it cant convert to int :/
Weeb3.exe Weeb3.exe

2020/5/21

#
dan would you know how to fix that?
danpost danpost

2020/5/21

#
Weeb3.exe wrote...
dan would you know how to fix that?
danpost wrote...
Take this enemy and get its rotation.
Weeb3.exe Weeb3.exe

2020/5/21

#
 bullet.setRotation(this); 
i tried to do that
danpost danpost

2020/5/21

#
Weeb3.exe wrote...
 bullet.setRotation(this); 
i tried to do that
I do not see you getting a rotation.
Weeb3.exe Weeb3.exe

2020/5/21

#
how do i?
There are more replies on the next page.
1
2
3
4
5