FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
smallbasic.github.io/samples/node/1350.bas at master · smallbasic/smallbasic.github.io · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
smallbasic
/
smallbasic.github.io
Public
Notifications
You must be signed in to change notification settings
Fork
4
Star
4
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
smallbasic.github.io
/
samples
/
node
/
1350.bas
Copy path
More file actions
More file actions
Latest commit
History
History
History
81 lines (76 loc) · 2.65 KB
Breadcrumbs
smallbasic.github.io
/
samples
/
node
/
1350.bas
Copy path
File metadata and controls
81 lines (76 loc) · 2.65 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
'
fireworks 3.bas SmallBASIC 0.12.2 [B+=MGA] 2015-05-09
'
fireworks 2.bas 2016-05-05 now with Gravity, Newtonian bounce, smoke debris
'
fireworks 3.bas try with map variables make bursts around a central point
flare_max
=
300
:
debris_max
=
5000
:
debris_stack
=
0
dim
flare
(
flare_max
)
dim
debris
(
debris_max
)
sub
NewDebris
(
i
)
local c
debris
(
i
).
x
=
rnd
* xmax
debris
(
i
).
y
=
rnd
* ymax
c
=
rnd
*
255
debris
(
i
).
c
=
rgb
(
c
,
c
,
c
)
end
while
1
rnd_cycle
=
rnd
*
30
loop_count
=
0
burst.
x
= .
75
* xmax *
rnd
+ .
125
* xmax
burst.
y
= .
5
* ymax *
rnd
+.
125
* ymax
repeat
cls
'
color 14 : locate 0,0: ? debris_stack; " Debris" 'debug line
for
i
=
1
to
20
'
new burst using random old flames to sim burnout
nxt
=
rnd
*
flare_max
+
1
angle
=
rnd
*
2
* pi
flare
(
nxt
).
x
= burst.
x
+
rnd
*
5
*
cos
(
angle
)
flare
(
nxt
).
y
= burst.
y
+
rnd
*
5
*
sin
(
angle
)
angle
=
rnd
*
2
* pi
flare
(
nxt
).
dx
=
rnd
*
15
*
cos
(
angle
)
flare
(
nxt
).
dy
=
rnd
*
15
*
sin
(
angle
)
rc
=
int
(
rnd
*
3
)
if
rc
=
0
then
'
flare(nxt).c = 12 'patriotic theme
flare
(
nxt
).
c
=
rgb
(
255
,
rnd
*
255
,
0
)
elseif
rc
=
1
'
flare(nxt).c = 9 'patriotic theme
flare
(
nxt
).
c
=
rgb
(
100
+
rnd
*
155
,
100
+
rnd
*
155
,
220
)
else
flare
(
nxt
).
c
=
15
endif
next
for
i
=
0
to
flare_max
if
flare
(
i
).dy
then
'
while still moving vertically
line
flare
(
i
).x,
flare
(
i
).y
step
flare
(
i
).dx,
flare
(
i
).dy,
rgb
(
98
,
98
,
98
)
circle
step
flare
(
i
).dx,
flare
(
i
).dy,
1
,
1
,
flare
(
i
).c filled
flare
(
i
).
x
+=
flare
(
i
).dx
flare
(
i
).
y
+=
flare
(
i
).dy
flare
(
i
).
dy
+= .
4
'
add gravity
flare
(
i
).dx *= .
99
'
add some air resistance
if
flare
(
i
).
x
<
0
or
flare
(
i
).
x
>
xmax
then
flare
(
i
).
dy
=
0
'
outside of screen
'
add some spark bouncing here
if
flare
(
i
).
y
>
ymax
then
if
abs
(
flare
(
i
).
dy
) > .
5
then
flare
(
i
).
y
=
ymax
:
flare
(
i
).dy *= -.
25
else
flare
(
i
).
dy
=
0
fi
fi
fi
next
for
i
=
0
to
debris_stack
pset
debris
(
i
).x,
debris
(
i
).y,
debris
(
i
).c
debris
(
i
).
x
+=
rnd
*
3
-
1.5
debris
(
i
).
y
+=
rnd
*
3.5
-
1.5
if
debris
(
i
).
x
<
0
or
debris
(
i
).
y
<
0
or
debris
(
i
).
x
>
xmax
or
debris
(
i
).
y
>
ymax
then
NewDebris
(
i
)
next
showpage
delay
2
loop_count
+=
1
until
loop_count
>
rnd_cycle
if
debris_stack
<
debris_max
then
for
i
=
1
to
20
NewDebris
i
+
debris_stack
next
debris_stack
+=
20
fi
wend
Back
|
FazBrowse Home
|
New Git URL