Change your thought process from "Moving 7 units" to "Applying a velocity of 7 units" and you can come up with something like:
velocity.Y = -7;
position.Y += velocity.Y;
Now if we take this and we want to apply acceleration every frame we can simply update the velocity every frame.
accelerationRate = 2; //arbitrarily picked - no significance
velocity.Y = velocity.Y + accelerationRate;
position.Y += velocity.Y;
A more appropriate and less naive approach would take elapsed time into account. This results in consistent distance traversed over time. To implement this we are required to somehow track the amount of time elapsed since the last update. Some libraries will include this functionality but otherwise using time keeping measures built into your language of choice are likely sufficient. This value will be stored in deltaTime in the sample below and will expressed in seconds.
accelerationRate = 2;
velocity.Y = velocity.Y + (accelerationRate * deltaTime); //We should only increase our accelration based on the elapsed time
position.Y += velocity.Y * deltaTime; //Only apply velocity as much as we should given the amount of elapsed time
You could take this and easily apply it to moving in either direction on the Y axis, up or down. Your velocity should just be positive or negative to behave appropriately as needed.
var
is just a short-hand notation used in some languages like C# to declare a variable without explicitly stating the type. – ashes999 Aug 24 '14 at 15:09