This is a the "correct" solution, but I would go a step further and "soft-code" the acceleration value on top of the movement speed and max movement speed. The reason is the same as every reason behind not hard-coding values, if you need to change it, it's easily changeable, if you don't, it doesn't affect anything regardless. Something like this:
Create Event:
Code:
movementSpeed = 0;
maxMovementSpeed = 5;
accel = 0.1;
Step Event:
Code:
if(isCharacterMoving) {
if(movementSpeed < maxMovementSpeed) {
movementSpeed = movementSpeed + accel;
}
}
I think it's important to get into the habit of almost always setting up variables instead of using magic numbers, because it gives you a lot more control without sacrificing anything. You might never change your accel through the course of your game development, but if you do, having a variable instead of a magic number will make it so much easier. The number of times I've hard coded something, being entirely sure at the time it would never change, and then later realised "Oh, in order to do X, I need to change the value Y" and then had to search through all my code for every use of Y and turn it into a variable instead of a number is astonishing. Get into the habit early and save yourself future headaches =)