this game is looking rather good, hard and easy to play, i edited it a little bit to make it slightly easier though, because the computer was simply always in the right place....
rem -setup basics
make matrix 1,500,500,50,50
set matrix wireframe off 1
make object box 1,26,4,8
make object box 2,26,4,8
make object sphere 3,4
position object 1,250,2,40
color object 1,rgb(255,0,0)
position object 2,250,2,460
color object 2,rgb(255,0,0)
position object 3,250,4,250
color object 3,rgb(0,0,255)
position camera 250,25,-35
autocam off
hide mouse
randomize timer()
sync on
sync rate 60
side = rnd(1)
fog on
fog distance 700
fog color rgb(rnd(255),rnd(255),rnd(255))
backdrop on
color backdrop rgb(0,0,0)
randomize timer()
set ambient light 25
color ambient light rgb(rnd(255),rnd(255),rnd(255))
rem -setup basic font style
set text size 16
set text to bold
rem -setup ball basics
ballspeedx# = rnd(3)
ballspeedz# = rnd(5)
if ballspeedx# = 0 then ballspeedx# = 2
if ballspeedz# = 0 then ballspeedz# = 5
if side = 1 then ballspeedx# = ballspeedx# * -1 ; ballspeedz# = ballspeedz# * -1
rem -setup score basics
myscore = 0
compscore = 0
myscorestring$ = "Player: "
compscorestring$ = "Computer: "
rem -setup collision
make object collision box 1,-13,-2,-13,13,2,13,0
make object collision box 2,-13,-2,-13,13,2,13,0
make object collision box 3,-2,-2,-2,2,2,2,0
rem -MAIN LOOP
do
rem -setup basic variables
mypadx# = object position x(1)
comppadx# = object position x(2)
ballx# = object position x(3)
ballz# = object position z(3)
camerax# = camera position x()
rem -setup controls
if leftkey() = 1 then dec mypadx#, 4 ; dec camerax#, 4
if rightkey() = 1 then inc mypadx#, 4 ; inc camerax#, 4
rem -check left and right bounds
if mypadx# >= 487 then mypadx# = 487
if mypadx# <= 13 then mypadx# = 13
if camerax# >= 487 then camerax# = 487
if camerax# <= 13 then camerax# = 13
rem -create very basic ai :)
comppadx# = object position x(2)
rem -set up ball movement
if ballx# >= 498 then ballspeedx# = ballspeedx# * -1
if ballx# <= 2 then ballspeedx# = ballspeedx# * -1
if object collision(3,1) > 0 then ballspeedz# = ballspeedz# * -1
if object collision(3,2) > 0 then ballspeedz# = ballspeedz# * -1
if ballz# >= 498 then ballspeedz# = ballspeedz# * -1 ; inc myscore, 1
if ballz# <= 2 then ballspeedz# = ballspeedz# * -1 ; inc compscore, 1
rem -move all objects that need moving
position object 1,mypadx#,2,40
`if rnd(5)=0
if ballx#<comppadx# then position object 2,comppadx#-0.75,2,460
if ballx#>comppadx# then position object 2,comppadx#+0.75,2,460
`endif
position object 3,ballx#+ballspeedx#,4,ballz#+ballspeedz#
position camera camerax#,25,-35
point camera ballx#,4,ballz#
rem -display score
text 2,3,myscorestring$ + str$(myscore)
text 2,18,compscorestring$ + str$(compscore)
rem -SYNC
sync
rem -END MAIN LOOP
loop
[edit]
ok just wanted to try the texture and spotted what was making it so easy for the computer.... the ball has a random speed
anyway here's the updated code... mine works with texture, just replace the texture name with ur own (think this is what u wanted)
rem -setup basics
make matrix 1,500,500,50,50
set matrix wireframe off 1
load image "texture.jpg",1
prepare matrix texture 1,1,1,1
fill matrix 1,0,1
make object box 1,26,4,8
make object box 2,26,4,8
make object sphere 3,4
position object 1,250,2,40
color object 1,rgb(255,0,0)
position object 2,250,2,460
color object 2,rgb(255,0,0)
position object 3,250,4,250
color object 3,rgb(0,0,255)
position camera 250,25,-35
autocam off
hide mouse
randomize timer()
sync on
sync rate 60
side = rnd(1)
fog on
fog distance 700
fog color rgb(rnd(255),rnd(255),rnd(255))
backdrop on
color backdrop rgb(0,0,0)
randomize timer()
set ambient light 25
color ambient light rgb(rnd(255),rnd(255),rnd(255))
rem -setup basic font style
set text size 16
set text to bold
rem -setup ball basics
ballspeedx# = rnd(3)+1
ballspeedz# = rnd(5)+1
if side = 1 then ballspeedx# = ballspeedx# * -1 ; ballspeedz# = ballspeedz# * -1
rem -setup score basics
myscore = 0
compscore = 0
myscorestring$ = "Player: "
compscorestring$ = "Computer: "
rem -setup collision
make object collision box 1,-13,-2,-13,13,2,13,0
make object collision box 2,-13,-2,-13,13,2,13,0
make object collision box 3,-2,-2,-2,2,2,2,0
rem -MAIN LOOP
do
rem -setup basic variables
mypadx# = object position x(1)
comppadx# = object position x(2)
ballx# = object position x(3)
ballz# = object position z(3)
camerax# = camera position x()
rem -setup controls
if leftkey() = 1 then dec mypadx#, 4 ; dec camerax#, 4
if rightkey() = 1 then inc mypadx#, 4 ; inc camerax#, 4
rem -check left and right bounds
if mypadx# >= 487 then mypadx# = 487
if mypadx# <= 13 then mypadx# = 13
if camerax# >= 487 then camerax# = 487
if camerax# <= 13 then camerax# = 13
rem -create very basic ai :)
comppadx# = object position x(2)
rem -set up ball movement
if ballx# >= 498 then ballspeedx# = ballspeedx# * -1
if ballx# <= 2 then ballspeedx# = ballspeedx# * -1
if object collision(3,1) > 0 then ballspeedz# = ballspeedz# * -1
if object collision(3,2) > 0 then ballspeedz# = ballspeedz# * -1
if ballz# >= 498 then ballspeedz# = ballspeedz# * -1 ; inc myscore, 1
if ballz# <= 2 then ballspeedz# = ballspeedz# * -1 ; inc compscore, 1
rem -move all objects that need moving
position object 1,mypadx#,2,40
if ballx#<comppadx# then position object 2,comppadx#-0.1,2,460
if ballx#>comppadx# then position object 2,comppadx#+0.1,2,460
position object 3,ballx#+ballspeedx#,4,ballz#+ballspeedz#
position camera camerax#,25,-35
point camera ballx#,4,ballz#
rem -display score
text 2,3,myscorestring$ + str$(myscore)
text 2,18,compscorestring$ + str$(compscore)
rem -SYNC
sync
rem -END MAIN LOOP
loop
also u should look into changing the speed of the ball and computer based on difficulty settings
life's one big game
spec= 2ghz, 1gb ram, 512mb gpu, directx 9.0c, dbpro and classic