realbasic-games
[Top] [All Lists]

Re: tiles and Sprite Surface

To: REALbasic Games <realbasic-games at lists dot realsoftware dot com>
Subject: Re: tiles and Sprite Surface
From: "Joseph J. Strout" <joe at realsoftware dot com>
Date: Sat, 26 Jul 2003 16:31:44 -0700
At 5:45 PM -0500 7/26/03, Eric wrote:

Ok in the PaintTile I have this
  g.drawPicture
Tiles(game_Map_Layers(1).Get_Tile_ID(ypos+1,xpos+1)).Get_TileImage,ypos,xpos

....

You shouldn't be drawing them at YPos, XYos, or at least I can't think of any reason why you should be doing so. You should be drawing them at 0,0 if your tiles match SpriteSurface tiles in size.

Yours don't -- you'd need to draw four of your tiles for each one of the SpriteSurface's tiles. But that's going to be a little more complex, and since you're new at this, you should be looking for ways to make your life easier. Using 64x64 tiles will do that. I highly recommend you switch to that for this project, and go back to smaller tile sizes later when you have more experience under your belt.

Also, you really should study the existing examples. They virtually all show how to do this properly, thus avoiding the need to reinvent the wheel. If you really don't do well from examples, then perhaps you'd do better with a book -- for example, REALbasic: The Definitive Guide has a chapter on the SpriteSurface and explains this stuff pretty well.

OTOH, learning by doing is good too, and don't be shy about asking here when you get stuck!

Cheers,
- Joe

--
,------------------------------------------------------------------.
|    Joseph J. Strout           REAL Software, Inc.                |
|    joe at realsoftware dot com       http://www.realsoftware.com        |
`------------------------------------------------------------------'

---
A searchable archive of this list is available at:
<http://support.realsoftware.com/listarchives/search.php>

Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>
.


<Prev in Thread] Current Thread [Next in Thread>