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

2019/1/11

Bullets travel in a spiral

tehbestcoder tehbestcoder

2019/1/11

#
So I want the bullet to turn 18 more than last time when a new one it is created so it becomes a spiral but it doesn't work. I think it won't work like how i coded but i don't know how to make it work. Need help!! It should look something like this- This is the code I have so far-
private int angle = 0;  
        public void act() 
        {           
            move(5);
            angle+= 18;
        } 
        public enemyBullet()
        {
            turn(angle);
        }
danpost danpost

2019/1/11

#
tehbestcoder wrote...
So I want the bullet to turn 18 more than last time when a new one it is created so it becomes a spiral but it doesn't work. I think it won't work like how i coded but i don't know how to make it work. << Image Omitted >> << Code Omitted >>
This was already discussed here.
You need to login to post a reply.