There are many ways to do this. One way: You will need to create a direction variable. When you press RIGHT, it sets the variable to 1, when you press LEFT, it makes it -1. Upon the creation of the projectile use this code;
- Code: Select all
xvelocity=5*dir; // 5 is the speed you want, dir is the direction variable