Scrap Pirates – Big Game Project – Blog Post #2

During the Alpha game testing a lot of helpful feedback was received. Right now, the biggest problem is with the magnetism not being controllable enough. I am not yet sure of how to solve this problem, but hopefully a solution will be found next week.

One change t that has been made to make the magnetism more controllable is that the player can now adjust the size of the magnetic field. This depends on how much the left or right trigger is pressed, as these buttons return a value between 0.0 and 1.0.  The size of the field does not affect the power of the repel-/pullforce at this moment, but it should not be difficult to implement if the team decides on having it that way.

circlebigger circlesmaller

Here, player one is using a red magnetic field to pull/lift an inactive blue box. By being able to decide on what size the field should be, it should be easier to interact with multiple boxes around you, so that the player can choose to only interact with certain boxes.

I will now give a brief explanation on how the magnetism works. When two magnetic objects (for example the player’s magnetic field and the inactive box) collide/meet, their polarity and object type are checked and the correct action is then done (is it repel(same polarity) or pull(different polarities) and what object should repel/pull the other object). The distance and angle between the two objects are then calculated, and if there is a repel interaciton, one of the objects are sent in the opposite direction with the distance multiplied by a set repel force. If there is a pull interaction, one of the objects are sent towards the other object.