How to go about creating a race track game? [closed]
开发者_如何学Go
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this questioni am planning to make racing game in android.I have created many applications in different mobile technology. but i am pretty much beginner for game application. So my question is how can i make race track in android? How should i show that car is moving on that race track. I have the images of cars and race track. But i have no idea how should i show the part of race track and how should show that car is moving on that track??
I suggest you download AndEngine ( an open source 2d android game develoopmnent framework ). In the examples there is a (very simple) race track demo with a movable car + controls + obstacles. If you have troubles you can always get support from the forums
AndEngine has a very easy learning curve :-)
Have fun creating your racing game!!
Here are 2 good tutorials on starting with 2d:
- Canvas tutorial
- OpenGL tutorial
The last part, about showing only a part of the map, can be achieved by using a BoundCamera
in AndEngine.
You should start with studying the 2D graphics capabilities of the Android library. Here's another good reference article. It lists some drawing options including drawing to the Canvas object which is probably the right choice for the kind of game you're describing.
Here's a full but simple example of handling the onDraw event for a canvas and performing custom drawing. Here's a small bit of the code:
paint.setColor(Color.BLUE);
canvas.drawCircle(20, 20, 15, paint);
The above is a simple example that draws a circle with a particular size to a particular location on the canvas. It's a good place to start. To finish your game you'll be drawing bitmaps which is a more complex process but conceptually similar.
精彩评论