RetroBASIC
Retrogamecoding(.org) => Examples => Topic started by: Peter on November 16, 2012, 01:33:30 PM
-
Hi,
Do you love it?
I know, there is a built in RAD function of Lua!
function Sprite(id,x,y,w,h,fx)
drawimage(w*fx,0,w,h,x,y,id)
end
function Rand(minZahl,maxZahl)
maxZahl= (maxZahl-minZahl)
return int(rnd()*maxZahl+minZahl)
end
function Radians(winkel)
return winkel*math.pi/180
end
screen(640,480,0,"Banana Ghost")
setframetimer(28)
backcolor(0,0,0)
colorkey(0,0,0)
headX=0; headY=0; mask=0; cells=3000; i=0
mask =loadimage("ghost/maske2.png")
px={}
py={}
radX={}
radY={}
angle={}
frequency={}
for i=1,cells do
px[i]=0
py[i]=0
radX[i]=0
radY[i]=0
angle[i]=0
frequency[i]=0
end
headX = screenwidth() /2
headY = screenheight()/2
for i=1,cells do
radX[i]=Rand(-7, 7)
radY[i]=Rand(-4, 4)
frequency[i]=Rand(-9, 9)
end
repeat
k=getkey()
cls()
for i=1,cells do
if i==1 then
px[i]=headX+sin(angle[i])*radX[i]
py[i]=headY+cos(angle[i])*radY[i]
else
px[i]=px[i-1]+cos(angle[i])*radX[i]
py[i]=py[i-1]+sin(angle[i])*radY[i]
end
Sprite(mask,px[i],py[i],64,64,0)
angle[i]=angle[i] + Radians(frequency[i])
end
sync()
until k==27
closewindow()
-
It's really awesome what can be done with a few lines of code ...
-
Fantastic!
It reminds me of Ghostbuster
:D
-
Who you gonna call? ;D
-
Nice, but I have a few questions:
1. Why the topic's title is "My friend"?
2. What are we supposed to love?
3. Is the person we're gonna call... Aurel? ;)
Sorry, but this is a little bit surreal for me. ;D
-
Hi Tomaaz,
My friend is "My friend"
Love means: Do you you like it?
No, Aurel is another thing.
-
My friend is "My friend"
Now everything is clear, but you should have said it earlier. :)
Love means: Do you you like it?
I know what that sentence means. I'm just not sure if we supposed to love your program, the thing on the screen or your friend (in case your friend is not the thing on the screen). :)
No, Aurel is another thing.
Do you mean... an alien!? :o
-
Hi Tomaaz,
understand it, is my fantasy.
an Alien, I have never seen an Alien.