' STAR FIELD DEMO -v2.0
' Code by Xone (c)2k8 ===============
' [User -----------------------------
stars = 550 rem Number of Stars
' ----------------------------------]
wX=640:wY=512:x=wX/2:y=wY/2
x1=x:y1=y:d=30:n=d:R=0.1-(d/1000):S=stars
for p = 1 to S
dim l(p,2):l(p,1)=ran(540)+50:l(p,2)=ran(472)+20
dim a(p):a(p)=0:dim v(p):v(p)=R:dim s(p,2)
s(p,1)=(l(p,1)-x)/d:s(p,2)=(l(p,2)-y)/d
next
open window wX,wY: setrgb 0,0,0,0: Label Lp
setdrawbuf CBu: CBu=1-CBu:setdispbuf CBu: clear window
m=1*((d/100)/100):c=1*(0.7+(m*30)):C=1*(0.7+(m*30)):k=k+0.01*c:K=K+0.01*C
if k>h then:j=ran():
if j<0.25 n=ran(18)+17:if j>=0.25 and j<0.6 n=ran(50)+35
if j>=0.6 n=ran(10)+85:h=ran(2)+1:k=0:fi
if K>H then:x1=ran(540)+50:y1=ran(472)+20:H=ran()+1:K=0:fi
if d<n d=d+0.2:if d>n d=d-0.2
R=0.1-(d/1000):w=0.3
if x<x1 x=x+w: if x>x1 x=x-w
if y<y1 y=y+w: if y>y1 y=y-w
for i = 1 to S
v(i)=R*(m*60):a(i)=a(i)+v(i):j=300-(d*3)
s(i,1)=(l(i,1)-x)/((d*2)-(a(i)*(d*sqrt(m*40))))
s(i,2)=(l(i,2)-y)/((d*2)-(a(i)*(d*sqrt(m*40))))
l(i,1)=l(i,1)+s(i,1)/(d/30):l(i,2)=l(i,2)+s(i,2)/(d/30)
if l(i,1)<-(0+j) or l(i,1)>(wX+j) or l(i,2)<-(0+j) or l(i,2)>(562+j) or a(i)>5 then
a(i)=0.1:l(i,1)=ran(540)+50:l(i,2)=ran(472)+20
fi
if l(i,1)>=0 and l(i,1)<=wX and l(i,2)>=0 and l(i,2)<=wY then
c=1/(d/70):setrgb 1,((a(i)/2)*200)*c,((a(i)/1.4)*220)*c,(a(i)*260)*c
j=(100-(d*4))/sqr(d/10): if j<=0 j=0
if a(i)<>0.1 line l(i,1), l(i,2) to l(i,1)-(s(i,1)*j), l(i,2)-(s(i,2)*j)
A=0.8:B=a(i)*0.2: fill rect l(i,1)-A, l(i,2)-A to l(i,1)+B, l(i,2)+B
fi
next
Goto Lp
Label gameover
Starfield with occasional warp speeding.
! Very nice. Great stuff Xone.
Love the 'warp' feeling. Looks real too.
Hey that looks really great.
You do know that Yabasic programs are allowed in our competitions here don't you? I think that you'd stand a really good chance of winning something with the things you make. I do hope you enter something into the transition challenge!
I hope so too these effects are really good. It would be great to see what Xone could come up with
It's ok, i'll give it a miss. Thanks for the offer though shockwave :cheers:
Just rescuing the work really. It would have been deleted and lost, so it was a
nice surprise to find that jim had made this emulator. Happy to share them.
I love it. :clap: :clap: :clap: