Crazy Balls

Post Reply
DrChip
Posts: 167
Joined: Wed Oct 22, 2014 3:26 pm
My devices: iPhone 4 to 6+,iPad mini to iPad air 2

Crazy Balls

Post by DrChip »

REM Crazy Balls by 12 year old my son Digit
REM iPhone 6 / 8.0.3

graphics
DIM x(4),y(4),z(4),xd(4),yd(4)
FOR a=1 TO 3
READ x(a),y(a),z(a),xd(a),yd(a)
NEXT a

loop:
refresh off
graphics clear 0,0,0
mm=mm+.05
GOSUB balls
refresh on
GOTO loop

balls:
FOR a=1 TO 3
fill COLOR 0,0,1
fill CIRCLE x(a),y(a) size z(a)
fill COLOR 1,1,1
fill CIRCLE x(a),y(a) size z(a)
x(a)=x(a)+xd(a)
y(a)=y(a)+yd(a)
xd(a)=xd(a)+SIN(mm)/3
yd(a)=yd(a)+SIN(mm)/3
IF x(a)>Screen_Width()-z(a) THEN
xd(a)=-xd(a)
END IF
IF x(a)<0+z(a) THEN
xd(a)=-xd(a)
END IF
IF y(a)>Screen_Height()-z(a) THEN
yd(a)=-yd(a)
END IF
IF y(a)<0+z(a) THEN
yd(a)=-yd(a)
END IF
NEXT a
RETURN

DATA 10,10,5,0.5,0.5
DATA 10,10,7,1,1
DATA 10,10,9,1.5,1.5
Attachments
image.jpg
image.jpg (70.68 KiB) Viewed 1885 times
image.jpg
image.jpg (70.99 KiB) Viewed 1885 times
image.jpg
image.jpg (70.95 KiB) Viewed 1885 times

Post Reply