Create a SurfaceView Game step-by-step

In the coming posts, I will TRY to create a basic game, a VERY BASIC GAME: base on SurfaceView implements SurfaceHolder, display something as Sprites, running in backgroud Thread.

New a project MyGame of package com.MyGame, target Android 2.2, API Level 8.

Prepare my character

Creating graph is my weakest. As a example, I decide to copy my character from Android build-in icon.
- Create a /res/drawable folder.

- Open a file explorer and browse to any Android build-in platform drawable folder (ex. /android-sdks/platforms/android-8/data/res/drawable-mdpi/), drag any icon you want to /res/drawable folder under your project.
Drag any icon

- Select Copy files in the coming File Operation dialog.
Copy files

- Rename the drawable to icon_me.png: Click to select the copied icon, click File from Eclipse menu, and Rename...
Rename...

In the coming posts, I will show more in step-by-step.


Related Posts :

  • Create blur edge on bitmap, using BlurMaskFilter.The android.graphics.BlurMaskFilter class takes a mask, and blurs its edge by the specified radius. This example show how to make blur bitma… Read More...
  • Sprite auto-runIn last article Introduce Sprite without movement. In this article, we are going to make it self move.Modify Sprite.java to make it self ran… Read More...
  • android:singleLineandroid:singleLine attribute (either "true" or "false") constrains the text to a single horizontally scrolling line instead of letting it wr… Read More...
  • OpenCellIDWe can get our approximate location using TelephonyManager to get our phone connected Network Operator (MCC+MNC), cell id and location area … Read More...
  • Start a specified appIf you want to start another app directly, you can use the code intent.setClassName(PACKAGE_NAME, CLASS_NAME) to specify the expected app.wh… Read More...

0 Response to "Create a SurfaceView Game step-by-step"

Posting Komentar