Hi, i\'ve been trying to write the \"easiest\" of games, pong, without much luck. My trigonometry is hopeless so i was messing around with newvalues thingy. Anyway... there are many problems - such as the weird ball rotation when it hits a paddle and the fact that it repeats the same pattern every single time.
Can someone give me some help on how i can sort these out please? And keep it simple - i\'m still new!
REM Project: pong
set display mode 640,480,16
box 20, 480/2, 25, 320
box 620, 480/2, 625, 320
get image 1, 20,480/2,25,320
get image 2, 620,480/2,625,320
cls
circle 5,5,5
get image 3,0,0,15,15
cls
sprite 1,20,480/2,1
sprite 2,620,480/2,2
sprite 3,640/2, 480/2,3
rotate sprite 3,65
ballvel#=2
do
if upkey()=1 then move sprite 2,2
if sprite y(2)<5 then move sprite 2,-2
if downkey()=1 then move sprite 2,-2
if sprite y(2)>390 then move sprite 2,2
if sprite hit(3,0)=0 then move sprite 3,ballvel#
if sprite hit(3,2)=1
rotate sprite 3,newxvalue(sprite x(3),sprite angle(3),10)
move sprite 3,0.3
endif
if keystate(17) then move sprite 1,2
if sprite y(1)<5 then move sprite 1,-2
if keystate(31) then move sprite 1,-2
if sprite y(1)>390 then move sprite 1,2
if sprite hit (3,1)=1
rotate sprite 3,newxvalue(sprite x(3),sprite angle(3),10)
move sprite 3,0.3
endif
if sprite y(3)<5 then rotate sprite 3,newxvalue(sprite x(3),sprite angle(3),10)
if sprite y(3)>475 then rotate sprite 3,newxvalue(sprite x(3),sprite angle(3),10)
print \"sprite angle: \",sprite angle(3)
loop
wait key
DBPRO newbie