Jump to content
IGNORED

Playfield scrolling..


yuppicide

Recommended Posts

Let's say I have this as a playfield:

 

play1
playfield:
  ..XXXXXXXXXXXXXXXXXXXXXXXXXXXX
  ..............................
  ..............................
  ..............................
  ..............................
  ..............................
  ..............................
  ..............................
  ..............................
  ..............................
  ..............................
  ..............................
end
goto fr

play2
playfield:
  XXXXXXXXXXXXXXXXXXXX..XXXXXXXX
  ..............................
  ..............................
  ..............................
  ..............................
  ..............................
  ..............................
  ..............................
  ..............................
  ..............................
  ..............................
  ..............................
end
goto fr

 

How would I make it so that the playfield in play1 scrolls down the screen.. once that line gets to the bottom it'll show play2?

Link to comment
Share on other sites

I would say you should use the playfield variables:

if b = 0 && k = 0 then var0 = %00111111 : var1 = %11111111 : var2 = %11111111 : var3 = %11111111

if b = 1 && k = 0 then var0 = %11111111 : var1 = %11111111 : var2 = %11111100 : var3 = %11111111

if k = Scrolls then pfhline 0 11 31 off

if k < Scrolls then pfscroll up : k = k + 1 else k = 0 : b = b + 1

 

I used 'Scrolls' because I'm not really sure how many times you have to scroll the playfield to roll the entire screen. Add as many lines for the b variable as you need, then add a "if b = _ then b = 0" for the highest number that b has an if/then statement for.

Edited by MausGames
Link to comment
Share on other sites

Will digest what you guys wrote tomorrow when I am at work. That's where I've installed vbB and bB for now. Too late for me to work at home I need sleep.

 

Hey, Maus. I saw you were interested in a hard copy of the BB manual? How could you not have a printer?

 

Anyway, I'll print you one in black and white if you're interested. It's 52 pages I believe. PM me if you need. Would make a great book to read on the toilet.

Edited by yuppicide
Link to comment
Share on other sites

Actually, I think you missed that I have spaces in there..

 

play1 would be

 pfhline 3 0 31 on

 

play 2 would require 2 pfhline commands

 

 pfhline 0 1 2 on
pfhline 5 1 31 on

 

Instead of using a whole playfield you can define lines with the "pfhline" command.

 

For "play 1" this would be: pfhline 2 0 31 on

and for "play 2": pfhline 0 0 21 on

pfhline 24 0 31 on

Link to comment
Share on other sites

Actually, I think you missed that I have spaces in there..

I didn't miss that, i copied and pasted your playfields and made 2 examples.

 

This example with your playfields does exactly the same as the other one with the pfhlines from my previous post:

 rem playfield

COLUPF=50 : COLUBK=120

play1
playfield:
  ..XXXXXXXXXXXXXXXXXXXXXXXXXXXX
  ..............................
  ..............................
  ..............................
  ..............................
  ..............................
  ..............................
  ..............................
  ..............................
  ..............................
  ..............................
  ..............................
end
drawscreen
if !joy0fire then goto play1

play2
playfield:
  XXXXXXXXXXXXXXXXXXXX..XXXXXXXX
  ..............................
  ..............................
  ..............................
  ..............................
  ..............................
  ..............................
  ..............................
  ..............................
  ..............................
  ..............................
  ..............................
end
drawscreen
if !joy0up then goto play2
goto play1

 

 rem pfhline

COLUPF=50 : COLUBK=120

start
pfhline 2 0 31 on
drawscreen
if !joy0fire then goto start
pfhline 2 0 31 off

test
pfhline 0 0 21 on
pfhline 24 0 31 on
drawscreen
if !joy0up then goto test
pfhline 0 0 21 off 
goto start

playfield.bas.bin

pfhline.bas.bin

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