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
Weeb3.exe Weeb3.exe

2020/5/19

#
danpost wrote...
Weeb3.exe wrote...
would it be that it shoots in the direction that it detects human if so would it be bullet.turn(5)?
What is significant about a 5 degree rotation?
Ok so i worked out that the bullet doesn't turn at all
Weeb3.exe Weeb3.exe

2020/5/19

#
danpost wrote...
Weeb3.exe wrote...
towards the player
How can you acquire that value for the bullet?
by going into the bullets cod and changing a few things?
danpost danpost

2020/5/19

#
Weeb3.exe wrote...
danpost wrote...
Weeb3.exe wrote...
would it be that it shoots in the direction that it detects human if so would it be bullet.turn(5)?
What is significant about a 5 degree rotation?
Ok so i worked out that the bullet doesn't turn at all
If you do not turn the bullet, it will always go "forward" to the right. But the enemy will not always be to the right, will it?
danpost danpost

2020/5/19

#
Weeb3.exe wrote...
by going into the bullets cod and changing a few things?
No.
Weeb3.exe Weeb3.exe

2020/5/19

#
no it won't so you would have to change the bullet.move value correct?
danpost danpost

2020/5/19

#
Weeb3.exe wrote...
no it won't so you would have to change the bullet.move value correct?
No. Just set the bullet's rotation to face the player. (in the fireTime method)
Weeb3.exe Weeb3.exe

2020/5/19

#
danpost wrote...
Weeb3.exe wrote...
no it won't so you would have to change the bullet.move value correct?
No. Just set the bullet's rotation to face the player. (in the fireTime method)
how would i do that? like this
public void fireTime()
    {
        
        EnemyBullet bullet = new EnemyBullet();
        getWorld().addObject(bullet, getX(), getY());
        bullet.move(06);
        turnTowards(closest.getX(),closest.getY());
    }
danpost danpost

2020/5/19

#
Weeb3.exe wrote...
how would i do that? like this << Code Omitted >>
The move method does not set an actor's rotation.
Weeb3.exe Weeb3.exe

2020/5/19

#
So do i need to change the move method ? if so would it be removing it or changing it? And how would i do it?
danpost danpost

2020/5/20

#
danpost wrote...
Weeb3.exe wrote...
no it won't so you would have to change the bullet.move value correct?
No. Just set the bullet's rotation to face the player. (in the fireTime method)
Just take the bullet and set its rotation to face the player. (in the fireTime method)
Weeb3.exe Weeb3.exe

2020/5/20

#
danpost wrote...
danpost wrote...
Weeb3.exe wrote...
no it won't so you would have to change the bullet.move value correct?
No. Just set the bullet's rotation to face the player. (in the fireTime method)
Just take the bullet and set its rotation to face the player. (in the fireTime method)
I don't understand
danpost danpost

2020/5/20

#
Weeb3.exe wrote...
I don't understand
Try "bullet.setRotation(" ...
Weeb3.exe Weeb3.exe

2020/5/20

#
danpost wrote...
Weeb3.exe wrote...
I don't understand
Try "bullet.setRotation(" ...
would i set it to try and go to the persons last known location if so how?
danpost danpost

2020/5/20

#
Weeb3.exe wrote...
would i set it to 50?
Only if the player is always at a declination of 50 degrees down of the right horizontal. But, you already indicated that it could be at one of multiple angles. So, obviously, not a any specific literal value.
Weeb3.exe Weeb3.exe

2020/5/20

#
how would i get it to set it to try and go to the persons last known location?
There are more replies on the next page.
1
2
3
4
5