Yeah sure. Here it is.
rem set display mode
set display mode 640,480,32
hide mouse
set text font "Comic Sans MS"
rem turn manual sync on and set sync rate to 30
sync on
sync rate 100
rem load media for game
load image "media/bat1.bmp",1
load image "media/bat2.bmp",2
load image "media/ball.bmp",3
load image "media/tennis2.bmp",4
load image "media/tennis.bmp",5
rem load all sounds for game
load sound "media/applausesmall.wav",1
load sound "media/crowdcheer.wav",2
load sound "media/crowdohh.wav",3
load sound "media/thwack01.wav",4
load sound "media/thwack02.wav",5
load sound "media/love 15.wav",015
load sound "media/love 40.wav",040
load sound "media/love 30.wav",030
load sound "media/deuce.wav",4040
load sound "media/advantage player 1.wav",10
load sound "media/advantage player 2.wav",11
load sound "media/advantage computer.wav",12
load sound "media/40 love.wav",400
load sound "media/40 30.wav",4030
load sound "media/40 15.wav",4015
load sound "media/30 love.wav",300
load sound "media/30 all.wav",3030
load sound "media/30 40.wav",3040
load sound "media/30 15.wav",3015
load sound "media/15 love.wav",150
load sound "media/15 all.wav",1515
load sound "media/15 40.wav",1540
load sound "media/15 30.wav",1530
load music "media/badminton1a.mp3",1
load music "media/crowdchatter.mp3",2
rem setup variables
cls
stop music 1
p1pos# = 200
p2pos# = 200
ball_x = 320
ball_y = 240
ball_speed = 7
ballx_dir = 0
bally_dir = 0
p1win = 0
p2win = 0
p1score = 0
p2score = 0
rem random number
random_direction_x = RND(1)
random_direction_y = RND(1)
ballx_dir = random_direction_x
bally_dir = random_direction_y
reset_variables:
cls
stop music 1
p1pos# = 200
p2pos# = 200
ball_x = 320
ball_y = 240
ball_speed = 7
ballx_dir = 0
bally_dir = 0
p1win = 0
p2win = 0
p1score = 0
p2score = 0
reset = 0
set cursor 280,50:print p1points$
set cursor 320,50:print "-"
set cursor 350,50:print p2points$
gosub main_menu
main_menu:
cls
hide all sprites
backdrop on
show mouse
do
paste image 4,0,0
if mousex()>=213 and mousex()<=435 and mousey()>=95 and mousey()<=142 and mouseclick()=1
gosub single_player
endif
if mousex()>=231 and mousex()<=423 and mousey()>=161 and mousey()<=210 and mouseclick()=1
gosub two_player
endif
if mousex()>=274 and mousex()<=358 and mousey()>=227 and mousey()<=270 and mouseclick()=1
end
endif
set cursor 100, 460
set text size 16
ink rgb (0,128,255),1
Print "Copyright of Code Monkey Studio's 2004. Created by Michael Eddie on 13th March 2004"
sync
loop
single_player:
do
cls
rem sound
loop music 1
set music volume 1,200
loop music 2
set music volume 2,100
rem background setup
show all sprites
paste image 5,0,0
set text size 14
ink rgb (255,255,255),1
rem position bats
sprite 1,40,p1pos#,1
Sprite 2,575,p2pos#,2
rem position ball
sprite 3,ball_x,ball_y,3
rem move bats
if upkey() = 1 and p1pos# > 20 then p1pos# = p1pos# - 10
if downkey() = 1 and p1pos# < 330 then p1pos# = p1pos# + 10
if ball_y > 240 and p2pos# < 330
p2pos# = p2pos# + 15
endif
if ball_y < 240 and p2pos#> 20
p2pos# = p2pos# - 15
endif
rem ball directions
If ballx_dir = 0 then DEC ball_x, ball_speed
If ballx_dir = 1 then INC ball_x, ball_speed
If bally_dir = 0 then DEC ball_y, ball_speed
If bally_dir = 1 then INC ball_y, ball_speed
IF ball_y < 10 then bally_dir = 1
IF ball_y > 450 then bally_dir = 0
rem collision
for check_collision = 1 to 2
If sprite hit(check_collision, 3) = 1
if check_collision = 1 then ballx_dir = 1: play sound 4
if check_collision = 2 then ballx_dir = 0: play sound 5
endif
next check_collision
rem ball leaves screen
if ball_x < 35 then new_ball = 1 : p2score = p2score + 1 : play sound 3 : set sound volume 3,50
if ball_x > 605 then new_ball = 1 : p1score = p1score + 1 : play sound 1 : set sound volume 1,50
rem creates new ball
if new_ball = 1
SLEEP 1000
ball_x = 320
ball_y = 240
ballx_dir = RND(1)
bally_dir = RND(1)
new_ball = 0
endif
rem scoring
if p1score = 0 then p1points$ = "Love"
if p1score = 1 then p1points$ = "15"
if p1score = 2 then p1points$ = "30"
if p1score = 3 and p2score < 3 then p1points$ = "40"
if p2score =0 then p2points$ = "Love"
if p2score =1 then p2points$ = "15"
if p2score =2 then p2points$ = "30"
if p2score =3 and p1score < 3 then p2points$ = "40"
if p1score = 4 and p2score < 3 then p1win = 1
if p2score = 4 and p1score < 3 then p2win = 1
if p1score > 3 and p2score >= 3 and p2score = p1score - 2 then p1win = 1
if p1score >= 3 and p2score > 3 and p1score = p2score - 2 then p2win = 1
if p1score >=3 and p2score >= 3 and p1score = p2score
p1points$ = "Deuce"
p2points$ = "Deuce"
endif
if p1score > 3 and p2score >= 3 and p2score = p1score - 1
p1points$ = "Adv"
p2points$ = ""
endif
if p1score >= 3 and p2score > 3 and p1score = p2score - 1
p2points$ = "Adv"
p1points$ = ""
endif
if p1win = 1
ball_speed = 0 : delete sprite 3
set cursor 300,240 : print "Player 1 Wins!"
set cursor 285,260 : print "Press Space to Continue"
if spacekey() = 1 then reset = 1
endif
if p2win = 1
ball_speed = 0 : delete sprite 3
set cursor 300,240 : print "The Computer Wins!"
set cursor 285,260 : print "Press Space to Continue"
if spacekey() = 1 then reset = 1
endif
if reset = 1 then gosub reset_variables
set cursor 275,50:print p1points$
set cursor 320,50:print "-"
set cursor 355,50:print p2points$
if keystate(199) = 1 then gosub main_menu
if p1score = 1 and p2score = 0 then play sound 150
if p1score = 2 and p2score = 0 then play sound 300
if p1score = 3 and p2score = 0 then play sound 400
if p1score = 1 and p2score = 1 then play sound 1515
if p1score = 2 and p2score = 1 then play sound 3015
if p1score = 3 and p2score = 1 then play sound 4015
if p1score = 2 and p2score = 2 then play sound 3030
if p1score = 2 and p2score = 3 then play sound 3040
if p1score = 3 and p2score = 1 then play sound 4015
if p1score = 3 and p2score = 2 then play sound 4030
if p1score = 3 and p2score = 3 then play sound 4040
if p1score = 0 and p2score = 1 then play sound 015
if p1score = 0 and p2score = 2 then play sound 030
if p1score = 0 and p2score = 3 then play sound 040
if p1score = 1 and p2score = 2 then play sound 1530
if p1score = 1 and p2score = 3 then play sound 1540
sync
loop
two_player:
do
cls
rem sound
loop music 1
set music volume 1,200
loop music 2
set music volume 2,100
rem setup background
show all sprites
paste image 5,0,0
set text size 14
ink rgb (255,255,255),1
rem position bats
Sprite 1,40,p1pos#,1
Sprite 2,575,p2pos#,2
rem position ball
sprite 3,ball_x,ball_y,3
rem move bats
if upkey() = 1 and p1pos# > 20 then p1pos# = p1pos# - 10
if downkey() = 1 and p1pos# < 330 then p1pos# = p1pos# + 10
if keystate(72) = 1 and p2pos# > 20 then p2pos# = p2pos# -10
if keystate(80) = 1 and p2pos# < 330 then p2pos# = p2pos# + 10
rem ball directions
If ballx_dir = 0 then DEC ball_x, ball_speed
If ballx_dir = 1 then INC ball_x, ball_speed
If bally_dir = 0 then DEC ball_y, ball_speed
If bally_dir = 1 then INC ball_y, ball_speed
IF ball_y < 10 then bally_dir = 1
IF ball_y > 450 then bally_dir = 0
rem collision
for check_collision = 1 to 2
If sprite hit(check_collision, 3) = 1
if check_collision = 1 then ballx_dir = 1 : play sound 4
if check_collision = 2 then ballx_dir = 0 : play sound 5
endif
next check_collision
rem ball leaves screen
if ball_x < 35 then new_ball = 1 : p2score = p2score + 1 : play sound 1
if ball_x > 605 then new_ball = 1 : p1score = p1score + 1 : play sound 1
rem creates new ball
if new_ball = 1
SLEEP 1000
ball_x = 320
ball_y = 240
ballx_dir = RND(1)
bally_dir = RND(1)
new_ball = 0
endif
rem scoring
if p1score = 0 then p1points$ = "Love"
if p1score = 1 then p1points$ = "15"
if p1score = 2 then p1points$ = "30"
if p1score = 3 and p2score < 3 then p1points$ = "40"
if p2score =0 then p2points$ = "Love"
if p2score =1 then p2points$ = "15"
if p2score =2 then p2points$ = "30"
if p2score =3 and p1score < 3 then p2points$ = "40"
if p1score = 4 and p2score < 3 then p1win = 1
if p2score = 4 and p1score < 3 then p2win = 1
if p1score > 3 and p2score >= 3 and p2score = p1score - 2 then p1win = 1
if p1score >= 3 and p2score > 3 and p1score = p2score - 2 then p2win = 1
if p1score >=3 and p2score >= 3 and p1score = p2score
p1points$ = "Deuce"
p2points$ = "Deuce"
endif
if p1score > 3 and p2score >= 3 and p2score = p1score - 1
p1points$ = "Adv"
p2points$ = ""
endif
if p1score >= 3 and p2score > 3 and p1score = p2score - 1
p2points$ = "Adv"
p1points$ = ""
endif
if p1win = 1
ball_speed = 0 : delete sprite 3
set cursor 300,240 : print "Player 1 Wins!"
set cursor 285,260 : print "Press Space to Continue"
if spacekey() = 1 then reset = 1
endif
if p2win = 1
ball_speed = 0 : delete sprite 3
set cursor 300,240 : print "Player 2 Wins!"
set cursor 285,260 : print "Press Space to Continue"
if spacekey() = 1 then reset = 1
endif
if reset = 1 then gosub reset_variables
set cursor 275,50:print p1points$
set cursor 320,50:print "-"
set cursor 355,50:print p2points$
if keystate(199) = 1 then gosub main_menu
sync
loop
The sound numbers may seem random but they stand for things. So if it says 15 15 then the sound number is 1515.
Cheers,
Michael
Ps the sound commentry is only in single player.
Intel Celron 2.6ghz, 256 MB Ram, 80gb HD,D DVD Rom, CD Rewriter,17" Flat pannel Monitior and DB Pro