Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rem Generated 1/25/2016 12:11:20 AM by Visual bB Version 1.0.0.548
- rem *************************************
- rem *Wal-Rush! *
- rem *A game of walrii, fish, and flight.*
- rem *Josiah Winslow *
- rem *[email protected] *
- rem *CC BY-NC-SA *
- rem *************************************
- rem Initial settings.
- set tv ntsc
- set kernel_option player1colors
- rem Variable aliases.
- dim P0_X=player0x.a
- dim P1_X=player1x.b
- dim _Walrii_Y_Vel=c
- dim _Bit0_Fire_Restrainer=d
- dim _Bit1_Walrii_Flying=d
- dim _Structure_Timer=e
- dim _Structure_Identifier=f
- dim _Frame_Delay=g
- dim _Fish_Animation=h
- dim _Fish_Animation_Delay=i
- rem Graphics data.
- playfield:
- ................................
- ................................
- ................................
- ................................
- ..X...X...X...X...X...X...X...X.
- .X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X
- X...X...X...X...X...X...X...X...
- .X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X
- ..X...X...X...X...X...X...X...X.
- .X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X
- X...X...X...X...X...X...X...X...
- end
- player1color:
- $04
- $04
- $04
- $04
- $04
- $04
- $04
- $04
- $04
- $04
- $04
- $04
- $80
- $80
- $80
- $80
- $04
- $04
- end
- player1:
- %10110110
- %10110110
- %11111111
- %11111111
- %10101111
- %10101111
- %10101111
- %10101111
- %10101111
- %10101111
- %11111111
- %11111111
- %11011010
- %11011010
- %10010010
- %10010010
- %01101100
- %01101100
- end
- rem Initialize variables for game.
- _Game_Start
- COLUPF=$08
- COLUBK=$0E
- COLUP0=$00
- player0x=255:player0y=255
- player1x=128:player1y=56
- _Walrii_Y_Vel=0
- _Bit0_Fire_Restrainer{0}=1
- _Bit1_Walrii_Flying{1}=0
- _Structure_Timer=240
- _Structure_Identifier=0
- _Frame_Delay=3
- _Fish_Animation=0
- _Fish_Animation_Delay=0
- rem Main game loop.
- _Main_Game_Loop
- rem Draw the screen.
- drawscreen
- rem Make Walrii twice as wide.
- NUSIZ1=$05
- rem Random structure generator.
- if _Structure_Timer=240 then _Structure_Timer=0:player0x=0:player0y=(rand&63)+21:gosub _Generate_Structure
- if _Structure_Identifier=0 then NUSIZ0=$05:goto _Mine
- if _Structure_Identifier=1 then goto _Fish
- if _Structure_Timer>0 then goto _Skip_Structures
- rem Mine (spikey ball).
- _Mine
- player0:
- %10010001
- %10010001
- %01001010
- %01001010
- %00111100
- %00111100
- %01111101
- %01111101
- %10111110
- %10111110
- %00111100
- %00111100
- %01010010
- %01010010
- %10001001
- %10001001
- end
- goto _Skip_Structures
- rem Fish (collectible item).
- _Fish
- rem Choose animation frame.
- if _Fish_Animation=0 then goto _Fish_0
- if _Fish_Animation=1 then goto _Fish_1
- if _Fish_Animation=2 then goto _Fish_2
- if _Fish_Animation=3 then goto _Fish_1
- _Fish_0
- player0:
- %11011000
- %10101000
- %10000110
- %01000010
- %01000001
- %01000101
- %00110001
- %00001110
- end
- goto _Skip_Fish_Frames
- _Fish_1
- player0:
- %00000000
- %11011110
- %10100001
- %01000001
- %10100101
- %11010010
- %00001100
- %00000000
- end
- goto _Skip_Fish_Frames
- _Fish_2
- player0:
- %00001110
- %00110001
- %01000101
- %01000001
- %01000010
- %10000110
- %10101000
- %11011000
- end
- _Skip_Fish_Frames
- rem Change animation frame.
- if _Fish_Animation_Delay=0 then _Fish_Animation_Delay=8:_Fish_Animation=_Fish_Animation+1
- _Fish_Animation_Delay=_Fish_Animation_Delay-1
- if _Fish_Animation=4 then _Fish_Animation=0
- _Skip_Structures
- rem Move structure based on timer.
- _Structure_Timer=_Structure_Timer+1:P0_X=P0_X+0.6
- rem Frame delay for Walrii.
- _Frame_Delay=_Frame_Delay-1
- if _Frame_Delay>0 then goto _Skip_Walrii_Move
- if _Frame_Delay=0 then _Frame_Delay=3
- rem "Repetition Restrainer".
- if !joy0fire then _Bit0_Fire_Restrainer{0}=0:goto _Skip_RR
- if _Bit0_Fire_Restrainer{0} then goto _Skip_RR
- _Bit0_Fire_Restrainer{0}=1:_Bit1_Walrii_Flying{1}=1
- _Skip_RR
- rem Check if Walrii should be flying.
- if !_Bit1_Walrii_Flying{1} then _Walrii_Y_Vel=_Walrii_Y_Vel+1:goto _Skip_Fly
- rem Change Walrii Y velocity.
- _Walrii_Y_Vel=-6:_Bit1_Walrii_Flying{1}=0
- _Skip_Fly
- rem Add Y velocity to position.
- player1y=player1y+_Walrii_Y_Vel
- rem Change X position based on keypress.
- if joy0left then P1_X=P1_X-2.5
- if joy0right then P1_X=P1_X+2.5
- _Skip_Walrii_Move
- rem Adjust Y position so you don't wrap around the screen.
- if player1y<18 then player1y=18
- if player1y>105 then player1y=105:_Walrii_Y_Vel=0
- rem Adjust X position so you don't wrap around the screen.
- if player1x<16 then player1x=16
- if player1x>128 then player1x=128
- rem Jump back to main game loop.
- goto _Main_Game_Loop
- rem Structure generator subroutine.
- _Generate_Structure
- if rand>140 then _Structure_Identifier=0 else _Structure_Identifier=1
- return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement