Images or Shapes?


Last Updated:

  1. Kailas

    Kailas Member This Topic's Starter

    Joined:
    Aug 25, 2010
    Messages:
    19
    Likes Received:
    0
    Hi everyone.

    I've just started developing a tile based game for android. Seeing as how efficiency is so important on mobile devices, I was wondering how I should go about drawing the level.

    Level terrain will be made up of walls and holes, both of which use the same set of simple shapes (see the attached image).

    One way of drawing the level is to go through each space in the level and draw the image corresponding to that space type in its position. This is the method I used in the c# level editor I made for this game and it worked but I don't know how efficient it was.

    The other way that I've come up with would be having the level as a table containing a View for each space. Each space then gets a small canvas to draw on and they use android's shapes to draw themselves.

    I was just wondering if anyone knew which method would be more efficient.
     

    Attached Files:


    Advertisement
  2. id0001

    id0001 Well-Known Member

    Joined:
    Apr 20, 2010
    Messages:
    142
    Likes Received:
    23
    I think the most efficient way is to create a single custom view where you draw images directly to.
    You would have a 2d array of tiles and then you draw !! only the tiles that are visible on the screen.

    -id
     

Share This Page

Loading...