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

2019/2/1

Speed Of Rocket

FlyersFan53 FlyersFan53

2019/2/1

#
When asked about the initial speed of the rocket, I was wondering why it is not just a set number of something like 1 or two, but rather it comes out in parenthesis like this code:
/**
     * Initialise this rocket.
     */
    public Rocket()
    {
        gunReloadTime = 20;
        reloadDelayCount = 0;
        acceleration = new Vector(0, 0.3);    // used to accelerate when thrust is on
        increaseSpeed(new Vector(13, 0.3));   // initially slowly drifting
        shotsFired = 0;
danpost danpost

2019/2/1

#
You could make it any value you want; but it would help to make it a reasonable one. An initial value of zero is always a fair option.
You need to login to post a reply.