I use a Sinus Wave in my game to move powerups. The code that I currently have only moves over the y-axis. How can I modify my code so that I can rotate the sinus wave under any angle?
Can someone help me? My math skills are too basic. :/
Code:
this.curX = this.centerX + Math.sin(this.curAngle) * this.range;
this.curAngle += this.speedAngle;
var newPos:b2Vec2 = new b2Vec2(curX, curY);
this.body.SetXForm(newPos,0);
curY-=ySpeed;
this.curAngle += this.speedAngle;
var newPos:b2Vec2 = new b2Vec2(curX, curY);
this.body.SetXForm(newPos,0);
curY-=ySpeed;
Can someone help me? My math skills are too basic. :/