Skip to main content
gamedev.net
🔒 Locked

Tile Rendering

Started by Ferrik Bromyde Jul 1, 2004 at 5:42 PM 1 replies 900+ views
Original Post
Ferrik Bromyde
Ferrik Bromyde
Afternoon, all! I'm currently working on a two-dimensional game (my first game attempt in a few years). Type: Sidescroller, sort of a multiplayer platformer. Language: Visual C++. As far as rendering is concerned, a World object consists of a Room and a Camera. A Room contains a list of Layers. Each Layer contains a grid/array of Tiles and a list of Sprites. For the purposes of rendering, each Tile contains its image (and any overlays/effects/etc.) and each Sprite contains its position and image. The game is multiplayer (but not a MMOG), and so there are multiple rooms, and even the possibility that rooms may share a layer. Does this make sense or are there obvious flaws in the design? Or is it overcomplicated, etc.? Thanks for reading! :)
fyhuang
fyhuang
One thing I would like to know is whether the 'images' of your tiles/sprites/whatever are stored in the structures as real images or indexes into a global image array. That could potentially be one area you could fix. You could do that with lots of stuff, i.e. shared layers, where you could have a global array of layers and just index into it.

As for the rest, as long as you have good, solid rendering code, that design shouldn't be a problem (or much of).
- fyhuang [ site ]
Ferrik Bromyde
Ferrik Bromyde
An "image" would likely be a pointer and an offset in texture coordinates for Sprites. For tiles it would be an index in an array of pointer/offset combinations.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.