public void purchase(Integer key, Player player) {
        switch (key) {
            case KeyEvent.VK_1:
                if (player.decreaseCredits(shieldsPrice)) {
                    shieldsPrice += player.getMaxHP()* 3;
                    player.increaseMaxHP(5);
                    player.setHitpoints(player.getMaxHP());
                    break;
                }
            case KeyEvent.VK_2:
                if (player.decreaseCredits(weaponPrice)) {
                    weaponPrice += player.getDamage() * 10;
                    player.increaseDamage(1);
                    break;
                }
            case KeyEvent.VK_3:
                if (player.decreaseCredits(maneuverabilityPrice)) {
                    maneuverabilityPrice += 50 - player.getRotationTime();
                    player.decreaseRotationTime(5);
                    break;
                }
            case KeyEvent.VK_4:
                if (player.decreaseCredits(boostersPrice)) {
                    boostersPrice += (player.getSpeed() * 100) * 2;
                    player.increaseMaxSpeed(0.015f);
                    player.setSpeed(player.getMaxSpeed());
                    break;
                }
        }
    }