Jump to content
IGNORED

Smooth scrolling like Defender, Nova Blast or Victory... how?


Recommended Posts

I don't know, but I assume they did it the same as I did for my games in the Search for the Stolen Crown Jewels series:

 

Only a few rows are scrolled (for me, depending on the game uo to 4). Nova Blast only needs to scroll the cliffs at the bottom row, and 2 or 3 rows for the islands. SCJ games have two rows on the bottom and up to 2 rows of clouds in the sky. All other movement is done via sprites.

For those rows, you stole each tile multiple times, depending on how smooth the scrolling will be, you have 4 or 8 shifted versions shifted by 2 or 1 pixels each. Then you quickly overwrite the VRAM data for the 3 or 4 rows in your game main loop. You only need to write 32 bytes of VRAM per row.

 

Philipp

  • Like 1
Link to comment
Share on other sites

One advantage of this technique vs. hardware scrolling available on other systems is that the different rows can scroll at different speeds. In the SCJ games, I used that to move the clouds at different speed from the ground. In Nova Blast, the islands move at a different speed from the cliffs at the bottom of the screen.

 

Philipp

  • Like 1
Link to comment
Share on other sites

I don't know, but I assume they did it the same as I did for my games in the Search for the Stolen Crown Jewels series:

 

Only a few rows are scrolled (for me, depending on the game uo to 4). Nova Blast only needs to scroll the cliffs at the bottom row, and 2 or 3 rows for the islands. SCJ games have two rows on the bottom and up to 2 rows of clouds in the sky. All other movement is done via sprites.

For those rows, you stole each tile multiple times, depending on how smooth the scrolling will be, you have 4 or 8 shifted versions shifted by 2 or 1 pixels each. Then you quickly overwrite the VRAM data for the 3 or 4 rows in your game main loop. You only need to write 32 bytes of VRAM per row.

 

Philipp

Thanks for the insight, I figured that was what Nova Blast was doing... Defender perplexes me a bit more but I guess it's more of the same.

Link to comment
Share on other sites

post-24767-0-49640200-1468210058_thumb.png

 

Here's the tileset for my game A Sparrow Goes Flapping. I have a copy of the tree as is, and a shift over by 4 version. Same for the grass and the tree top. The small tree is have 8 copy of it.

 

The trick is to use for if(frame==0) then screen(name_table2,name_table1); it to have to show name table at 0x1c00, and have 0x1800 editable with the getput library. The grass and the top is draw in this frame.

void MoveGrass2(void)
{
if(grass==0){put_at(0,16,Buffer2,32);put_at(0,0,Buffer2+66,32);}
if(grass==1){put_at(0,16,Buffer2+33,32);put_at(0,0,Buffer2+99,32);}
if(grass==2){put_at(0,16,Buffer2+1,32);put_at(0,0,Buffer2+67,32);}
if(grass==3){put_at(0,16,Buffer2+34,32);put_at(0,0,Buffer2+100,32);grass=255;}

grass++;
}

Some of the graphic is decompressed into RAM so buffer2 holds the decompressed version of the tables.

And the small tree is also drawn on this frame.

void DrawSmTree(void)
{
put_frame(bgtree0+(smtreep*12),smtree,5,2,6);put_frame(bgtree0+(smtreep*12),smtree+18,5,2,6);
}

put_frame is one of my most favorite Coleco BIOS function. Draw score routine is also called on this frame too.

 

Then when delay(1) and frame++ is hit, then it is frame 1, DrawTreeMachine(); put_frame won't draw the tiles if the tiles' x position is more than 32. frame 2, and frame 3 draw the other 2 trees. Frame 4, now hit screen(name_table1,name_table2); to display the finish picture, and then draw the small background trees and the top and the grass. Frame 5-7 draw the shifted version of the tree.

 

The tree also serve to erase the background a little instead of doing a 512 tile write to erase the entire picture. For example,

const byte Tree1[] = {

228,236,244,252,32,
229,237,245,253,32,
230,238,246,254,32,

228,236,244,252,32,
229,237,245,253,32,
230,238,246,254,32,

228,236,244,252,32,
229,237,245,253,32,
230,238,246,254,32,

228,236,244,252,32,
229,237,245,253,32,
230,238,246,254,32,

228,236,244,252,32,
229,237,245,253,32,
230,238,246,254,32,
};

32 will press the black tiles erasing the trail produced by the tree.

 

The cave part is a little more complicated.

 

I did an experiment with a bunch of scrolling trees with a cool parallax scrolling. I posted the source code to go with it.

 

post-24767-0-93750900-1468210487_thumb.gif

 

smoothscroll2.zip

  • Like 4
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...