realbasic-games
[Top] [All Lists]

Re: Spritesurface's Paint Tile method not working as advertised

To: REALbasic Games <realbasic-games at lists dot realsoftware dot com>
Subject: Re: Spritesurface's Paint Tile method not working as advertised
From: "Joseph J. Strout" <joe at realsoftware dot com>
Date: Mon, 13 Dec 2004 09:10:25 -0600
Delivered-to: realbasic-games at lists dot realsoftware dot com
References: <20041209180023 dot 6980A5BC478 at lists dot realsoftware dot com> <C0A26463-4BB5-11D9-A674-000A27E12C50 at pepelosoftware dot com>
At 3:46 PM -0500 12/11/04, Jose Lopez wrote:

Makes a lot of sense, too, but since I am hoping to put emphasis on the strategic and tactical side of things and much less weight on graphics and fast action, I think it would be friendlier not to hog the processor. Anyway, it seems to me that, should I change my mind later, it will not be too dificult changing the whole thing over to threats or a thight loop.

That's true.

So I checked online code examples (Blasteroids from Joe Strout) and tried examples from Matt Neuburg's 'Definite Guide to RB' and they did not work as advertised either in their PaintTile sections. But when inserting the command g.useOldRenderer=true at the beginning of the subroutine, these examples worked just fine, with a smooth, sexy scroll animation.

Ah yes, that's true, you have to UseOldRenderer with the PaintTile event on OS X. I've updated my Blasteroids example on the CD to include this. Where did you get an older version of that example? Hmm... maybe the one on my web site is out of date; I'll look into that.

But in my code, despite putting g.useOldRenderer=true everywhere, even on the toilet-paper, it still will not run properly. All the new tiles get drawn to the top left corner and scrolling is choppy.

Hmm.  Are you trying to call PaintTile manually or some such?

My project is a bit more complicated than the examples, since I have the spritesurface, which is the main playing area, and a canvas which displays a small overhead map of the whole game area, which is much larger than the spritesurface can show.

Where is this canvas? You don't have these controls overlapping, do you? That would be very bad mojo. Assuming the canvas is not touching the SpriteSurface, I can't imagine that would be involved.

Why don't you take a step back, and try making a simple example that simply scrolls a SpriteSurface at a constant rate, keeping a single sprite centered on the screen. In the PaintTile event, just paint the tile row/column or something like that. If that works for you, then you can start picking apart the difference between that and your real game.

Best,
- Joe

--
REAL World 2005 - The REALbasic User Conference
March 23-25, 2005, Austin, Texas
<http://www.realsoftware.com/realworld>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

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