News:

Function Finder  Find all the functions within source code files

Main Menu

rocket and ufo

Started by stef, November 18, 2005, 06:20:13 PM

Previous topic - Next topic

stef

Hi!

That's just an experimental design-study I made for an upcoming project named "Blue Monday".



; PROJECT : rocket and ufo
; AUTHOR  : stef
; CREATED : 12.11.2005
; EDITED  : 19.11.2005
; ---------------------------------------------------------------------

;experimental design/gametech-demo
;rocketpropulsion and ufo-lights are realtime calculated
;(this tech could be time-critical in real gamesituation!)



Dim sinus#(360)

For angle= 0 To 359
sinus#(angle) = Sin(angle)
Next

Dim cosinus#(360)

For angle= 0 To 359
cosinus#(angle) = Cos(angle)
Next

ufoxpos = 0
rot =0
relation =8
propw= 7
proph= relation * propw
factor =8
sizebox=3



bl =1

OpenScreen 800,600,32,2




Gosub ufodraw
Gosub rocketdraw
Gosub propdraw
Do

Gosub ufolightdraw
Gosub propulsion




RenderToScreen
Cls RGB(0,0,25)




ufoxpos = ufoxpos + 1
If ufoxpos > 800 Then ufoxpos =0
PositionSprite ufosp,ufoxpos,200
DrawSprite ufosp
DrawImage ufolit,ufoxpos,277,2


RotateSprite rocketsp, 90
PositionSprite rocketsp,  ufoxpos-100, 280
DrawSprite rocketsp


RotateSprite propsp, 90
PositionSprite propsp, ufoxpos-100, 280
DrawSprite propsp

Print FPS()


Sync

DeleteImage prop

DeleteImage ufolit

rotar = rotar + 1
If rotar = 360 Then rotar = 0




Loop







ufodraw:
ufo = GetFreeImage()
CreateImage ufo, 80,80
RenderToImage ufo

EllipseC 40,38,22,14,1,RGB(50,200,200)
EllipseC 40,40,42,10,1,RGB (50,80,70)
For e =1 To 20
EllipseC 40+2*e,40,40-2*e,10-e/2,1,RGB (50+3*e,130+3*e,70+3*e)
Next
BoxC 1,39,79,43,1,RGB(50,60,60)


BoxC 40, 27, 49, 31,1, RGB(150,200,200)
BoxC 40, 50, 45, 52,1, RGB(200,200,200)

LightImage ufo, 60, 40,200, 2.0

ufosp=GetFreeSprite()
CreateSprite ufosp
SpriteImage ufosp,ufo
SpriteDrawMode ufosp,0
SpriteHandle ufosp, 0,39

Return


ufolightdraw:

ufolit= GetFreeImage()
CreateImage ufolit, 80,5
RenderToImage ufolit

For wink= 90 To 269 Step 30
CircleC 40+(Sinus#(wink+rot)*40) ,2,3,1,RGB(150-wink,50+wink,250-wink)

Next

rot =rot+1
If rot= 30 Then rot =0

Return



rocketdraw:

rocket =GetFreeImage()
CreateImage rocket, 10,36
RenderToImage rocket
BoxC 0,20,9,28,1,RGB(80,80,80)
BoxC 1,18,8,29,1,RGB(80,80,80)
For rocside= 0 To 4
LineC 4,0,rocside+2,10,RGB (150, 0,0)
LineC rocside+2,11,rocside+2,31,RGB (80, 80+rocside*10,80+rocside*20)
LineC 4,30,rocside+2,36,RGB (100, 50+rocside*20,50+rocside*20)

Next
BoxC 2,9,7,11,1,RGB(100,100,50)
LineC 4,18,4,29,RGB(60,60,60)

PrepareFXImage rocket
rocketsp=GetFreeSprite()
CreateSprite rocketsp
SpriteImage rocketsp,rocket
SpriteDrawMode rocketsp,2
SpriteHandle rocketsp, -4,-36


Return

propdraw:
propsp=GetFreeSprite()
CreateSprite propsp

Return

propulsion:

prop = GetFreeImage()
CreateImage prop, propw+1,proph+20
ImageMaskColour prop,RGB(0,0,0)

RenderToImage prop
BoxC 0,0,7,76,1,RGB(0,0,0)
total =  relation * propw
redux= 0
For x= 1 To relation+4

For number =0 To total/factor
xstart=RndRange(0+redux,propw-redux-sizebox)
 ystart=RndRange (0,propw*x-sizebox-2)
 
  BoxC xstart,ystart,xstart+sizebox,ystart+sizebox,1,RGB (255,RndRange (100,200),0)
 
 
 
Next

Next
PrepareFXImage prop
SpriteImage propsp,prop
SpriteDrawMode propsp,2
SpriteHandle propsp, -3,-1


Return




tomazmb

Hello,

Excellent demo.

Have a nice day,

Tomaz
My computer specification:

AMD Athlon 64 2800+
MB ASUS K8V Socket 754 VIA K8T800
SB Audigy 2
3 GB RAM DDR 400 MHz PQI
AGP NVIDIA GeForce 7600GT 256 MB-Club 3D
Windows XP Pro SP2
DirectX 9.0c

stef

Hi tomaz!

Thanks a lot!

Have a nice day too !

Greetings from Vienna
stef