Resolving Merge Conflicts Solution – How to Use Git and GitHub


In this case I want to keep Sarah’s change of moving this code to the function. So I’ll need to make my change to the function. So, I’ll scroll back up to the function and change this 3 to a 2. Now I’ll delete my version since I already have the change from it and the original version since I don’t need that version any more and I’ll delete git’s special lines. I’ll also clean up a little bit by removing these blank lines. Now I’m left with the call to the breakIntoFragments function, which breaks each asteroid into two fragments, rather than three.

2 thoughts on “Resolving Merge Conflicts Solution – How to Use Git and GitHub

  1. the right answer is
    Asteroid = function() {
    this.breakIntoFragments = function () {
    for (var i = 0; i < 2; i++) {
    var roid = $.extend(true, {}, this);
    roid.vel.x = Math.random() * 6 – 3;
    roid.vel.y = Math.random() * 6 – 3;
    if (Math.random() > 0.5) {
    roid.points.reverse();
    }
    roid.vel.rot = Math.random() * 2 – 1;
    roid.move(roid.scale * 3); // give them a little push
    Game.sprites.push(roid);
    }
    };

    this.collision = function (other) {
    SFX.explosion();
    if (other.name == "bullet") Game.score += 120 / this.scale;
    this.scale /= 3;
    if (this.scale > 0.5) {

    this.breakIntoFragments();

    }
    };
    };

Leave a Reply

Your email address will not be published. Required fields are marked *