문제

I'm trying to programm a Android Jump 'n' Run and I'm stuck in the general logic.

I want a groundline or bottomlevel that isn't straight. It should be like a curve, or hills and valleys (compare the Game Limbo). Is there any mathematical structure that describes such a state? I don't want to save every X-Value into an Array.

Please only give hints, no sourcecode ;)

I was already thinking about an edited sinus but in the Game it will look surreal...

도움이 되었습니까?

해결책

Here are some mathematical structures that can be used to describe paths.

  • Bézier curves -- neat curves
  • Line -- passes through two points (special case of a polynomial)
  • Ellipse -- generalization of a circle
  • Polynomial -- passes through a set of points

다른 팁

AndEngine comes to mind. Takes care of collisions and game physics as well. Has plenty of source examples and followers.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top