Development Notes: ‘Love’s Arrow’

Mar 2

Love's Arrow Sketch

After the relative success of my winter-themed game Snow Day I decided to make a game for Valentine’s Day.

I came up with the basic idea pretty quickly: A cupid floating on a cloud shoots at hearts in the sky, causing them to drop down onto people below. Although this game came together pretty quickly and easily, there were two main things that I stumbled on:

The initial idea was that the people should fall in love with each other when they get hit by a heart. There are a few different ways this could happen:

  1. You have to drop a heart so that it falls on two people at the same time.
  2. Two people must get hit with hearts, but not necessarily the same heart.
  3. Only one person gets hit, but they fall in love with the next person they encounter (if any).

There were a couple problems with all of these. Would men only fall in love with women? Would there be an option to set if you want men + women, men + men, women + women etc? If three people get hit, do they all 3 fall in love or do you need multiples of two?

I still think the game could use this extra dimension thematically, but gameplay-wise I felt it made the game too difficult. You not only have to learn to aim the arrow properly, but you have to time your shots to make the heart fall on a person. Having a third goal added on to this seemed to me to be too far removed from the players focus.

Arrow Physics
I spent a lot of time trying to create realistic-feeling arcs for the arrows. I was attempting to do this using some crazy proportional movement scheme I’d used for the fish in The Lake and the ice cubes in Snow Day. I struggled with it quite a bit, never getting satisfactory results, until I finally realized that if I wanted realistic looking physics, I should just add real physics.

I found a gravity tutorial that helped me add realistic gravity to the arrows. To get them to shoot, I give each new arrow an x and y velocity based on the distance and angle of the bowstring relative to the center of the bow. An added bonus of having the game-wide gravity was that it was very simple to make the hearts fall and bounce when they get shot.

To make the arrows rotate in the air I calculate the angle between their current position and their previous position and set the arrow’s rotation to that. This way, the arrow’s angle is directly tied to its speed and direction:
angle = Math.atan2(oldY-newY, oldX-newX)/(Math.PI/180);