4
\$\begingroup\$

I'm looking at creating a tower-defence-style game on Android, developed in Java. I'm spending a lot of time trying to just get a background image (drawn onto a canvas) that pans/zooms within the bounds of the screen etc. that I will eventually draw my game onto.

It seems to be a lot of work just to get theses basics working correctly. Is there a simple barebones project that has this stuff taken care of that I can build my game on top of?

\$\endgroup\$
8
  • 1
    \$\begingroup\$ Look at canvas.drawBitmap(), canvas.scale(), and canvas.translate(). Use these methods in your view's onDraw(). \$\endgroup\$
    – Amplify91
    Commented Aug 16, 2011 at 13:46
  • \$\begingroup\$ @Amplify I get that, I've got offset and scale variable which are updated by the relevant touch actions, but it's just quite a lot of faff to get to the point where I can actually start making my game. I'm just surprised no one's made a barebones starter kit. \$\endgroup\$
    – fredley
    Commented Aug 16, 2011 at 14:20
  • \$\begingroup\$ +1 because I'd like a "barebones starter kit" too (I haven't been able to find one either). In fact, I'd really like one that also doesn't depend on any particular editor and has the very minimum number of files (I've seen editors that start out by creating a handful of sub-directories with files scattered all over the place, which essentially looks like a big mess that could be confusingly difficult to manage, but I suspect this is mostly a function of the editor rather than a requirement of Android). \$\endgroup\$ Commented Aug 16, 2011 at 15:03
  • 1
    \$\begingroup\$ Well there are lots of "barebones starter" tutorials online. Just do a quick Google search. I feel like if you aren't familiar enough with Android to get started, you aren't going to be able to continue on to more advanced functionality after borrowing "starter" code from somewhere else. Practice is learning. I would suggest asking a more specific question (ie, How to draw a background image?) and going from there. That's the way I learned! \$\endgroup\$
    – Amplify91
    Commented Aug 16, 2011 at 20:23
  • \$\begingroup\$ If you asked another question detailing exactly what you're trying to do, I would be glad to try to help you out with that. I can't really suggest the kind of project you are looking for, though. \$\endgroup\$
    – Amplify91
    Commented Aug 16, 2011 at 20:26

1 Answer 1

1
\$\begingroup\$

What you may be looking for is an engine. In that case, refer to this question: https://stackoverflow.com/questions/5206089/game-engine-for-android. I would recommend AndEngine or LibGDX. However, the best way to learn, in my opinion, is to power through the beginning things, learning along the way. Ask questions here and on StackOverflow and you'll be able to make your own "barebones" project in no time!

\$\endgroup\$
1
  • \$\begingroup\$ I've got this, but I'm having a hell of a time trying to get the example project to compile, Eclipse seems to have got into a complete tizz over it. I may post another question if I don't make any further progress... \$\endgroup\$
    – fredley
    Commented Aug 16, 2011 at 20:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .