[Gambas-user] gb3: Draw method with same source and destination image
Kevin Fishburne
kevinfishburne at ...1887...
Thu Feb 3 01:57:02 CET 2011
On 02/02/2011 07:00 PM, Benoît Minisini wrote:
> Actually you want some sort of scrolling?
Yes, although the image "shifting" I spoke of isn't what creates the
scrolling directly. Here's a brief breakdown of what happens in the game.
The server has a map 65536x65536 tiles, with each tile representing one
square foot. This map is organized into "cells", which are 32x32 tiles
each. When a client connects, the server sends the client a "cell grid"
of 3x3 cells, with the center cell being the cell the player is located
in. When the player moves outside the center cell, all the cells are
shifted accordingly and the server sends the player the data for the new
cells.
The client uses a DrawingArea of 1280x720 pixels to represent the final,
visible rendering of the world, but a "tile grid" image buffer is used
to composite the scene invisibly. While the cell grid is just landscape
data in arrays, the tile grid is a graphical representation of a subset
of the cell grid data. The tile grid is a square grid of tiles designed
to be a few tiles larger than the DrawingArea. Each tile is 128x128
pixels. If the DrawingArea is 1280x720 then the tile grid is 1408x1408
(11x11 tiles, with the player being in the center tile). The tile grid
is treated like an old-school RPG; when the player moves out of the
center tile the image is shifted one tile and a new row of tiles is
drawn. The player doesn't see this, however, as the DrawingArea is
updated from the tile grid by a camera that smoothly follows the player.
I would use SDL but it isn't currently robust enough to support the
effects I need (discussed in a previous email; no one has the time
currently to expand it). OpenGL, while nice, is complex enough that it
would prevent me from finishing the game. I'm doing all the design,
coding and artwork by myself (a friend is doing the music). So that
leaves me with pushing gb.image and gb.image.effect to their limits.
I'm almost to the point where I can record a video of the game in
action, so soon I'll be able to show you what I'm doing. Until then,
just struggling with frame rates. ;)
--
Kevin Fishburne
Eight Virtues
www: http://sales.eightvirtues.com
e-mail: sales at ...1887...
phone: (770) 853-6271
More information about the User
mailing list