Quote: "the ball can be rotated while in motion"
O.o ... I never looked at it that way
I added the XROTATE command to the game loop and it didn't mess it up one bit.
SYNC ON : SYNC RATE 60 : HIDE MOUSE : SET DISPLAY MODE 1024,768,32 : AUTOCAM OFF
SET TEXT SIZE 28 : SET TEXT FONT "Impact"
CENTER TEXT 512,350,"Loading..."
CENTER TEXT 512,380,"Setting Game Globals" : SYNC
GLOBAL P1 = 2
GLOBAL P2 = 3
GLOBAL PUK = 4
GLOBAL P1Z = 0
GLOBAL P2Z = 0
GLOBAL PKX# = 0.0
GLOBAL PKZ# = 0.0
GLOBAL PKA = 330
GLOBAL PTS = 128
GLOBAL P1SCORE = 0
GLOBAL P2SCORE = 0
GLOBAL PKR = 0
INK RGB(255,255,255),0 : CLS : CENTER TEXT 512,350,"Loading..."
CENTER TEXT 512,380,"Preparing Game Textures" : SYNC
INK RGB(0,0,0),0
FOR I=0 TO 127
INK RGB(0,I*2,0),0
LINE 0,I,127,I
NEXT I
GET IMAGE 1,0,0,127,127
INK RGB(0,0,0),0
FOR I=0 TO 127
INK RGB(0,0,I*2),0
LINE 0,I,127,I
NEXT I
GET IMAGE 2,0,0,127,127
INK RGB(255,255,255),0 : CLS : CENTER TEXT 512,350,"Loading..."
CENTER TEXT 512,380,"Setting Game Background" : SYNC
POSITION CAMERA 0,200,-80 : POINT CAMERA 0,0,0
MAKE OBJECT BOX 1,500,10,500
TEXTURE OBJECT 1,1
CLS : SYNC : CENTER TEXT 512,350,"Loading..."
CENTER TEXT 512,380,"Setting Game Objects" : SYNC
MAKE OBJECT CONE P1,30
COLOR OBJECT P1,RGB(50,180,50)
ZROTATE OBJECT P1,-90
SET OBJECT COLLISION ON P1
SET OBJECT COLLISION TO POLYGONS P1
SET OBJECT SMOOTHING P1,100
POSITION OBJECT P1,-100,20,P1Z
MAKE OBJECT CONE P2,30
COLOR OBJECT P2,RGB(255,0,0)
ZROTATE OBJECT P2,90
SET OBJECT COLLISION ON P2
SET OBJECT COLLISION TO POLYGONS P2
SET OBJECT SMOOTHING P2,100
POSITION OBJECT P2,100,20,P2Z
MAKE OBJECT SPHERE PUK,10
TEXTURE OBJECT PUK,2
SET OBJECT COLLISION ON PUK
POSITION OBJECT PUK,0,20,0
SET TEXT SIZE 14 : SET TEXT FONT "Verdana"
INK RGB(255,255,255),0
CLS
DO
PKA=WRAPVALUE(PKA)
PKX#=NEWXVALUE(PKX#,PKA,2)
PKZ#=NEWZVALUE(PKZ#,PKA,2)
CENTER TEXT 512,10,"Player: "+STR$(P1SCORE)
CENTER TEXT 512,30,"Computer: "+STR$(P2SCORE)
IF UPKEY()=1 AND P1Z < 65 THEN INC P1Z
IF DOWNKEY()=1 AND P1Z >-65 THEN DEC P1Z
IF UPKEY()=1 AND OBJECT COLLISION(PUK,P1) THEN PKA=PKA+12
IF DOWNKEY()=1 AND OBJECT COLLISION(PUK,P1) THEN PKA=PKA-12
IF SPACEKEY()=1 THEN PKA=RND(180)
IF PKA > 0 AND PKA <=180
IF P2Z < PKZ#
INC P2Z
ELSE
DEC P2Z
ENDIF
ENDIF
IF OBJECT COLLISION(PUK,P1) THEN PKA=360-PKA : INC PKX#,3
IF OBJECT COLLISION(PUK,P2) THEN PKA=360-PKA : DEC PKX#,3
PKA=WRAPVALUE(PKA)
IF PKZ# >= 75 OR PKZ# <= -75 THEN PKA=180-PKA
IF PKX# < OBJECT POSITION X(P1)-10 THEN GOSUB P2SCORED
IF PKX# > OBJECT POSITION X(P2)+10 THEN GOSUB P1SCORED
POSITION OBJECT P1,-100,20,P1Z
POSITION OBJECT P2,100,20,P2Z
POSITION OBJECT PUK,PKX#,20,PKZ#
INC PKR,5 : PKR=WRAPVALUE(PKR)
XROTATE OBJECT PUK,PKR
SYNC
LOOP
P2SCORED:
INC P2SCORE
SLEEP 1000
PKX#=0.0
PKZ#=0.0
PKA=RND(360)
RETURN
P1SCORED:
INC P1SCORE
SLEEP 1000
PKX#=0.0
PKZ#=0.0
PKA=RND(360)
RETURN