realbasic-games
[Top] [All Lists]

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

To: realbasic-games at lists dot realsoftware dot com
Subject: Re: Spritesurface's Paint Tile method not working as advertised
From: Jose Lopez <pepelosoft at pepelosoftware dot com>
Date: Sat, 11 Dec 2004 15:46:37 -0500
Delivered-to: realbasic-games at lists dot realsoftware dot com
References: <20041209180023 dot 6980A5BC478 at lists dot realsoftware dot com>
Oh yes, most definitely -- or at least, "almost all."  That's one of
the behaviors of a Thread.  Using a Timer, you can clock it any way
you like, from sucking all available CPU to being perfectly friendly
to other apps.

Best,
- Joe

OK, good enough for me, I'll go for a timer with a spritesurface.update command, thanks.

You can stop that by hiding the cursor and displaying it with a sprite
instead(useful if you want a rather easy to do colorful mouse cursor).
And you could use stuff like System.Mousedown to check if the mouse
was pressed.

Personally, if I was making a RTS like game, I would use the Run
command/thight loop or a threaded loop, since most of my concentration
would go to the game anyway so I wouldn't need the option to go out of
the game and such(I mean, never once while playing Myth 2 did I think:
Oh, let's go check my mail while my army stands here and perhaps will
get attacked)

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.

But I have hit a new problem. The program should work so that when the selected object (a sprite) reaches a certain borderline part of the spritesurface (about 40 pixels from the edge), the spritesurface should scroll in such a way that the selected sprite remains at that position and the background scrolls by. For this I logically use the scroll method and inside the PaintTile method I draw the new background which should come into view. It does not work.

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. 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.

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. Don't know if that is part of the problem. Maybe someone has had a similar problem and can hint at a solution. My brain already hurts and I have run out of ideas.

Greets, Jose

_______________________________________________
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>