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 82 83 84 85 86 87 88 89 90 91 92 93 94 95
|
<!DOCTYPE html>
<html lang="en" dir="ltr" class="no-js">
<head>
<meta charset="utf-8" />
<title>gamesballoons.kbs [BASIC 256 - Language Documentation]</title>
<link rel="stylesheet" type="text/css" href="lib/exe/cssc171c1dfe8519125bb40a349172b001a.css"/>
</head>
<body>
<div id="dokuwiki__site"><div id="dokuwiki__top" class="site dokuwiki mode_show tpl_dokuwiki ">
<div id="dokuwiki__header"><div class="pad group">
<div class="headings group">
<h1><a href="start.html" accesskey="h" title="[H]"><img src="lib/tpl/dokuwiki/images/logo.png" width="64" height="64" alt="" /> <span>BASIC 256 - Language Documentation</span></a></h1>
</div>
</div>
<div class="breadcrumbs">
<div class="youarehere"><span class="bchead">You are here: </span><span class="home"><bdi><a href="start.html" class="wikilink1" title="start">start</a></bdi></span> » <bdi><span class="curid"><a href="gamesballoons.kbs.html" class="wikilink1" title="gamesballoons.kbs">gamesballoons.kbs</a></span></bdi></div>
</div>
<hr class="a11y" />
</div></div>
<div class="wrapper group">
<div id="dokuwiki__content"><div class="pad group">
<div class="pageId"><span>gamesballoons.kbs</span></div>
<div class="page group">
<p>
<a href="http://doc.basic256.org/lib/exe/detail.php?id=gamesballoons.kbs&media=gamesballoons.png" class="media" title="gamesballoons.png"><img src="lib/exe/gamesballoons.png" class="media" alt="" /></a>
Fill the sky with animated semi-transparent balloons. Requires BASIC-256 0.9.9.28 or higher.<br/>
</p>
<pre class="code"># gamesballons.kbs by: lrcvs, UglyMike
# 2013-01-07
# updated version with transparent baloons for 0-9-9.28
CLG
PX = 800
PY = 700
GRAPHSIZE PX, PY
BALLONS = 200 #BALLONS
R = 20 # RADIO
DIM P (BALLONS,7)
FOR V = 0 TO BALLONS - 1
P[V,0] = PX/2 # INIT POSITION X
P[V,1] = PY + (RAND * 100) + 1 # INIT POSITION Y
P[V,3] = R / 20 # SPEED Y
P[V,6] = RAND * 256 # Transparency value
P[V,4] = rgb(RAND * 256,RAND * 256,RAND * 256, P[V,6]) # ARGB COLOR
P[V,5] = R # RADIO
R = R - 1
IF R = 2 THEN R = 20
P[V,2] = ((((RAND ) * 2)-1)*P[V,5])/20
#if V % 2 = 0 then P[V,2] = (((RAND ) * -1)*P[V,5])/20 #SPEED -X
#if V % 2 <> 0 then P[V,2] = ((RAND )*P[V,5])/20 # SPEED +X
NEXT V
k=1
FASTGRAPHICS
print "Press any key to stop"
while key = 0
COLOR rgb(0,0,0)
#:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
#Options:
#COLOR rgb(0,0,0) # <<< 1) With black color background , the color contrast is very greater.
#COLOR rgb(255,255,255) # <<< 2) With white color background, the transparency is perfect!!!, (in some balloons you see only sticks).
#COLOR rgb(50,100,255) # <<< nice blue sky
#:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
RECT 0,0,PX,PY
FOR N = 0 TO V - 1
if ((P[N,0] + P[N,2]) < PX) and ((P[N,0] + P[N,2]) > 0) then
P[N,0] = P[N,0] + P[N,2]
else
P[N,2]=-P[N,2]
P[N,0] = P[N,0] + P[N,2]
endif
P[N,1] = P[N,1] - P[N,3]
COLOR P[N,4]
CIRCLE P[N,0],P[N,1],P[N,5]
poly {P[N,0], P[N,1]+P[N,5] ,P[N,0]+P[N,5]/4 ,P[N,1]+P[N,5]+P[N,5]/3, P[N,0]-P[N,5]/4, P[N,1]+P[N,5]+P[N,5]/3}
spec= int(P[N,5]/4)
color grey
line P[N,0],P[N,1]+P[N,5]+P[N,5]/3,P[N,0],P[N,1] + 4*P[N,5] # <<<<<< New line!
color rgb(255,255,255,P[N,6])
circle(P[N,0]-1.5*spec),(P[N,1]-1.5*spec), spec
if P[N,1] < (-100) THEN P[N,1] = PY + (RAND * 100) + 1
NEXT N
REFRESH
end while
END</pre>
</div>
<div class="docInfo"><bdi>gamesballoons.kbs.txt</bdi> · Last modified: 2013/01/07 17:34 by <bdi>admin</bdi></div>
</div></div>
<hr class="a11y" />
</div>
<div id="dokuwiki__footer"><div class="pad">
<div class="license">Except where otherwise noted, content on this wiki is licensed under the following license: <bdi><a href="http://creativecommons.org/licenses/by-sa/3.0/" rel="license" class="urlextern">CC Attribution-Share Alike 3.0 Unported</a></bdi></div>
</div></div>
</div></div>
<div id="screen__mode" class="no"></div>
</body>
</html>
|