micro(A)v11
#84
Black hole collision B256 in micro(A)

Code: (Select All)
'black hole collision B256
var x,y,xspeed,yspeed,r,n,colision
x=160 : y = 180 : xspeed = 2 : yspeed = -1 : r=2 : n = 401
var xx[n] , yy[n] , xxspeed[n] , yyspeed[n] ,dist[n]
var dx[n] , dy[n], xac[n], yac[n+1], gravity[n], crash[n]
var p,s,px,py,t : colision = 0
p=1
while p < n
    xx[p]=rand(600)
    yy[p]=rand(600)
    p=p+1
wend
s=1
while s < n
     xxspeed[s]=rand(2)-1
     yyspeed[s]=rand(2)-1
     s=s+1
wend
px=300 : py=300
circle px,py,5

label loop
fcolor 190,190,190
rect 0,0,800,600
t=1
WHILE t < n
dist[t] = ((xx[t]-px)^2 + (yy[t]-py)^2)^(1/2)
gravity[t] = (r/dist[t])^2
dx[t] = xx[t]-px
dy[t] = yy[t]-py
xac[t]= (dx[t]/dist[t]) * gravity[t]
yac[t]= (dy[t]/dist[t]) * gravity[t]
if crash[t]=0 : xxspeed[t] = xxspeed[t]*0.999-xac[t] : endif
if crash[t]=0 : yyspeed[t] = yyspeed[t]*0.999-yac[t] : endif
if crash[t]=0 : xx[t] = xx[t] + xxspeed[t] : endif
if crash[t]=0 : yy[t] = yy[t] + yyspeed[t] : endif
If dist[t] < r & crash[t]=0
    r=r+8/r^2
    colision = colision + 1
    crash[t]=1
EndIf
print 10,10,"Colisions =": print 120,10,colision
fcolor 180,140,100 : circle xx[t], yy[t],2     ' rand(3)
t=t+2
WEND

circle px,py,r
swap
goto loop


Attached Files Image(s)
   
Reply


Messages In This Thread
micro(A)v11 - by aurel - 07-07-2023, 03:05 PM
RE: mAv11 - by mnrvovrfc - 07-07-2023, 06:52 PM
RE: mAv11 - by mnrvovrfc - 07-07-2023, 07:08 PM
RE: mAv11 - by aurel - 07-07-2023, 09:30 PM
RE: mAv11 - by aurel - 07-10-2023, 04:13 PM
RE: mAv11 - by aurel - 07-10-2023, 07:17 PM
RE: micro(A)v11 - by aurel - 07-12-2023, 05:03 PM
RE: micro(A)v11 - by aurel - 07-13-2023, 06:38 PM
RE: micro(A)v11 - by mnrvovrfc - 07-13-2023, 07:08 PM
RE: micro(A)v11 - by aurel - 07-15-2023, 04:27 PM
RE: micro(A)v11 - by aurel - 07-16-2023, 02:52 PM
RE: micro(A)v11 - by bplus - 07-16-2023, 03:56 PM
RE: micro(A)v11 - by aurel - 07-16-2023, 06:19 PM
RE: micro(A)v11 - by bplus - 07-16-2023, 06:39 PM
RE: micro(A)v11 - by mnrvovrfc - 07-16-2023, 07:34 PM
RE: micro(A)v11 - by aurel - 07-16-2023, 09:34 PM
RE: micro(A)v11 - by aurel - 07-16-2023, 09:42 PM
RE: micro(A)v11 - by aurel - 07-19-2023, 11:53 AM
RE: micro(A)v11 - by aurel - 07-21-2023, 06:38 AM
RE: micro(A)v11 - by mnrvovrfc - 07-21-2023, 06:45 AM
RE: micro(A)v11 - by aurel - 07-21-2023, 09:09 PM
RE: micro(A)v11 - by mnrvovrfc - 07-24-2023, 02:23 AM
RE: micro(A)v11 - by aurel - 07-24-2023, 07:00 AM
RE: micro(A)v11 - by aurel - 07-25-2023, 09:16 PM
RE: micro(A)v11 - by aurel - 07-26-2023, 05:30 PM
RE: micro(A)v11 - by aurel - 07-26-2023, 10:42 PM
RE: micro(A)v11 - by aurel - 07-27-2023, 09:55 AM
RE: micro(A)v11 - by mnrvovrfc - 07-28-2023, 02:29 AM
RE: micro(A)v11 - by mnrvovrfc - 07-28-2023, 07:42 AM
RE: micro(A)v11 - by aurel - 07-28-2023, 06:43 AM
RE: micro(A)v11 - by aurel - 07-28-2023, 09:38 AM
RE: micro(A)v11 - by mnrvovrfc - 07-28-2023, 05:59 PM
RE: micro(A)v11 - by aurel - 07-28-2023, 07:14 PM
RE: micro(A)v11 - by bplus - 07-29-2023, 03:09 PM
RE: micro(A)v11 - by mnrvovrfc - 07-29-2023, 07:07 PM
RE: micro(A)v11 - by bplus - 07-29-2023, 07:45 PM
RE: micro(A)v11 - by aurel - 07-29-2023, 09:30 PM
RE: micro(A)v11 - by aurel - 07-29-2023, 09:31 PM
RE: micro(A)v11 - by bplus - 07-29-2023, 09:53 PM
RE: micro(A)v11 - by mnrvovrfc - 07-29-2023, 10:10 PM
RE: micro(A)v11 - by aurel - 07-30-2023, 09:49 AM
RE: micro(A)v11 - by bplus - 07-30-2023, 02:35 PM
RE: micro(A)v11 - by aurel - 07-30-2023, 03:05 PM
RE: micro(A)v11 - by mnrvovrfc - 07-31-2023, 01:54 PM
RE: micro(A)v11 - by aurel - 07-31-2023, 02:10 PM
RE: micro(A)v11 - by mnrvovrfc - 07-31-2023, 02:39 PM
RE: micro(A)v11 - by aurel - 07-31-2023, 03:09 PM
RE: micro(A)v11 - by aurel - 07-31-2023, 03:10 PM
RE: micro(A)v11 - by mnrvovrfc - 08-01-2023, 03:12 PM
RE: micro(A)v11 - by bplus - 08-01-2023, 03:36 PM
RE: micro(A)v11 - by mnrvovrfc - 08-01-2023, 11:49 PM
RE: micro(A)v11 - by aurel - 08-02-2023, 08:21 AM
RE: micro(A)v11 - by mnrvovrfc - 08-08-2023, 03:59 AM
RE: micro(A)v11 - by aurel - 08-08-2023, 10:18 AM
RE: micro(A)v11 - by mnrvovrfc - 08-11-2023, 08:43 AM
RE: micro(A)v11 - by bplus - 08-11-2023, 09:17 AM
RE: micro(A)v11 - by aurel - 08-11-2023, 11:39 AM
RE: micro(A)v11 - by bplus - 08-11-2023, 01:19 PM
RE: micro(A)v11 - by aurel - 08-11-2023, 07:43 PM
RE: micro(A)v11 - by aurel - 08-11-2023, 10:41 PM
RE: micro(A)v11 - by aurel - 08-12-2023, 10:31 AM
RE: micro(A)v11 - by aurel - 08-12-2023, 10:36 AM
RE: micro(A)v11 - by aurel - 08-12-2023, 10:47 AM
RE: micro(A)v11 - by aurel - 08-12-2023, 10:49 AM
RE: micro(A)v11 - by mnrvovrfc - 08-12-2023, 12:18 PM
RE: micro(A)v11 - by bplus - 08-12-2023, 12:59 PM
RE: micro(A)v11 - by mnrvovrfc - 08-12-2023, 02:49 PM
RE: micro(A)v11 - by aurel - 08-12-2023, 07:14 PM
RE: micro(A)v11 - by bplus - 08-12-2023, 07:35 PM
RE: micro(A)v11 - by aurel - 08-12-2023, 09:02 PM
RE: micro(A)v11 - by mnrvovrfc - 08-14-2023, 04:43 PM
RE: micro(A)v11 - by aurel - 08-15-2023, 07:36 AM
RE: micro(A)v11 - by bplus - 08-15-2023, 12:42 PM
RE: micro(A)v11 - by aurel - 08-15-2023, 06:44 PM
RE: micro(A)v11 - by mnrvovrfc - 08-15-2023, 10:07 PM
RE: micro(A)v11 - by aurel - 08-16-2023, 06:51 AM
RE: micro(A)v11 - by aurel - 08-16-2023, 09:03 AM
RE: micro(A)v11 - by aurel - 08-20-2023, 10:54 AM
RE: micro(A)v11 - by mnrvovrfc - 08-20-2023, 01:23 PM
RE: micro(A)v11 - by aurel - 08-20-2023, 03:08 PM
RE: micro(A)v11 - by dbox - 08-20-2023, 03:46 PM
RE: micro(A)v11 - by mnrvovrfc - 08-20-2023, 04:19 PM
RE: micro(A)v11 - by aurel - 08-20-2023, 09:51 PM
RE: micro(A)v11 - by aurel - 08-25-2023, 01:47 PM
RE: micro(A)v11 - by aurel - 08-30-2023, 08:24 PM
RE: micro(A)v11 - by mnrvovrfc - 08-30-2023, 08:36 PM
RE: micro(A)v11 - by TerryRitchie - 08-30-2023, 09:18 PM
RE: micro(A)v11 - by aurel - 08-30-2023, 09:20 PM
RE: micro(A)v11 - by aurel - 08-31-2023, 07:40 PM
RE: micro(A)v11 - by aurel - 08-31-2023, 08:13 PM
RE: micro(A)v11 - by bplus - 08-31-2023, 09:14 PM



Users browsing this thread: 39 Guest(s)