Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scrolling...

Status
Not open for further replies.

Oak

Programmer
Aug 6, 2000
77
0
0
CA
I'm wondering about scrolling methode. I know that Qb isn't the best (or maybe the worst) language to attempt such kind of work but anyway.

I would like to know more about how it can be done. Nothing speedy at least, such a zoom for a image editor or a scroll for a text editor. If you get something about fast graphics scrolling, it would be nice too but I don't expect to much about that. [*caugh-caugh* pression on logiclrd *cough-cough*] :)

So, it's math time, I guest?

Oak
 
Er, what kind of scrolling did you have in mind, specifically? There are many, many different ways and places to scroll, and most of them have specific solutions that aren't immediately applicable to many others.
 
MEEP, this is hard, you can scroll bitmats pretty easily. You just need to load them into a string, use LINE or PSET to put it on the screen, then (this is what makes it fast) you have to use GET and PUT to move the majority of the image, then PSET or LINE of the rest
 
Well, I like games. But I would like to do pretty basic things for truly understand them and then get start for something harder.

If its possible, I would like to experiment a game like old SuperMarioBros kind, with a basic scrolling left-to-right and get set to a more tricky thing after.

So, let say a 2D game that scroll LEFT-RIGHT.

Oak
 
I was writing my response the same time qbasicking response, so, I would like a world (that is bigger then the screen does) to get scroll LEFT-RIGHT (and RIGHT-LEFT).

Ya, maybe it could sound confusing but I just don't know HOW to start from there. ( it'S my first try about it).

If you have some basic tips, I would be happy to ear them!!

Oak
 
Hehe. Super Mario Bros uses special hardware acceleration :) The problem of parallax scrolling in pure QB is difficult to solve with speed without getting rather technical and abstract. For instance, if you draw to the screen directly as a linear frame buffer, using [tt]DEF SEG[/tt] and [tt]POKE[/tt] to set pixels (see my FAQ on segmented memory access faq314-290), then you can set up some kind of data structure that keeps track of all current layers of sprites w/ transparency information, and then kind of "fall through" to lower layers if the higher ones are transparent at the pixel you want.

To put it simply, there is no trivial way to do what you want, but it can be done with some more advanced concepts, both at the low level (direct video memory access) and the high level (data structures for the layering and such).
 
I have seen a program called 'bladio', it is kind of like mario. I think it is at it is pretty fast and it uses PUT. It draws all of the images that it needs, blocks of fire, ice, and dirt, then it GETs them. Then it has a file that it reads from for each level. When it calls for a fire block, it PUTs it rather than drawing it, which would take forever though.
But they should've done this to make it even faster: Remove the guy. GET as much of the screen as possible, move it and just fill in the edges
 
I have seen a program called 'bladio', it is kind of like mario. I think it is at it is pretty fast and it uses PUT. It draws all of the images that it needs, blocks of fire, ice, and dirt, then it GETs them. Then it has a file that it reads from for each level. When it calls for a fire block, it PUTs it rather than drawing it, which would take forever though.
But they should've done this to make it even faster: Remove the guy. GET as much of the screen as possible (use three or four arrays), move it and just fill in the edges
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top