Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>As a programmer, you should have a very strong conceptualization of how you would go about abstracting the macro idea of your game down into individual, accomplishable components so that when you're asking questions on StackOverflow or other, they are more along the lines of "How do I figure out the incident angle between the X-axis and a line generated by the point the user clicks and the center position of my bottle sprite" rather than "How do I build a game?". As you may discover (maybe not if I my assessment of your question is incorrect) there is a lot of work to be done.</p> <p>My recommendation if you want to accelerate your development is to utilize an existing framework rather than rewrite a lot of the basecode yourself (such as <strong>Cocos2D for Android</strong>), and then you can utilize such concepts as the aforementioned to accomplish the functionality you are looking for:</p> <ul> <li><a href="http://www.cocos2d-iphone.org/forum/topic/3823" rel="nofollow">http://www.cocos2d-iphone.org/forum/topic/3823</a></li> <li><a href="http://www.cocos2d-iphone.org/forum/topic/13853" rel="nofollow">http://www.cocos2d-iphone.org/forum/topic/13853</a></li> </ul> <p>You will still have to research topics such as loading graphics and drawing them onto the screen + retrieving user input.</p> <hr> <p>Alternatively, depending on how complex you want you app to be, you could just try loading up your sprite in an Image view and then using a Matrix to rotate it:</p> <pre><code>import android.app.Activity; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Matrix; import android.os.Bundle; import android.widget.ImageView; public class TestImages extends Activity { private float ANGLE = 30; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); ImageView image = (ImageView) findViewById(R.id.test_image); Bitmap bMap = BitmapFactory.decodeResource(getResources(), R.drawable.bottle); Matrix mat = new Matrix(); // Realistically, you would be computing angle using technique // similar to the links I posted, and you would want this to be // updated every frame or every time a 'drag' event occurred, rather // than just once when the app started mat.postRotate( ANGLE ); Bitmap bMapRotate = Bitmap.createBitmap(bMap, 0, 0, bMap.getWidth(), bMap.getHeight(), mat, true); image.setImageBitmap(bMapRotate); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload