Batzi Posted November 17, 2015 Share Posted November 17, 2015 Hey guys! Hope you are doing well! So I have a sprite of a guy on a hoverboard. I am trying to simulate a hoverboard movement so that everytime he moves, it goes up and down as it moves towards the target. I am trying to simulate something close to this: Now this is going back and forth but I'd like it to go up and down instead. How would you implement it? Would you use gravity? Link to comment Share on other sites More sharing options...
Skeptron Posted November 17, 2015 Share Posted November 17, 2015 I would use a patterned function like sin or cos to get a slight deltaY to add to the player's y coord each frame. Link to comment Share on other sites More sharing options...
Batzi Posted November 17, 2015 Author Share Posted November 17, 2015 I would use a patterned function like sin or cos to get a slight deltaY to add to the player's y coord each frame. when you say player's y coord you mean the player's position on the y-axis and not the velocity right? Link to comment Share on other sites More sharing options...
Skeptron Posted November 18, 2015 Share Posted November 18, 2015 Yes, but I guess you could have the same result playing with his velocity. Might be even better, as that will trigger collisions. Link to comment Share on other sites More sharing options...
Recommended Posts