android - JAVA 2D Scroll Game Layout and Obstacles with collision detection -


I got a great idea for the Android app. My biggest problem: I am a "beginning" in Java I was Java at IT University, but these were the basics! Generally I am developing in the net.

I make a vertical scrolling 2D game: SplashScreen (no problem) Main Menu (no problem) Level Overview (no problem) Game only (big problem :))

Vertical scrolling: I can do this, enough tutorial game maps and obstacles (no way)

How do I create a map (the walls are right and left) Mid part free To play with the obstacles is

There is a ball that falls down and you have to leave the ball before it closes on the right path when the ball is missing when the ball is missing.

How can I find out the confrontation with black walls and red obstacles?

And do not forget, it runs down I thought with the camera with Andygen ...

Image: < P> https: //www.dropbox.com/s/kzafsb041po9jc7/Unbenannt-2.png

How do I create a map

on the screen or In the memory?

  • Joggle, LWGL, .. There are so many things that you can start OpenGlag drawing on the screen. (I do not know if Andengine is not better), you need to use OpenGL version-compliant functions.
  • If you need to generate the wall information in memory, then you have a simple task superposition with a height-map.

    For example, to start with one, you need to calculate the surface normals to be able to put things on top of others (I'm sure Not that the Android device is capable of performing real-time for high-resolution). Sine wave,

    enter image details here

    a square Adding the wave above it,

    Enter image details here

    Superposition Case:

    Enter image details here

    random - Height-map, you get randomly on one side of the wall and you can get it only by using one or two lines of code (if you get it from memory space You need to save more coordinates if you need to save more CPU cycles.):

    image description here Enter

    How can I find out a collision?

    Do you need an incident based or direct identity?

      Detect Priority: You kill imaginary rays with the ball with the direction of the ball's velocity vector. Examine both the walls and if the coordinates for 'red barriers' radiation intersect, it will know what time the object is to hit after the N time-steps. (If everything has been unchanged) you can try several ray tests which works like a background, such as test shoot rays before the current situation, the next test is from the next position of the balls, next to the next Well ... well: before you fall, you can stop it in "just time". You can calculate that the ball will jump after the collision! Even bad for constant collision: Need more CPU cycles, the recycling can kill performance.

      Before shooting rays, using a "categorized" algorithm on a different object coordinate buffer can be detected faster.

      • Posterior detection is simple because you check only when the coordination of the ball is fit in a tolerance interval of coordinating any other object. Well: This is the simplest: bad: it can already bump a bug or explode, you have to return the ball to the proper position. If you are good behind physics, then you will not need the establishment. Repulsive force can be obtained from cut exponential potential or some simple step function.

        A number of acceleration structures are needed when the number of objects is high (helps in KD-tree)

        • You link to the collision area Can work hard. Each new object will add the second line of code for implementation. At least CPU cycles are required (for example, a situation is a wall position or any other obstacle, 1 for collision and 0 for non-collision, then a map of 1x and 0 50x400 of a lot store Should not be filled).

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -