In the rocket class, you will find this private void. Adding the small pieces of code at the bottom which are accelerate(0.95); and move(); effectively introduce a degree of deceleration. This means the rocket won't keep drifting when you have stopped pressing "up"!
private void ignite(boolean boosterOn)
{
int currentRotation = this.getRotation();
if (boosterOn == true)
{
this.setImage("rocketWithThrust.png");
this.addForce(new Vector(currentRotation, .3));
}
else
{
this.setImage("rocket.png");
accelerate(0.95);
}
move();
}
2013/5/3
Dungeon (demo)
2013/3/27
簡易接龍 Simple Solitaire
2013/3/27
CrazyZobbies
2013/3/27
CrazyZobbies
2013/3/21
Dungeon (demo)
2013/3/13
Dungeon (demo)
2013/3/6
asteroids-1
2013/1/23
Speed3D
2012/11/15
tut-access-p1