COMP4021 Assignment 2 Flipping the Player/Monster

Overview

Steps

  1. Find the SVG group object of the player:
    playerObject = svgdoc.getElementById("Shuttle");
  2. Transform the player:
    playerObject.setAttribute("transform",
                              "translate(" + player.size.w + ", 0) scale(-1, 1)");