Here's the code:
`INITIAL SETUP
sync rate 40
sync on
disable escapekey
hide mouse
backdrop on
#include "keynames.dba"
dim keyboard$(221)
`DECLARE ARRAYS
dim speedk(1)
dim leftk(1)
dim rightk(1)
dim hitk(1,2)
dim jumpk(1)
dim held(1,2)
dim pos(1,1)
dim image(1)
dim dir(1)
dim gspeed(1)
dim points(1)
`DEFAULT CONTROLS
speedk(1)=156
leftk(1)=75
rightk(1)=77
hitk(1,0)=210
hitk(1,1)=199
hitk(1,2)=209
jumpk(1)=72
speedk(0)=33
leftk(0)=30
rightk(0)=32
hitk(0,0)=15
hitk(0,1)=42
hitk(0,2)=29
jumpk(0)=17
`LOAD IMAGES
for i = 1 to 4
load image "greendude0"+str$(i)+".bmp", i
load image "reddude0"+str$(i)+".bmp", 4+i
next i
keynames()
`LOAD SOUNDS
load sound "punch.wav",1
`INITIAL VALUES
dir(0) = 0
dir(1) = 0
begin:
pos(0,0)=160
pos(0,1)=360
pos(1,0)=480
pos(1,1)=360
image(0) = 1
image(1) = 1
do
center text 320,200, "Time Limit="+str$(tlimit)
center text 320,240, "Point Limit="+str$(plimit)
if rightkey()-leftkey() <> 0 then inc tlimit, rightkey()-leftkey(): wait 10
if upkey()-downkey() <> 0 then inc plimit, upkey()-downkey(): wait 10
if tlimit<0 then tlimit=0
if plimit<0 then plimit=0
if returnkey() then exit
sync
loop
t=0
`MAIN LOOP
Do
for i = 0 to 1
sprite 1+i,pos(i,0),pos(i,1),image(i)+(4*i)
offset sprite i+1, 52, 63
next i
pos(0,0)=pos(0,0)+ 3*(1+speed(0))*(horizontal(0)) * (1 - sprite collision(1,2)*0.5)
pos(1,0)=pos(1,0)+ 3*(1+speed(1))*(horizontal(1)) * (1 - sprite collision(1,2)*0.5)
if pos(0,0)<pos(1,0)
if dir(0) = 0 then mirror sprite 1: dir(0)=1
if dir(1) = 1 then mirror sprite 2: dir(1)=0
endif
if pos(0,0)>pos(1,0)
if dir(0) = 1 then mirror sprite 1: dir(0)=0
if dir(1) = 0 then mirror sprite 2: dir(1)=1
endif
for i = 0 to 1
if pos(i,0) < 0 then pos(i,0) = 0
if pos(i,0) > 640 then pos(i,0) = 640
next i
image(0)=1+hit(0)
image(1)=1+hit(1)
if escapekey() then gosub options
`keep track of how long attack buttons held
if hit(0)=0 then held(0,0)=0: held(0,1)=0:held(0,2)=0
if hit(0)=1 then held(0,0)=held(0,0)+1: held(0,1)=0:held(0,2)=0
if hit(0)=2 then held(0,0)=0: held(0,1)=held(0,1)+1:held(0,2)=0
if hit(0)=3 then held(0,0)=0: held(0,1)=0:held(0,2)=held(0,2)+1
if hit(1)=0 then held(1,0)=0: held(1,1)=0:held(1,2)=0
if hit(1)=1 then held(1,0)=held(1,0)+1: held(1,1)=0:held(1,2)=0
if hit(1)=2 then held(1,0)=0: held(1,1)=held(1,1)+1:held(1,2)=0
if hit(1)=3 then held(1,0)=0: held(1,1)=0:held(1,2)=held(1,2)+1
if sprite collision(1,2)
a = 1+screen fps()/4
for i = 1 to 3
if held(0,i-1)<a and hit(0)=i and hit(0)<>hit(1) then points(0)=points(0)+1: if sound playing(1)=0 then play sound 1
if held(1,i-1)<a and hit(1)=i and hit(0)<>hit(1) then points(1)=points(1)+1: if sound playing(1)=0 then play sound 1
next i
endif
inc t
tim$=str$(t/40)
text 1,1,"P1 Hits: "+str$(points(0))
text 321,1,"P2 Hits: "+str$(points(1))
center text 160, 21, "Time: "+tim$
text 500,1,"Press Esc for menu"
if tlimit <> 0 and val(tim$)=>tlimit then goto gamedone
if plimit <> 0
if points(0)=>plimit or points(1)=>plimit then goto gamedone
endif
for n = 0 to 1
if pos(n,1) < 360 then gspeed(n) = gspeed(n) + 1
pos(n,1)=pos(n,1)+gspeed(n)
next n
if jump(0)=1 and pos(0,1) => 360 then gspeed(0)=-15
if jump(1)=1 and pos(1,1) => 360 then gspeed(1)=-15
if jump(0)=0 and pos(0,1) => 360 then gspeed(0) = 0
if jump(1)=0 and pos(1,1) => 360 then gspeed(1) = 0
sync
Loop
`SUBROUTINES
`GAME OVER
gamedone:
do
if points(0)=points(1) then center text 320,180,"The Game Was Drawn"
if points(0)<points(1) then center text 320,180,"Player 2 Wins"
if points(0)>points(1) then center text 320,180,"Player 1 Wins"
center text 320,240, "Press space to continue"
if spacekey() then goto begin
sync
loop
return
`options screen
options:
do
center text 320, 10, "OPTIONS"
center text 320, 200, "(R)esume Game"
center text 320, 240, "(C)onfigure Controls"
center text 320, 280, "E(x)it Game"
if lower$(inkey$())="r" then exit
if lower$(inkey$())="c" then gosub controlconfig
if lower$(inkey$())="x" then end
sync
loop
return
`configure controls
controlconfig:
show mouse
do
for n = 0 to 1
text (n*320)+1,1, "Player "+str$(n+1)
text (n*320)+1,41, " Left: " + keyboard$(leftk(n))
text (n*320)+1,61, " Right: " + keyboard$(rightk(n))
text (n*320)+1,81, " Speed: " + keyboard$(speedk(n))
text (n*320)+1,101, "High Attack: " + keyboard$(hitk(n,0))
text (n*320)+1,121, " Mid Attack: " + keyboard$(hitk(n,1))
text (n*320)+1,141, " Low Attack: " + keyboard$(hitk(n,2))
text (n*320)+1,161, " Jump: " + keyboard$(jumpk(n))
next n
if mouseclick()=1 then selectx = mousex(): selecty=mousey()
if selectx<310 then p=0 else p=1
if selecty=>41 and selecty<61
leftk(p)=scancode()
endif
if selecty=>61 and selecty<81
rightk(p)=scancode()
endif
if selecty=>81 and selecty<101
speedk(p)=scancode()
endif
if selecty=>101 and selecty<121
hitk(p,0)=scancode()
endif
if selecty=>121 and selecty<141
hitk(p,1)=scancode()
endif
if selecty=>141 and selecty<161
hitk(p,2)=scancode()
endif
if selecty=>161 and selecty<181
jumpk(p)=scancode()
endif
if scancode()>0 then selectx=0: selecty=0
if escapekey() then exit
sync
loop
hide mouse
return
`FUNCTIONS
`speed pressed
function speed(p)
a = keystate(speedk(p))
endfunction a
`left/right pressed
function horizontal(p)
a = keystate(rightk(p))-keystate(leftk(p))
endfunction a
`attack pressed
function hit(p)
if keystate(hitk(p,1))=1 then a = 2: goto detected
if keystate(hitk(p,0))=1 then a = 1: goto detected
if keystate(hitk(p,2))=1 then a = 3: goto detected
a = 0
detected:
endfunction a
`jump pressed
function jump(p)
a = keystate(jumpk(p))
endfunction a
The sounds are from darkbasic media, so you can get them easily (or use other ones)
The graphics I drew in paint in about 2 minutes, so you're better off not using them.