Jump to content

0

Playfield scrolling..


6 replies to this topic

#1 yuppicide OFFLINE  

yuppicide

    I am the Black Knight. Give me your money!

  • 6,933 posts
  • Location:New Jersey

Posted Wed Jul 23, 2008 12:26 PM

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?

#2 yuppicide OFFLINE  

yuppicide

    I am the Black Knight. Give me your money!

  • 6,933 posts
  • Location:New Jersey

Posted Wed Jul 23, 2008 12:30 PM

Maybe I am going about that wrong.. do I need to specify that much playfield or can I just do one line?

#3 Impaler_26 OFFLINE  

Impaler_26

    Cookie Meister

  • 2,417 posts
  • Braindead
  • Location:Hueco Mundo

Posted Wed Jul 23, 2008 2:05 PM

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


#4 MausGames OFFLINE  

MausGames

    Dragonstomper

  • 871 posts
  • Location:MO, USA

Posted Wed Jul 23, 2008 8:53 PM

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, Thu Jul 24, 2008 12:48 AM.


#5 yuppicide OFFLINE  

yuppicide

    I am the Black Knight. Give me your money!

  • 6,933 posts
  • Location:New Jersey

Posted Wed Jul 23, 2008 10:03 PM

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, Wed Jul 23, 2008 10:04 PM.


#6 yuppicide OFFLINE  

yuppicide

    I am the Black Knight. Give me your money!

  • 6,933 posts
  • Location:New Jersey

Posted Thu Jul 24, 2008 8:18 AM

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

View PostImpaler_26, on Wed Jul 23, 2008 4:05 PM, said:

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


#7 Impaler_26 OFFLINE  

Impaler_26

    Cookie Meister

  • 2,417 posts
  • Braindead
  • Location:Hueco Mundo

Posted Thu Jul 24, 2008 4:34 PM

View Postyuppicide, on Thu Jul 24, 2008 4:18 PM, said:

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

Attached Files






0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users