i am creating a volcano which has a particle system but how do i attach the particle system to the volcano sprite
the volcano is sprite 140 and the particle system is no 2.
the full media is at
http://homepage.ntlworld.com/j.power40/html/mega.zip
`/////////////////////Set up the screen ressolution //////////////
`/////////////////////////////////////////////////////////////////
rem check for screen res
if check display mode(640,480,32)=1
set display mode 640,480,32
else
set display mode 640,480,16
endif
sync on
sync rate 30
color backdrop 0
hide mouse
`********************************************************************
`***************************Load in all the graphics*****************
`********************************************************************
load image "gfx\craft\craft4.bmp",1
load image "gfx\alien\alienship.bmp",2
load image "gfx\craft\greenlazer.bmp",5
load image "gfx\craft\bullet.bmp",4
load image "gfx\exp\exp1.bmp",6
load image "gfx\exp\exp2.bmp",7
load image "gfx\exp\exp3.bmp",8
load image "gfx\exp\exp4.bmp",9
load image "gfx\exp\exp5.bmp",10
load image "gfx\exp\exp6.bmp",11
load image "gfx\effects\exh.bmp",12
`**********images for level one floor**
load image "gfx\level1\f1.bmp",13
load image "gfx\level1\f2.bmp",14
load image "gfx\level1\f3.bmp",15
load image "gfx\level1\f4.bmp",17
load image "gfx\level1\f5.bmp",18
load image "gfx\level1\f6.bmp",19
load image "gfx\level1\f7.bmp",20
load image "gfx\level1\f8.bmp",21
load image "gfx\level1\f9.bmp",22
load image "gfx\level1\f10.bmp",23
load image "gfx\level1\f11.bmp",24
load image "gfx\level1\f12.bmp",25
load image "gfx\level1\f13.bmp",26
load image "gfx\level1\f14.bmp",27
load image "gfx\level1\f15.bmp",28
load image "gfx\level1\f16.bmp",29
load image "gfx\level1\f17.bmp",30
load image "gfx\level1\f18.bmp",31
load image "gfx\level1\f19.bmp",32
load image "gfx\level1\f20.bmp",33
load image "gfx\level1\f21.bmp",34
load image "gfx\level1\f22.bmp",35
load image "gfx\level1\f23.bmp",36
`**********images for level two floor***
load image "gfx\level2\f24.bmp",37
load image "gfx\level2\f25.bmp",38
load image "gfx\level2\f26.bmp",39
load image "gfx\level2\f27.bmp",40
load image "gfx\level2\f28.bmp",41
load image "gfx\level2\f29.bmp",42
load image "gfx\level2\f30.bmp",43
load image "gfx\level2\f31.bmp",44
load image "gfx\level2\f32.bmp",45
load image "gfx\level2\f33.bmp",46
load image "gfx\level2\f34.bmp",47
load image "gfx\level2\f35.bmp",48
load image "gfx\level2\f36.bmp",49
load image "gfx\level2\f37.bmp",50
load image "gfx\level2\f38.bmp",51
load image "gfx\level2\f39.bmp",52
load image "gfx\level2\f40.bmp",53
load image "gfx\level2\f41.bmp",54
load image "gfx\level2\f42.bmp",55
load image "gfx\level2\f43.bmp",56
load image "gfx\level2\f44.bmp",57
load image "gfx\level2\f45.bmp",58
load image "gfx\level2\f46.bmp",59
load image "gfx\level2\f47.bmp",60
load image "gfx\level2\f48.bmp",61
load image "gfx\level2\f49.bmp",62
load image "gfx\level2\f50.bmp",63
load image "gfx\level2\f51.bmp",64
load image "gfx\level2\f52.bmp",65
load image "gfx\level2\f53.bmp",66
`**********images for level three floor**
load image "gfx\level3\f61.bmp",67
load image "gfx\level3\f62.bmp",68
load image "gfx\level3\f63.bmp",69
load image "gfx\level3\f64.bmp",70
load image "gfx\level3\f65.bmp",71
load image "gfx\level3\f66.bmp",72
load image "gfx\level3\end.bmp",73
`**********images for level two roof***
load image "gfx\level2\f54.bmp",74
load image "gfx\level2\f55.bmp",75
load image "gfx\level2\f56.bmp",76
load image "gfx\level2\f57.bmp",77
load image "gfx\level2\f58.bmp",78
load image "gfx\level2\f59.bmp",79
load image "gfx\level2\f60.bmp",80
` *********effects
load image "gfx\effects\mountain2.bmp",81
load image "gfx\effects\3.jpg",82
load image "gfx\effects\4.jpg",83
` ********* enemy
load image "gfx\alien\misile1.bmp",84
load image "gfx\alien\tank2.bmp",85
load image "gfx\alien\dragon.bmp",86
load image "gfx\effects\rock.bmp",89
` ********* powerups
load image "gfx\powerup\fuel.bmp",87
load image "gfx\powerup\weaponup.bmp",88
`**********images for the screen
load image "gfx\craft\score.bmp",198
load image "gfx\craft\life1.bmp",199
load image "gfx\screen\stars.bmp",200
load image "gfx\screen\title.bmp",201
load image "gfx\screen\Level_1_Mark.bmp",202
load image "gfx\screen\Level_2_Mark.bmp",203
load image "gfx\screen\Level_3_Mark.bmp",204
load image "gfx\screen\Level_Change.bmp",205
load image "gfx\screen\ready.bmp",206
`********************************************************************
`***************************Load in all the Sounds*******************
`********************************************************************
LOAD SOUND "sounds\phaser03.wav",1
LOAD SOUND "sounds\boom2.wav",2
LOAD MUSIC "sounds\space.wav",3
play music 3
loop music 3
`********************************************************************
`***************************Setup a 3D plain for stars***************
`********************************************************************
MAKE OBJECT PLAIN 4,600,56
ghost object on 4
POSITION OBJECT 4,0,-4,80
TEXTURE OBJECT 4,200
LOCK OBJECT ON 4
color backdrop rgb(0,0,0)
`********************************************************************
`***************************Variable List****************************
`********************************************************************
` ***********Set the weapon fired
pf=0
` ***********Score
score=0
`************Fuel
fuel#=100.0
` ***********Lives
lives=3
` ***********Spacseship co-ordinates
craftx=50
crafty=200
sbu=0
` ***********Number of Explosions
noe=6:gs=0
` ***********Constant
Player_Craft=1
` ***********Set timer variables
StartTime = TIMER()
FrameCount = 0
FrameTime = TIMER()
FrameRate$ = ""
`********************************************************************************************
`***************************Setup the Walls**************************************************
`********************************************************************************************
`Here a Loop sets up the wall tiles so that they do not over lap when
`they are placed on screen.
`*************Setup the floor tiles
bs=10
`set the start off tile onscreen
x=-200
y=320
`loop for tile 1 to 77
for t=1 to 77
read im
`*************First level floor
if im<=74 then x=x+112
if im=13 or im=14 or im=15 or im=16 or im=17 or im=18 or im=19 or im=20 then x=x:y=y-79
if im=21 or im=22 or im=23 or im=24 or im=25 or im=26 or im=27 or im=28 then x=x:y=y-79
if im=29 or im=30 or im=31 or im=32 or im=33 or im=34 or im=35 or im=36 then x=x:y=y-79
`**************Second level floor
if im=37 or im=38 or im=39 or im=40 or im=41 or im=42 or im=43 or im=44 then y=y-137
if im=45 or im=46 or im=47 or im=48 or im=49 or im=50 or im=51 or im=52 then y=y-137
if im=53 or im=54 or im=55 or im=56 or im=57 or im=58 or im=59 or im=60 then y=y-137
if im=61 or im=62 or im=63 or im=64 or im=65 or im=66 then y=y-137
`**************Third level floor
if im=67 or im=68 or im=69 or im=70 or im=71 then y=y-137
sprite bs,x,y,im
bs=bs+1:y=320
next t
`*************Setup the roof tiles
bs=10
x=200
y=92
`loop for tile 0 to 20
for t=0 to 200
read im
`*************Level two roof
if im<82 then x=x+112
`if im=67 or im=68 then x=x+2
`sprite bs,x,y,im
bs=bs+1:y=92
next t
` //////////////////////////////////////////////////////////////////////////////////////////
` /////////////////////////////////////////Position objets on screen ///////////////////////
` //////////////////////////////////////////////////////////////////////////////////////////
`***************************************************************************************
`*************Setup ship and player ready***********************************************
`***************************************************************************************
` ************************** load the lives on the Screen
sprite 1005,50,440,199
sprite 1006,70,440,199
sprite 1007,90,440,199
` ************************** Position craft to enter the screen
craftx=-50:crafty=200
for t=1 to 100
sprite Player_Craft,craftx,crafty,Player_Craft
craftx=craftx+1
gosub movestars
sync
next t
delete sprite 1007
` *************************** call SubRoutines
gosub exhaust
gosub volcanoe
gosub fuel
` 000000000000000000000000000000000000000000000000000000000000000000000000000
` 00000000000000000000000000 Load the scrolling images 0000000000000000000000
` **************************** Place the 3 Invisiable level flags to change level display
sprite 111,3080,60,205
HIDE SPRITE 111
sprite 112,6400,60,205
HIDE SPRITE 112
` *************************** position enemy misiles
sprite 113,570,252,84
sprite 114,630,252,84
sprite 115,690,252,84
sprite 116,750,252,84
sprite 117,1100,303,84
sprite 118,1040,303,84
sprite 119,1400,238,84
sprite 120,1500,238,84
sprite 121,1660,314,84
sprite 122,1790,278,84
sprite 123,1930,257,84
sprite 124,2050,257,84
sprite 125,2410,277,84
sprite 126,2480,290,84
sprite 127,2579,276,84
sprite 128,2590,276,84
` ***************************Place the Tanks on screen
sprite 130,7000,340,85
sprite 131,7800,340,85
sprite 132,7600,340,85
` ***************************Load the Volcanoe.bmp
sprite 140,6700,345,81
scale sprite 140,70
sprite 141,7300,345,81
scale sprite 141,70
sprite 142,8100,345,81
scale sprite 142,70
` ***************************Place the flocking enemy birds
`sprite 118,7000,90,86
`scale sprite 118,50
`sprite 119,7000,120,86
`scale sprite 119,50
`sprite 120,7000,150,86
`scale sprite 120,50
` ***************************Place the fuel and weapon powerups
`FUEL
sprite 221,820,242,87
sprite 222,1440,227,87
sprite 223,1990,280,87
sprite 224,2600,268,87
sprite 225,3050,227,87
sprite 226,3510,388,87
sprite 227,4040,365,87
sprite 228,4500,280,87
sprite 229,5000,335,87
sprite 230,5500,345,87
sprite 231,5960,363,87
sprite 232,6500,326,87
sprite 233,7190,350,87
sprite 234,7500,350,87
sprite 235,8000,350,87
`Weapon change
sprite 240,2205,301,88
sprite 241,2735,240,88
sprite 242,3600,272,88
sprite 243,4470,278,88
sprite 244,5210,282,88
sprite 255,6200,352,88
sprite 256,7160,352,88
sprite 257,7530,352,88
` End Wall
sprite 500,8520,90,73
`**************************** Place the Invisiable markers for misiles
sprite 150,400,60,205
`HIDE SPRITE 150
`sprite 1112,6400,60,205
`HIDE SPRITE 1112
` *************************** position partilce for volcanoe
`position particles 2,60,180,82
`position particles 3,100,120,83
`position particles 4,10,120,83
` *************************** position partilce for ship exhaust
`px=SPRITE X(1)-20
`py=SPRITE Y(1)+5
` position particles 1,px,py,82
` ***********Set the Lazer to fire from the ship
lazerx=SPRITE X(1)-20
lazery=SPRITE Y(1)+5
` 000000000000000000000000000000000000000000000000000000000000000000000000000
` 00000000000000000000000000 Load the static images to the screen 00000000000
` ***************************Load score.bmp
sprite 1000,480,420,198
` ***************************Load Title to the screen
sprite 1001,240,10,201
` ***************************Load The Level Display bar
sprite 1002,240,70,202
` this is the next sprite 1003,240,70,202 Used in the collision number functions
` this is the last sprite 1004,240,70,202 Used in the collision number functions
`*****************************
`/////////////////////////////////////////////////////////////////////////////////////////////
`//////////////// Start of Main Game Loop ////////////////////////////////////////////////////
`/////////////////////////////////////////////////////////////////////////////////////////////
do
IF TIMER() > StartTime + 10
TEXT 0,10,FrameRate$
` ********************Prints out score etc....
ink rgb(500,0,0),0
set cursor 490,440: Print "SCORE:";score
position camera 0,300,-500
fuel#=100.0
`**************************************************************
`************** KEY DIRECTION AND FIRE FUNCTIONS **************
`**************************************************************
REM Upkey to move space ship Up
if UPKEY()=1 and crafty>100
dec crafty,5
if fuel#<2.0 then crafty=-3.0
endif
REM Downkey to move space ship Down
if DOWNKEY()=1 and crafty<400
inc crafty,5
endif
REM Leftkey to move space ship Up
if LEFTKEY()=1 and craftx>10
dec craftx,5
endif
REM Rightkey to move space ship Down
if RIGHTKEY()=1 and craftx<400
inc craftx,5
endif
if inkey$()="z" and pf=0 then gosub shoot:pf=1
`*****************************************************************
`******************* COLLISION DETECTION *************************
`*****************************************************************
`****************** Collision between lazer and other objects
if SPRITE EXIST(2)=1
if SPRITE HIT(2,0)>1 then PLAY SOUND 2:sbu=1
endif
` ****************If the lazer hits an object blow it up
if sbu=1 then blowitup()
`******************* Collision between craft and invisible marker for level change
if SPRITE EXIST(Player_Craft)
Collision_Number=SPRITE COLLISION(Player_Craft,0)
if Collision_Number > 0
ship_collision(Collision_Number)
endif
endif`********************************************************************
`**************************Fire volcano******************************
`********************************************************************
volcanoe = SPRITE X(140)
if volcanoe<=400 and gs=0 then gosub shootrocks
gosub moverocks
`********************************************************************
`**************************Fire misiles******************************
`********************************************************************
if Collision_Number=150 then gosub movemisiles
`*****************************************************************
`******************** UPDATE OBJECTS *****************************
`*****************************************************************
`Just update your players sprite, stars and your lazer
`IF you fired it of cause.
sprite Player_Craft,craftx,crafty,Player_Craft
if sbu=0 then gosub moveall
StartTime = TIMER()
FrameCount = FrameCount + 1
ENDIF
IF TIMER() > FrameTime + 1000
FrameRate$ = "Frame rate = " + STR$(FrameCount)
FrameCount = 0
FrameTime = TIMER()
ENDIF
gosub movestars
gosub fuel
`********************************************
`Move all boundry sprites (For-Next loop)
`Deletes objects when they leave screen
`********************************************
for t=10 to 999
IF SPRITE EXIST(T)
bsx=SPRITE X(t)
bsy=SPRITE Y(t)
bsi=SPRITE IMAGE(t)
bsx=bsx-2
sprite t,bsx,bsy,bsi
if bsx<-200 then delete sprite t
ENDIF
next t
sync
loop
`////////////////////////////////////////////////////////////
`//////////////// End of Main Loop //////////////////////////
`////////////////////////////////////////////////////////////
`////////////////////////////////////////////////////////////
`//////////////// Start of Functions ////////////////////////
`////////////////////////////////////////////////////////////
`********************Collision Detection for Ship and flags for levels
FUNCTION ship_collision(Collision_Number)
if Collision_Number=111
change_level1()
EXITFUNCTION
else
if Collision_Number=112
change_level2()
EXITFUNCTION
endif
endif
ENDFUNCTION
`***************Change Level 1 Display
FUNCTION change_level1()
sprite 1003,240,70,203
ENDFUNCTION
`***************Change Level 2 Display
FUNCTION change_level2()
sprite 1004,240,70,204
ENDFUNCTION
`**************Cycle for the Explosions, check last exp 11 to loop.
FUNCTION blowitup()
sprite 2,lazerx,lazery,noe
if noe<11
inc noe
EXITFUNCTION
endif
if noe>=11
noe=6
lazerx=SPRITE X(1)+20
lazery=SPRITE Y(1)+10
sprite 2,640,ly,4
pf=0:sbu=0
EXITFUNCTION
endif
ENDFUNCTION
`////////////////////////////////////////////////////////////
`//////////////// End of Functions //////////////////////////
`////////////////////////////////////////////////////////////
`////////////////////////////////////////////////////////////
`//////////////// Start of GoSub Functions //////////////////
`////////////////////////////////////////////////////////////
`***************Scroll Stars
movestars:
SCROLL OBJECT TEXTURE 4,0.001,0.0
return
`***************Fire Lazer
shoot:
sprite 2,lazerx,lazery,4
PLAY SOUND 1
return
`******************************Volcanoe
volcanoe:
rem ************ Main volcanoe
make particles 2,82,100,40
set particle velocity 2,8
rem ************ Particle 3 Lava
make particles 3,83,100,40
set particle velocity 3,8
rem ************ Particle 4 Lava
make particles 4,83,100,40
set particle velocity 4,8
return
` ***************************Particles for the exhaust
exhaust:
`make particles 1,12,20,35.0
`rotate particles 1,0,0,90
`set particle velocity 1,10.0
`set particle life 1,5
return
` **************************** Fuel system
fuel:
set cursor 0,0 : print "FUEL"
if fuel#<20 then rr=255 else rr=0
box 32,2,38+((screen width()-16)/100)*fuel#,10,rgb(rr,100,100),rgb(rr,100,100),rgb(rr,255,255),rgb(rr,255,255)
rem Reduce fuel slowly
fuel#=fuel#-0.05 : if fuel#<0 then fuel#=0.0
return
`***************Move your lazer if its on screen
moveall:
if SPRITE EXIST(2)=1
if sprite X(2)<640
lazerx=lazerx+45
sprite 2,lazerx,lazery,4
endif
endif
if SPRITE EXIST(2)=1
if sprite X(2)>=640
pf=0
lazerx=SPRITE X(1)-20
lazery=SPRITE Y(1)+5
endif
endif
return
`**************Cycle for the Explosions, check last exp 11 to loop.
blowitup:
sprite 2,lazerx,lazery,noe
if noe<11
inc noe
return
endif
if noe>=11
noe=6
lazerx=SPRITE X(1)+20
lazery=SPRITE Y(1)+10
sprite 2,640,ly,4
pf=0:sbu=0
endif
return
` **************
shootrocks:
rsx=SPRITE X(140): rsy=SPRITE Y(140)
gs = 1
sprite 1010,rsx,rsy,89
return
` ***************
moverocks:
if SPRITE EXIST(140)=1
if SPRITE EXIST(141)=1
if SPRITE EXIST(142)=1
dec rsx,6:dec rsy,3
sprite 1010,rsx,rsy,89
endif
endif
endif
return
` *************** move the misile
movemisiles:
mmx=sprite x(113):mmy=sprite y(113)
if sprite exist (113)=1
dec mmx,0:dec mmy,3
endif
return
`////////////////////////////////////////////////////////////
`////////////////// End of GoSub Functions //////////////////
`////////////////////////////////////////////////////////////
`/////////////////////////////////////////////////////////////////////////////////////////////
`////////////////// Data Blocks to build layout///////////////////////////////////////////////
`/////////////////////////////////////////////////////////////////////////////////////////////
`**************level 1 floor
data 13,13,13,13,13,14,15,15,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36
`**************level 2 floor
data 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
data 67,68,69,70,71,69,70,70,70,70,70,70,70,70,70,71,69,70,70
`**************level 2 roof
data 74,75,76,77,78,79,78,79,78,79,78,79,78,79,78,79,78,79,78,79,78,79,80
`data
`data
` ////////////////////////////////////////////////////////////////////////////////////////////