Comments on: Android Game Development – Part 1 GameLoop & Sprites https://warriormill.com/2009/10/adroid-game-development-part-1-gameloop-sprites/ Maximo Guerrero Tue, 11 Sep 2012 01:00:02 +0000 hourly 1 https://wordpress.org/?v=6.5.8 By: CheAse https://warriormill.com/2009/10/adroid-game-development-part-1-gameloop-sprites/comment-page-1/#comment-1091 Tue, 11 Sep 2012 01:00:02 +0000 http://warriormill.com/?p=452#comment-1091 I tried Arjan’s method and unfortunately it didn’t work.

However if you go into the Manifest and change your min sdk to this:

it should work

]]>
By: nokvisual https://warriormill.com/2009/10/adroid-game-development-part-1-gameloop-sprites/comment-page-1/#comment-972 Sun, 01 Apr 2012 18:19:54 +0000 http://warriormill.com/?p=452#comment-972 hi, we have created an app for android devices, its called: SpriteTester.
we have developed the tool, and it´s free, you can find it in google play.
You can visualize your sprites and improve them by loading, selecting parameters as columns, rows, speed, frame to frame and color background.
Hope it is useful for indie developers 😀
Sry about my english and any comments plz write me here. thanks

]]>
By: Letonai https://warriormill.com/2009/10/adroid-game-development-part-1-gameloop-sprites/comment-page-1/#comment-952 Mon, 05 Mar 2012 16:59:56 +0000 http://warriormill.com/?p=452#comment-952 Thanks Dude, your tutorial help me to make my first game: http://goo.gl/PfAEF
Thx

]]>
By: chirag https://warriormill.com/2009/10/adroid-game-development-part-1-gameloop-sprites/comment-page-1/#comment-821 Fri, 14 Oct 2011 13:26:11 +0000 http://warriormill.com/?p=452#comment-821 Thanks to arjan franzen……
I ws getting problem before I replace my code as per your instruction..

Hello frnds, If you use this code then it will work proper for mdpi devices, but for getting same result in ldpi and hdpi, you should just replce 1 line with 4 lines as per arjan franzen told.
then it will work fine…
Thanks to maximo also to share it….

]]>
By: chirag https://warriormill.com/2009/10/adroid-game-development-part-1-gameloop-sprites/comment-page-1/#comment-820 Sat, 08 Oct 2011 09:39:48 +0000 http://warriormill.com/?p=452#comment-820 some detailed explanation..

When I click on image to start animation…it takes 2 to 3 sec to start..
it takes this time for first time at canvas.drawBitmap..
how can I solve this??

]]>
By: chirag https://warriormill.com/2009/10/adroid-game-development-part-1-gameloop-sprites/comment-page-1/#comment-819 Sat, 08 Oct 2011 09:34:34 +0000 http://warriormill.com/?p=452#comment-819 hi,
thanks for this post.
I am using this for my app and have put onClick listner to start animation. but when It takes 2 to 3 sec to start animation.
how can I solve this prob.?
I hve made my own sprite image which contains more thn 100 images…

]]>
By: Arjan Franzen https://warriormill.com/2009/10/adroid-game-development-part-1-gameloop-sprites/comment-page-1/#comment-805 Sun, 03 Apr 2011 14:13:58 +0000 http://warriormill.com/?p=452#comment-805 Hi, The problem with the cut-in-half has to do with the picture i think

if you replace the code
tileSheet = BitmapFactory.decodeResource(context.getResources(), spriteid );

with:
BitmapFactory.Options options = new BitmapFactory.Options();
options.inDensity = 1;
options.inTargetDensity = 1;
tileSheet = BitmapFactory.decodeResource(context.getResources(), spriteid, options);

you instruct that it should be interpreted as 1 pixel density. and the idle animation appears!

good luck

Arjan

]]>
By: justin https://warriormill.com/2009/10/adroid-game-development-part-1-gameloop-sprites/comment-page-1/#comment-804 Sun, 03 Apr 2011 08:34:20 +0000 http://warriormill.com/?p=452#comment-804 Your code would look a lot better if it was posted in sourcecode tags. So all the spacing and color highlighting would show up.

http://en.support.wordpress.com/code/posting-source-code/
http://mdsaputra.wordpress.com/2010/08/25/posting-java-source-code-in-wordpress-blogs/

]]>
By: Mark Mooibroek https://warriormill.com/2009/10/adroid-game-development-part-1-gameloop-sprites/comment-page-1/#comment-802 Fri, 25 Mar 2011 06:05:44 +0000 http://warriormill.com/?p=452#comment-802 Very helpfull.

In the link below you can find my own posts on the matter. Maby a bit more up to date 🙂

the basics:
http://p-xr.com/android-tutorial-2d-canvas-graphics/

followup:
http://p-xr.com/android-tutorial-how-to-paint-animate-loop-and-remove-a-sprite/

]]>
By: cheke https://warriormill.com/2009/10/adroid-game-development-part-1-gameloop-sprites/comment-page-1/#comment-783 Tue, 25 Jan 2011 01:13:13 +0000 http://warriormill.com/?p=452#comment-783 Hello, your tutorial are so great, i use your tutorial on my personal proyect and i found were is the problem for android sdkś 1.5++ :
Here i put the code that i change and use:

–Your code:
public void loadSprite(int spriteid, int xmlid, Context context) {
tileSheet = BitmapFactory.decodeResource(context.getResources(), spriteid);
//load the xml will all the frame animations into a hashtable
XmlResourceParser xpp= context.getResources().getXml(xmlid);// this is the last line, you dont modify nothing after this

–My code:
public void loadSprite(int spriteid, int xmlid, Context context) {
sBitmapOptions.inPreferredConfig = Bitmap.Config.RGB_565;
InputStream is = context.getResources().openRawResource(spriteid);
try {
tileSheet = BitmapFactory.decodeStream(is, null, sBitmapOptions);
}finally {try {
is.close();
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}}
//load the xml will all the frame animations into a hashtable
XmlResourceParser xpp= context.getResources().getXml(xmlid);// after this all are =

Sorry for my english, im are spanish.
I hope this can help you, at you or some other = that help me.
So thanks for your tutorial.
You are so good.

]]>