Accueil > > > MISSION PLUTO 2.0 CLONE DE SPACE INVADERS
MISSION PLUTO 2.0 CLONE DE SPACE INVADERS
Information sur la source
Description
Ce jeu a ete programe par moi en blitz basic (http:\\www.blitzbasic.com) c'est un clone de space invaders avec des powerups,missile, aliens et des boss. Ne soyez pas trop dur avec moi car c'est ma 1ere source mais si vous trouvez que vous devez me critiquer n'ayez pas peur. Si vous voulez compiler le jeu aller sur le site de blitz basic (http:\\www.blitzbasic.com)et telecharge BlitzPlus ou Blitz3D.
Source
- ; /----------------------------------------\
- ; | |
- ; | Mission: Pluto 2.0.1 |
- ; | Georges |
- ; | Revised 15/04/06 ____________________|
- ; |___________________|georges023@gmail.com|
- Graphics 640, 480, 16, 1
- AppTitle "Mission: Pluto 2.0 by Georges"
- SetBuffer BackBuffer()
- SeedRnd MilliSecs()
-
- ; * GFX *
- ;mets les images su jeu en memoire
- Global Ships = LoadAnimImage("player2v1.jpg", 30, 37, 0, 7): MaskImage Ships, 0, 0, 0
- Global Enemy = LoadAnimImage("Enemy.jpg", 40, 45, 0, 3): MaskImage Enemy, 0, 0, 0
- Global Enemy2 = LoadAnimImage("ships.jpg", 24, 28, 0, 1): MaskImage Enemy2, 0, 0, 0
- Global Enemy3 = LoadAnimImage("ships2.JPG", 68, 63, 0, 3): MaskImage Enemy3, 0, 0, 0
- Global Power = LoadAnimImage("Powerups.jpg", 30, 38, 0, 4): MaskImage Power, 0, 0, 0
- Global Boss = LoadAnimImage("boss.JPG", 158, 136, 0, 3): MaskImage Boss, 255, 0, 255
- Global Asteroids = LoadAnimImage("Asteroids.bmp", 32 ,28, 0, 5): MaskImage Asteroids, 255, 0, 255
- Global Explode = LoadAnimImage("explode.jpg", 32, 32, 0, 19)
- Global Shots = LoadAnimImage("Shots 2.bmp",7, 12, 0, 3): MaskImage Shots, 255, 0, 255
- Global EShots = LoadAnimImage("EShots.jpg", 30, 19, 0, 3): MaskImage EShots, 0, 0, 0
- Global Orb = LoadAnimImage("Orb.jpg", 64, 64, 0, 2)
- Global Logo = LoadImage("Logo.jpg"): MaskImage Logo, 0, 0, 0
- Global Laser1 = LoadImage("laser.jpg")
-
- splashscreenimage = LoadImage("splashscreen.jpg"):MaskImage splashscreenimage, 0, 0, 0 ;the splash screen
- Global font_one=LoadFont( "Halo",20 )
-
-
-
-
-
-
- ; * SFX *
- ;mets les sons en memoire
- Global Shot1SFX = LoadSound("bomb.wav")
- Global Shot5SFX = LoadSound("shot5.wav")
- Global DiveSFX = LoadSound("Dive.wav")
- Global ExploSFX = LoadSound("Explode.wav")
- Global PowerSFX = LoadSound("Power.wav")
- Global PulseSFX = LoadSound("Pulse.wav")
- Global LaserSFX = LoadSound("Laser.wav")
- Global explosionsound = LoadSound("explode.wav")
- Global bulletsound = LoadSound("zing.wav")
- Global Laser1SFX = LoadSound("Zing.wav")
-
- ;Music
- ;Joue la musique du fond
- backgroundmusic = PlayMusic ("Mars.mp3")
-
- Global mapwidth,mapheight,maposx,maposy,space
-
-
-
-
- ; * Vars *
- .Reset
- FlushKeys()
- Global EFrame = 0, EFMax = 3, AW = 32, AH = 30
- mapwidth=32:mapheight=32:space=33
- Global P1X, P1Y, P1Score = 0 ; Player 1
- Global FPS = 0, Frames = 0, Time# = MilliSecs() + 1 ; FPS Counter
- Global BulletTime = MilliSecs()
- Global AnimTimer = MilliSecs(), MainTimer = MilliSecs()
- Global AlienNum = 30, AX = 32, AY = 32, AType = 1, Amax = 1, ADir = 0, I, ADive = 0, DiveMax = 1
- Global Level = 30, Weap = 1, WeapFrame = 0, EWeapFrame = 0
- Global P1Lives = 6, PlayerHit = 0, JustRun = 1
- Global Line1$, Line2, Line3$, Line4, Line5$, Line6, Line7$, Line8, Line9$, Line10
- Global Difficulty = 990, Diff2 = 100
- Global EType = 1, AKill = 0, BlastTimer = MilliSecs(), BTR = 1750, BFlag = 0, LaserTime = MilliSecs()
- Global TempM, LSF = 0, DFlag1 = 0, DFlag2 = 0, DFlag3 = 0
-
-
- ;dimension map And score table
-
- Dim map(mapwidth,mapheight)
-
- Type Stars
- Field X
- Field Y
- Field C
- Field S
- Field T
- Field F
- End Type
-
- Type players ; you the hero
- Field x,y,sx,sy,dx,dy,frame,image,dest,dir,speed,bored,state
- End Type
-
- Type flys ; fireflys and butterflys
- Field x,y,sx,sy,dx,dy,sort,frame,image,dest,dir,speed,state
- End Type
- ;
- Type objects ; boulders and diamonds ect ect
- Field x,y,sx,sy,dx,dy,frame,image,dest,dir,speed,sparkle#,state
- End Type
- ;
- Type explosions ; explosions
- Field x,y,sx,sy,frame,image,speed
- End Type
-
- Type Bullet
- Field X
- Field Y
- Field T
- End Type
-
- Type EParticle
- Field X
- Field Y
- Field L
- End Type
-
- Type Alien
- Field X
- Field Y
- Field T
- Field S
- Field D
- Field ID
- Field Dive
- End Type
-
- Type Explosion
- Field X
- Field Y
- Field F
- Field T
- End Type
-
- Type PowerUp
- Field X
- Field Y
- Field S
- Field T
- End Type
-
- Type Boss1
- Field X
- Field Y
- Field S
- Field L
- Field D
- Field F
- End Type
-
- Type Bull
- Field X
- Field Y
- Field A
- Field D
- Field F
- Field T
- Field K
- End Type
-
-
-
- level = 1
-
- DrawImage(splashscreenimage, 165, 180)
- Flip
- Delay 3000
-
-
-
-
-
-
-
-
- Font = LoadFont("halo", 14, False, False, False)
- SetFont Font
-
- For h.Boss1 = Each Boss1
- Delete H
- Next
-
- .Level
- LSF = 1
- For b.Bullet = Each Bullet
- Delete b
- Next
- For e.EParticle = Each EParticle
- Delete E
- Next
- For a.Alien = Each Alien
- Delete A
- Next
-
- For bb.Bull = Each Bull
- Delete BB
- Next
-
- If Level = 7 And DFlag1 = 0 Then DiveMax = DiveMax + 1: DFlag1 = 1
- If Level = 14 And DFlag2 = 0 Then DiveMax = DiveMax + 1: DFlag2 = 1
- If Level = 21 And DFlag3 = 0 Then DiveMax = DiveMax + 1: DFlag3 = 1
-
- TempX = 255: TempY = 0
- While Not KeyHit(28)
- Cls
-
- Repeat
- Until MilliSecs()-MainTimer>=13
-
- CStars()
- RStars()
- RExplo()
- RPower()
-
- If Level > 9 Then ; Set 2
- EType = 2: EFrame = 0: EFMax = 4: AW = 32: AH = 44
- EndIf
-
- If Level > 19 Then ; Set 3
- EType = 3: EFrame = 0: EFMax = 3: AW = 32: AH = 30
- EndIf
-
- If JustRun = 1 Then DrawImage Logo, 165, 180: DisplayHiScores()
- AlienNum = 30
- If Diff2 <= 8 Then Diff2 = 8
- AX = 32
- AY = 32
- AMax = 1
- ADir = 0
- ADive = 0
- P1X = 320 - 24
- P1Y = 480 - 80
- If Level <> 10 And Level <> 20 And Level <> 30 Then AKill = 0
- PlayerHit = 0
- Color TempX, TempX, TempX
- If KeyHit(70) Then P1Lives = 3: PlaySound PowerSFX
- If KeyHit(1) Then End
- If JustRun = 0 And Level <> 10 And Level <> 20 And Level <> 30 And Level <> 15 Then Text 297, 230, "Dimension " +" "+ Level
- If Level = 10 Or Level = 20 Or Level = 30 Then Text 273, 230, "Kuiper BELT"
- If Level = 15 Then Text 305, 230, "Master"
- If TempY = 0 Then TempX = TempX - 5
- If TempY = 1 Then TempX = TempX + 5
- If TempX <= 5 Then TempY = 1
- If TempX >= 250 Then TempY = 0
- Flip
- Wend
-
- JustRun = 0
-
- If Level = 10 Or Level = 20 Or Level = 30 Then Goto Main ; Asteroid Belt
- If Level = 15 Then
- If BFlag = 0 Then CBoss(): BFlag = 1
- Goto Main ; Boss
- EndIf
-
- For I = 1 To AlienNum
- CAlien()
- AX = AX + 48
- If I = 10 Then AY = AY + 48: AX = 32
- If I = 20 Then AY = AY + 48: AX = 32
- Next
- .Main
- MainTimer = MilliSecs()
- LSF = 0
-
- While Not KeyHit(1)
- Cls
-
- Repeat
- Until MilliSecs()-MainTimer>=13
- MainTimer = MilliSecs()
-
- CStars()
- CEngine()
- frames=frames+1
-
- RStars()
- RBullet()
- REngine()
- RPower()
- RAlien()
- If Level = 15 Then RBoss(): RBBull()
- RExplo()
-
-
- DrawImage Ships, P1X, P1Y, 0
-
- If MilliSecs() >= Time Then FPS = Frames: Frames = 0: Time = Time + 1000
- Color 255, 255, 0
- ;Text 1, 1, "FPS: " + FPS
-
- Text 20, 456, "Score: " + P1Score
- Text 560, 456, "Lives: " + P1Lives
-
- If ADir = 0 Then Amax = AMax + 1
- If ADir = 1 Then Amax = Amax - 1
- If AMax > 70 Then ADir = 1
- If AMax < -15 Then ADir = 0
-
- If Weap = 1 Then WeapFrame = 0
- If Weap = 2 Then WeapFrame = 1
- If Weap = 3 Then WeapFrame = 2
- If EType = 2 Then EWeapFrame = 1
- If EType = 3 Then EWeapFrame = 2
-
- If ChannelPlaying(Channel) = 0 Then
- StopChannel Channel
- If TempM = 1 Then TempM = 2: Channel = PlayMusic("track2.mod"): Goto LeaveMusic
- If TempM = 2 Then TempM = 3: Channel = PlayMusic("track3.mod"): Goto LeaveMusic
- If TempM = 3 Then TempM = 4: Channel = PlayMusic("track4.mod"): Goto LeaveMusic
- If TempM = 4 Then TempM = 1: Channel = PlayMusic("track1.mod"): Goto LeaveMusic
- EndIf
-
- snnum = "1"
- If KeyHit(68)
- SaveBuffer(BackBuffer(), "screenshots\" + "screenshot"+ snnum +".bmp")
- EndIf
-
- snnum = snnum + "1"
- .LeaveMusic
- If AlienNum <= 0 Then Level = Level + 1: Difficulty = Difficulty + 90: Diff2 = Diff2 + 4: Goto Level
- If AKill >= 150 Then Level = Level - 1: Difficulty = Difficulty - 6: Diff2 = Diff2 - 4: Goto Level
- If PlayerHit = 1 Then
- P1Lives = P1Lives - 1
- Weap = 1
- PlaySound ExploSFX
- If P1Lives < 0 Then Goto GameOver
- Goto Level
- EndIf
-
- If KeyDown(203) Then P1X = P1X - 3
- If KeyDown(205) Then P1X = P1X + 3
- If KeyDown(200) Then P1Y = P1Y - 3
- If KeyDown(208) Then P1Y = P1Y + 3
-
- If KeyHit(57) And MilliSecs() >= BulletTime + 250 Then CBullet(Weap): PlaySound Shot1SFX
-
- If P1X <= 1 Then P1X = 2
- If P1X >= 614 Then P1X = 613
- If P1Y >= 427 Then P1Y = 426
- If P1Y <= 300 Then P1Y = 301
-
- Flip
- Wend
- End
-
-
-
-
-
- Function CStars()
- s.Stars = New Stars
- s\X = Rand(1, 640)
- s\Y = -29
- s\C = Rand(1, 4)
- s\S = Rand(1, 3)
- s\T = 0
-
- TempA = Rand(1, Diff2): TempB = Rand(1, Diff2)
- If TempA = TempB Then s\T = Rand(1, 4): s\S = Rand(2, 5): s\F = Rand(0, 4)
-
- If Level = 10 Or Level = 20 Or Level = 30 Then
- TempA = Rand(1, 2): TempB = Rand(1, 2)
- If TempA = TempB Then
- s\T = Rand(1, 4)
- s\F = Rand(0, 4)
- If Level = 10 Then s\S = Rand(3, 6)
- If Level = 20 Then s\S = Rand(4, 7)
- If Level = 30 Then s\S = Rand(5, 8)
- EndIf
- EndIf
- End Function
-
-
-
-
- Function CBullet(BType)
- If Btype = 1 Then
- b.Bullet = New Bullet
- b\X = P1X + 10
- b\Y = P1Y
- b\T = BType
- BulletTime = MilliSecs()
- EndIf
-
- If Btype = 2 Then
- b.Bullet = New Bullet
- b\X = P1X + 2
- b\Y = P1Y + 5
- b\T = 2
-
- b.Bullet = New Bullet
- b\X = P1X + 19
- b\Y = P1Y + 5
- b\T = 2
-
- BulletTime = MilliSecs()
- EndIf
-
- If BType = 3 Then
- b.Bullet = New Bullet
- b\X = P1X + 10
- b\Y = P1Y
- b\T = 1
-
-
- b.Bullet = New Bullet
- b\X = P1X + 3
- b\Y = P1Y + 5
- b\T = 3
-
- b.Bullet = New Bullet
- b\X = P1X + 18
- b\Y = P1Y + 5
- b\T = 3
- BulletTime = MilliSecs()
- EndIf
-
- If Btype = 5 Then
- b.Bullet = New Bullet
- For a.Alien = Each Alien
- If a\S = 1 Then
- b\X = a\X + 15
- b\Y = a\Y + 30
- b\T = BType
- a\S = 0
- EndIf
- Next
- EndIf
-
- End Function
-
- Function CBBull(BX, BY, Num)
- If Num = 1 Then
- bb.Bull = New Bull
- bb\X = BX
- bb\Y = BY
- bb\A = 0
- bb\K = 1
-
- bb.Bull = New Bull
- bb\X = BX
- bb\Y = BY
- bb\A = 1
- bb\K = 1
- bb.Bull = New Bull
- bb\X = BX
- bb\Y = BY
- bb\A = 2
- bb\K = 1
-
- bb\T = MilliSecs()
-
- EndIf
-
- If Num = 2 Then
- bb.Bull = New Bull
- bb\X = BX
- bb\Y = BY
- bb\K = 2
- EndIf
- End Function
-
- Function CEngine()
- e.EParticle = New EParticle
- TempY = Rand(1, 2)
- If TempY = 1 Then e\X = P1X + Rand(5, 9)
- If TempY = 2 Then e\X = P1X + Rand(14, 18)
- e\Y = P1Y + 27
- e\L = Rand(20, 30)
- End Function
-
- Function CAlien()
- a.Alien = New Alien
- a\X = AX
- a\Y = AY
- a\T = AType
- a\S = 0
- a\D = 0
- a\ID = I
- a\Dive = 0
- End Function
-
- Function CExplo(EX, EY)
- x.Explosion = New Explosion
- x\X = EX
- x\Y = EY
- x\F = 0
- x\T = MilliSecs()
- End Function
-
- Function CPower(PX, PY, PS)
- p.PowerUp = New PowerUp
- p\X = PX
- p\Y = PY
- p\S = PS
- TempA = Rand(1, 2): TempB = Rand(1, 2)
- If TempA = TempB Then p\T = 3 Else p\T = Rand(0, 1)
- End Function
-
-
- Function CBoss()
- h.Boss1 = New Boss1
- h\X = 640 /2 - 96 / 2
- h\Y = 25
- h\S = 0
- h\D = 1
- h\L = 200
- h\F = 0
- AnimTimer = MilliSecs()
- End Function
-
- Function RStars()
- For s.Stars = Each Stars
- s\Y = s\Y + s\S
-
- If s\T = 0 Then
- If s\C = 1 Then Color 255, 255, 255
- If s\C = 2 Then Color 128, 128, 128
- If s\C = 3 Then Color 192, 192, 192
- If s\C = 4 Then Color 80, 80, 80
-
- Rect s\X, s\Y, 1, 1
- EndIf
-
- If s\T > 0 Then ; Asteriod
- DrawImage Asteroids, s\X, s\Y, s\F
- For b.Bullet = Each Bullet
- If ImagesCollide(Shots, b\X, b\Y, WeapFrame, Asteroids, s\X, s\Y, s\F) And B\T <> 5 Then
- CExplo(s\X, s\Y): PlaySound ExploSFX
- P1Score = P1Score + 999999
- TempA = Rand(1, 6): TempB = Rand(1, 6)
- If TempA = TempB And Level <> 10 And Level <> 20 And Level <> 30 Then CPower(s\X, s\Y, s\S)
- Delete b
- Delete s
- If Level = 10 Or Level = 20 Or Level = 30 Then Akill = Akill + 1
- Goto Leave
- EndIf
- Next
-
- If ImagesCollide(Ships, P1X, P1Y, 0, Asteroids, s\X, s\Y, s\F) And LSF = 0 Then
- CExplo(P1X -3, P1Y + 15)
- PlayerHit = 1
- Goto Leave
- EndIf
- EndIf
-
- If s\Y > 480 Then Delete S
- .Leave
- Next
- End Function
-
- Function RBullet()
- For b.Bullet = Each Bullet
- If b\T = 1 Then
- b\Y = b\Y - 4
- DrawImage Shots, b\X, b\Y, WeapFrame
- If b\Y < 0 Then Delete b: Goto leave
- EndIf
-
- If b\T = 2 Then
- b\Y = b\Y - 4
-
- DrawImage Shots, b\X, b\Y, WeapFrame
- If b\Y < 0 Then Delete b: Goto Leave
- EndIf
-
- If b\T = 3 Then
- b\Y = b\Y - 5
- DrawImage Shots, b\X, b\Y, WeapFrame
- If b\Y < 0 Then Delete B: Goto Leave
- EndIf
-
- If b\T = 5 Then
- b\Y = b\Y + 4
- DrawImage EShots, b\X, b\Y, EWeapFrame
- If b\Y > 480 Then Delete B: Goto leave
- EndIf
-
- .Leave
- Next
- End Function
-
- Function REngine()
- For e.EParticle = Each EParticle
- e\X = e\X + Rand(-2, 2)
- e\Y = e\Y + Rand(1, 2)
- If e\L > 20 Then Color 156, 255, 255
- If e\L > 10 And e\L < 20 Then Color 0, 150, 150
- If e\L > 0 And e\L < 10 Then Color 56, 100, 100
- Rect e\X, e\Y, 1, 1
- e\L = e\L - 1
- If e\L <= 0 Or e\Y > 480 Then Delete e
- Next
- End Function
-
- Function RAlien()
- For a.Alien = Each Alien
- If a\Dive = 0
- If a\D = 0 Then a\X = a\X + 2
- If a\D = 1 Then a\X = a\X - 2
-
- If ADir = 0 Then a\D = 0
- If ADir = 1 Then a\D = 1
- EndIf
-
-
- If ADive < DiveMax Then Choose()
-
- If a\Dive = 1 Then
- If P1X > a\X Then a\X = a\X + 2
- If P1X < a\X Then a\X = a\X - 2
- a\Y = a\Y + Rand(3, 4)
- EndIf
-
- TempA = Rand(1, Difficulty): TempB = Rand(1, Difficulty)
- If TempA = TempB And a\S = 0 Then a\S = 1: CBullet(5): PlaySound Shot5SFX
-
- If a\T = 1 Then
- If EType = 1 Then DrawImage Enemy, a\X, a\Y, EFrame
- If Etype = 2 Then DrawImage Enemy2, a\X, a\Y, EFrame
- If EType = 3 Then DrawImage Enemy3, a\X, a\Y, EFrame
- If MilliSecs() >= AnimTimer + 300 Then EFrame = EFrame + 1: AnimTimer = MilliSecs()
- If EFrame = EFMax Then EFrame = 0
- EndIf
-
- If ImageRectCollide(Ships, P1X, P1Y, 0, a\X, a\Y, AW, AH) Then CExplo(a\X - 3, a\Y + 15): PlayerHit = 1: Goto Leave
-
- For b.Bullet = Each Bullet
- If ImageRectCollide(Shots, b\X, b\Y, WeapFrame, a\X, a\Y, AW, AH) And b\T <> 5 Then
- CExplo(a\X + 5, a\Y + 5): PlaySound ExploSFX
- If A\Dive = 1 Then ADive = ADive - 1
- Delete A: Delete B:
- If EType = 1 Then P1Score = P1Score + 1000
- If EType = 2 Then P1Score = P1Score + 2000
- If EType = 3 Then P1Score = P1Score + 3000
- AlienNum = AlienNum - 1: Goto Leave
- EndIf
-
- If ImagesCollide(Shots, P20X, P17Y, 0, EShots, b\X, b\Y, WeapFrame) And b\T = 5 Then
- CExplo(P20X -3, P17Y + 15)
- PlayerHit = 1
- a\Dive = 0
- EndIf
-
- If ImagesCollide(Ships, P1X, P1Y, 0, EShots, b\X, b\Y, EWeapFrame) And b\T = 5 Then
- CExplo(P1X -3, P1Y + 15)
- PlayerHit = 1
- a\Dive = 0
- EndIf
- Next
-
- If a\Y > 480 Then a\Y = - 30
- .Leave
- Next
- End Function
-
- Function RExplo()
- For x.Explosion = Each Explosion
- DrawImage Explode, x\X, x\Y, x\F
- If MilliSecs() >= x\T + 15 Then x\F = x\F + 1: x\T = MilliSecs()
- If x\F = 19 Then Delete X
- Next
- End Function
-
- Function RBoss()
- For h.Boss1 = Each Boss1
- If h\D = 1 Then h\X = h\X + 2
- If h\D = 0 Then h\X = h\X - 2
- If h\X <= 15 Then h\D = 1
- If h\X >= 529 Then h\D = 0
-
-
- If MilliSecs() >= BlastTimer + BTR Then CBBull(h\X+5, h\Y + 74, 1): BlastTimer = MilliSecs(): PlaySound PulseSFX
- If MilliSecs() >= LaserTime + 4000 Then CBBull(h\X+48, h\Y + 96, 2): LaserTime = MilliSecs(): PlaySound LaserSFX
-
- For b.Bullet = Each Bullet
- If ImagesCollide(Shots, b\X, b\Y, WeapFrame, Boss, h\X, h\Y, h\F) Then
- h\L = h\L - 1: BTR = BTR - 5
- CExplo(b\X, b\Y): PlaySound ExploSFX
- Delete b
- EndIf
- Next
-
- If h\L <= 0 Then
- For TempX = h\X - 16 To h\X + 96 Step 32
- For TempY = h\Y To h\Y + 96 Step 32
- CExplo(TempX, TempY)
- Next
- Next
- PlaySound ExploSFX
- P1Score = P1Score + 10000
- Delete h
- Level = Level + 1: Difficulty = Difficulty - 6: Diff2 = Diff2 - 4: AlienNum = 0: Goto Leave
- EndIf
-
- DrawImage Boss, h\X, h\Y, h\F
- If MilliSecs() >= AnimTimer + 300 Then h\F = h\F + 1: AnimTimer = MilliSecs()
- If h\F >= 3 Then h\F = 0
- .Leave
- Next
- End Function
-
- Cls
-
- Function RPower()
- For p.PowerUp = Each PowerUp
- p\Y = p\Y + p\S
- DrawImage Power, p\X, p\Y, p\T
-
- If ImagesCollide(Ships, P1X, P1Y, 0, Power, p\X, p\Y, p\T) Then
- PlaySound PowerSFX
- If p\T = 3 Then Weap = 3
- If p\T = 1 Then Weap = 2
- If p\T = 0 Then P1Lives = P1Lives + 2
- Delete P
- Goto Leave
- End If
-
- If p\Y > 480 Then Delete P
- .Leave
- Next
- End Function
-
- Function Choose()
- TempQ = Rand(1, 30)
- For a.Alien = Each Alien
- If a\ID = TempQ Then a\Dive = 1: ADive = Adive + 1: PlaySound DiveSFX
- Next
- End Function
-
- Function RBBull()
- For bb.Bull = Each Bull
- If bb\K = 1 Then
- If bb\A = 0 Then
- bb\X = bb\X
- bb\Y = bb\Y + 4
- EndIf
- If bb\A = 1 Then
- bb\X = bb\X - 2
- bb\Y = bb\Y + 4
- EndIf
- If bb\A = 2 Then
- bb\X = bb\X + 2
- bb\Y = bb\Y + 4
- EndIf
-
- DrawImage Orb, bb\X, bb\Y, bb\F
-
- If ImageRectCollide(Orb, bb\X, bb\Y, bb\F, P1X, P1Y, 24, 28) Then
- CExplo(P1X -3, P1Y + 15)
- PlayerHit = 1
- EndIf
-
- If MilliSecs() >= bb\T + 50 Then bb\F = bb\F + 1: bb\T = MilliSecs()
- If bb\F = 10 Then bb\F = 0
- EndIf
-
- If bb\K = 2 Then
- Color 255, 255, 255
- For h.Boss1 = Each Boss1
- bb\Y = bb\Y + 3
- Color 0, 255, 255
- Rect h\X + 46, h\Y + 96, 4, bb\Y
-
- If RectsOverlap(P1X, P1Y, 24, 28, h\X + 46, h\Y + 96, 4, bb\Y) Then
- CExplo(P1X - 3, P1Y + 15)
- PlayerHit = 1
- EndIf
- Next
- EndIf
-
- For b.Bullet = Each Bullet
- If ImagesCollide(Shots, b\X, b\Y, WeapFrame, Orb, bb\X, bb\Y, bb\F) Then Delete B
- Next
-
- If bb\Y > 480 Then Delete BB
- Next
- End Function
-
-
-
-
-
-
- Function LoadHiScores()
- File = ReadFile("hiscore.rde")
-
- Line1$ = ReadLine(File)
- Line2 = ReadLine(File)
- Line3$ = ReadLine(File)
- Line4 = ReadLine(File)
- Line5$ = ReadLine(File)
- Line6 = ReadLine(File)
- Line7$ = ReadLine(File)
- Line8 = ReadLine(File)
- Line9$ = ReadLine(File)
- Line10 = ReadLine(File)
- End Function
-
- Function show_hiscores()
- Cls
- Flip
- File = OpenFile("hiscore.rde")
- FlushKeys()
- Delay(10)
- Color 255, 255, 0
- Print "~You Made The High Score List!~"
- Locate 165, 180: Name$ = Input$("Enter Your Name: ")
- Print
- If Len(Name$) > 100 Then
- Locate 165, 200
- Name$ = Input$("Enter Your Name (20 Characters Max): ")
- EndIf
-
- If P1Score > Line10 And P1Score < Line8 Then Line9$ = Name$: Line10 = P1Score ; Got 5th Place
- If P1Score > Line8 And P1Score < Line6 Then ; Got 4th Place
- Line9$ = Line7$: Line10 = Line8
- Line7$ = Name$: Line8 = P1Score
- EndIf
- If P1Score > Line6 And P1Score < Line4 Then ; Got 3rd Place
- Line9$ = Line7$: Line10 = Line8
- Line7$ = Line5$: Line8 = Line6
- Line5$ = Name$: Line6 = P1Score
- EndIf
- If P1Score > Line4 And P1Score < Line2 Then ; Got 2nd
- Line9$ = Line7$: Line10 = Line8
- Line7$ = Line5$: Line8 = Line6
- Line5$ = Line3$: Line6 = Line4
- Line3$ = Name$: Line4 = P1Score
- EndIf
- If P1Score > Line2 Then ; 1st!
- Line9$ = Line7$: Line10 = Line8
- Line7$ = Line5$: Line8 = Line6
- Line5$ = Line3$: Line6 = Line4
- Line3$ = Line1$: Line4 = Line2
- Line1$ = Name$: Line2 = P1Score
- EndIf
-
- WriteLine( File, Line1)
- WriteLine( File, Line2)
- WriteLine( File, Line3)
- WriteLine( File, Line4)
- WriteLine( File, Line5)
- WriteLine( File, Line6)
- WriteLine( File, Line7)
- WriteLine( File, Line8)
- WriteLine( File, Line9)
- WriteLine( File, Line10)
-
- CloseFile( File )
-
- End Function
- Function DisplayHiScores()
- Color 255, 255, 0
- Text 265, 290, "- High Scores -
- Text 240, 320, Line1$: Text 380, 320, Line2
- Text 240, 340, Line3$: Text 380, 340, Line4
- Text 240, 360, Line5$: Text 380, 360, Line6
- Text 240, 380, Line7$: Text 380, 380, Line8
- Text 240, 400, Line9$: Text 380, 400, Line10
- End Function
-
-
-
- .GameOver
- FlushKeys()
- While Not KeyHit(28)
- Cls
-
-
- Repeat
- Until MilliSecs()-MainTimer>=13
- CStars()
-
- RStars()
- RExplo()
- RPower()
- LSF = 1
- Color 255, 255, 0
- Text 288, 230, "GAME OVER"
-
- If P1Score > Line10 Then show_hiscores(): Goto Reset
-
-
- Flip
- Wend
- Goto Reset
- End
; /----------------------------------------\
; | |
; | Mission: Pluto 2.0.1 |
; | Georges |
; | Revised 15/04/06 ____________________|
; |___________________|georges023@gmail.com|
Graphics 640, 480, 16, 1
AppTitle "Mission: Pluto 2.0 by Georges"
SetBuffer BackBuffer()
SeedRnd MilliSecs()
; * GFX *
;mets les images su jeu en memoire
Global Ships = LoadAnimImage("player2v1.jpg", 30, 37, 0, 7): MaskImage Ships, 0, 0, 0
Global Enemy = LoadAnimImage("Enemy.jpg", 40, 45, 0, 3): MaskImage Enemy, 0, 0, 0
Global Enemy2 = LoadAnimImage("ships.jpg", 24, 28, 0, 1): MaskImage Enemy2, 0, 0, 0
Global Enemy3 = LoadAnimImage("ships2.JPG", 68, 63, 0, 3): MaskImage Enemy3, 0, 0, 0
Global Power = LoadAnimImage("Powerups.jpg", 30, 38, 0, 4): MaskImage Power, 0, 0, 0
Global Boss = LoadAnimImage("boss.JPG", 158, 136, 0, 3): MaskImage Boss, 255, 0, 255
Global Asteroids = LoadAnimImage("Asteroids.bmp", 32 ,28, 0, 5): MaskImage Asteroids, 255, 0, 255
Global Explode = LoadAnimImage("explode.jpg", 32, 32, 0, 19)
Global Shots = LoadAnimImage("Shots 2.bmp",7, 12, 0, 3): MaskImage Shots, 255, 0, 255
Global EShots = LoadAnimImage("EShots.jpg", 30, 19, 0, 3): MaskImage EShots, 0, 0, 0
Global Orb = LoadAnimImage("Orb.jpg", 64, 64, 0, 2)
Global Logo = LoadImage("Logo.jpg"): MaskImage Logo, 0, 0, 0
Global Laser1 = LoadImage("laser.jpg")
splashscreenimage = LoadImage("splashscreen.jpg"):MaskImage splashscreenimage, 0, 0, 0 ;the splash screen
Global font_one=LoadFont( "Halo",20 )
; * SFX *
;mets les sons en memoire
Global Shot1SFX = LoadSound("bomb.wav")
Global Shot5SFX = LoadSound("shot5.wav")
Global DiveSFX = LoadSound("Dive.wav")
Global ExploSFX = LoadSound("Explode.wav")
Global PowerSFX = LoadSound("Power.wav")
Global PulseSFX = LoadSound("Pulse.wav")
Global LaserSFX = LoadSound("Laser.wav")
Global explosionsound = LoadSound("explode.wav")
Global bulletsound = LoadSound("zing.wav")
Global Laser1SFX = LoadSound("Zing.wav")
;Music
;Joue la musique du fond
backgroundmusic = PlayMusic ("Mars.mp3")
Global mapwidth,mapheight,maposx,maposy,space
; * Vars *
.Reset
FlushKeys()
Global EFrame = 0, EFMax = 3, AW = 32, AH = 30
mapwidth=32:mapheight=32:space=33
Global P1X, P1Y, P1Score = 0 ; Player 1
Global FPS = 0, Frames = 0, Time# = MilliSecs() + 1 ; FPS Counter
Global BulletTime = MilliSecs()
Global AnimTimer = MilliSecs(), MainTimer = MilliSecs()
Global AlienNum = 30, AX = 32, AY = 32, AType = 1, Amax = 1, ADir = 0, I, ADive = 0, DiveMax = 1
Global Level = 30, Weap = 1, WeapFrame = 0, EWeapFrame = 0
Global P1Lives = 6, PlayerHit = 0, JustRun = 1
Global Line1$, Line2, Line3$, Line4, Line5$, Line6, Line7$, Line8, Line9$, Line10
Global Difficulty = 990, Diff2 = 100
Global EType = 1, AKill = 0, BlastTimer = MilliSecs(), BTR = 1750, BFlag = 0, LaserTime = MilliSecs()
Global TempM, LSF = 0, DFlag1 = 0, DFlag2 = 0, DFlag3 = 0
;dimension map And score table
Dim map(mapwidth,mapheight)
Type Stars
Field X
Field Y
Field C
Field S
Field T
Field F
End Type
Type players ; you the hero
Field x,y,sx,sy,dx,dy,frame,image,dest,dir,speed,bored,state
End Type
Type flys ; fireflys and butterflys
Field x,y,sx,sy,dx,dy,sort,frame,image,dest,dir,speed,state
End Type
;
Type objects ; boulders and diamonds ect ect
Field x,y,sx,sy,dx,dy,frame,image,dest,dir,speed,sparkle#,state
End Type
;
Type explosions ; explosions
Field x,y,sx,sy,frame,image,speed
End Type
Type Bullet
Field X
Field Y
Field T
End Type
Type EParticle
Field X
Field Y
Field L
End Type
Type Alien
Field X
Field Y
Field T
Field S
Field D
Field ID
Field Dive
End Type
Type Explosion
Field X
Field Y
Field F
Field T
End Type
Type PowerUp
Field X
Field Y
Field S
Field T
End Type
Type Boss1
Field X
Field Y
Field S
Field L
Field D
Field F
End Type
Type Bull
Field X
Field Y
Field A
Field D
Field F
Field T
Field K
End Type
level = 1
DrawImage(splashscreenimage, 165, 180)
Flip
Delay 3000
Font = LoadFont("halo", 14, False, False, False)
SetFont Font
For h.Boss1 = Each Boss1
Delete H
Next
.Level
LSF = 1
For b.Bullet = Each Bullet
Delete b
Next
For e.EParticle = Each EParticle
Delete E
Next
For a.Alien = Each Alien
Delete A
Next
For bb.Bull = Each Bull
Delete BB
Next
If Level = 7 And DFlag1 = 0 Then DiveMax = DiveMax + 1: DFlag1 = 1
If Level = 14 And DFlag2 = 0 Then DiveMax = DiveMax + 1: DFlag2 = 1
If Level = 21 And DFlag3 = 0 Then DiveMax = DiveMax + 1: DFlag3 = 1
TempX = 255: TempY = 0
While Not KeyHit(28)
Cls
Repeat
Until MilliSecs()-MainTimer>=13
CStars()
RStars()
RExplo()
RPower()
If Level > 9 Then ; Set 2
EType = 2: EFrame = 0: EFMax = 4: AW = 32: AH = 44
EndIf
If Level > 19 Then ; Set 3
EType = 3: EFrame = 0: EFMax = 3: AW = 32: AH = 30
EndIf
If JustRun = 1 Then DrawImage Logo, 165, 180: DisplayHiScores()
AlienNum = 30
If Diff2 <= 8 Then Diff2 = 8
AX = 32
AY = 32
AMax = 1
ADir = 0
ADive = 0
P1X = 320 - 24
P1Y = 480 - 80
If Level <> 10 And Level <> 20 And Level <> 30 Then AKill = 0
PlayerHit = 0
Color TempX, TempX, TempX
If KeyHit(70) Then P1Lives = 3: PlaySound PowerSFX
If KeyHit(1) Then End
If JustRun = 0 And Level <> 10 And Level <> 20 And Level <> 30 And Level <> 15 Then Text 297, 230, "Dimension " +" "+ Level
If Level = 10 Or Level = 20 Or Level = 30 Then Text 273, 230, "Kuiper BELT"
If Level = 15 Then Text 305, 230, "Master"
If TempY = 0 Then TempX = TempX - 5
If TempY = 1 Then TempX = TempX + 5
If TempX <= 5 Then TempY = 1
If TempX >= 250 Then TempY = 0
Flip
Wend
JustRun = 0
If Level = 10 Or Level = 20 Or Level = 30 Then Goto Main ; Asteroid Belt
If Level = 15 Then
If BFlag = 0 Then CBoss(): BFlag = 1
Goto Main ; Boss
EndIf
For I = 1 To AlienNum
CAlien()
AX = AX + 48
If I = 10 Then AY = AY + 48: AX = 32
If I = 20 Then AY = AY + 48: AX = 32
Next
.Main
MainTimer = MilliSecs()
LSF = 0
While Not KeyHit(1)
Cls
Repeat
Until MilliSecs()-MainTimer>=13
MainTimer = MilliSecs()
CStars()
CEngine()
frames=frames+1
RStars()
RBullet()
REngine()
RPower()
RAlien()
If Level = 15 Then RBoss(): RBBull()
RExplo()
DrawImage Ships, P1X, P1Y, 0
If MilliSecs() >= Time Then FPS = Frames: Frames = 0: Time = Time + 1000
Color 255, 255, 0
;Text 1, 1, "FPS: " + FPS
Text 20, 456, "Score: " + P1Score
Text 560, 456, "Lives: " + P1Lives
If ADir = 0 Then Amax = AMax + 1
If ADir = 1 Then Amax = Amax - 1
If AMax > 70 Then ADir = 1
If AMax < -15 Then ADir = 0
If Weap = 1 Then WeapFrame = 0
If Weap = 2 Then WeapFrame = 1
If Weap = 3 Then WeapFrame = 2
If EType = 2 Then EWeapFrame = 1
If EType = 3 Then EWeapFrame = 2
If ChannelPlaying(Channel) = 0 Then
StopChannel Channel
If TempM = 1 Then TempM = 2: Channel = PlayMusic("track2.mod"): Goto LeaveMusic
If TempM = 2 Then TempM = 3: Channel = PlayMusic("track3.mod"): Goto LeaveMusic
If TempM = 3 Then TempM = 4: Channel = PlayMusic("track4.mod"): Goto LeaveMusic
If TempM = 4 Then TempM = 1: Channel = PlayMusic("track1.mod"): Goto LeaveMusic
EndIf
snnum = "1"
If KeyHit(68)
SaveBuffer(BackBuffer(), "screenshots\" + "screenshot"+ snnum +".bmp")
EndIf
snnum = snnum + "1"
.LeaveMusic
If AlienNum <= 0 Then Level = Level + 1: Difficulty = Difficulty + 90: Diff2 = Diff2 + 4: Goto Level
If AKill >= 150 Then Level = Level - 1: Difficulty = Difficulty - 6: Diff2 = Diff2 - 4: Goto Level
If PlayerHit = 1 Then
P1Lives = P1Lives - 1
Weap = 1
PlaySound ExploSFX
If P1Lives < 0 Then Goto GameOver
Goto Level
EndIf
If KeyDown(203) Then P1X = P1X - 3
If KeyDown(205) Then P1X = P1X + 3
If KeyDown(200) Then P1Y = P1Y - 3
If KeyDown(208) Then P1Y = P1Y + 3
If KeyHit(57) And MilliSecs() >= BulletTime + 250 Then CBullet(Weap): PlaySound Shot1SFX
If P1X <= 1 Then P1X = 2
If P1X >= 614 Then P1X = 613
If P1Y >= 427 Then P1Y = 426
If P1Y <= 300 Then P1Y = 301
Flip
Wend
End
Function CStars()
s.Stars = New Stars
s\X = Rand(1, 640)
s\Y = -29
s\C = Rand(1, 4)
s\S = Rand(1, 3)
s\T = 0
TempA = Rand(1, Diff2): TempB = Rand(1, Diff2)
If TempA = TempB Then s\T = Rand(1, 4): s\S = Rand(2, 5): s\F = Rand(0, 4)
If Level = 10 Or Level = 20 Or Level = 30 Then
TempA = Rand(1, 2): TempB = Rand(1, 2)
If TempA = TempB Then
s\T = Rand(1, 4)
s\F = Rand(0, 4)
If Level = 10 Then s\S = Rand(3, 6)
If Level = 20 Then s\S = Rand(4, 7)
If Level = 30 Then s\S = Rand(5, 8)
EndIf
EndIf
End Function
Function CBullet(BType)
If Btype = 1 Then
b.Bullet = New Bullet
b\X = P1X + 10
b\Y = P1Y
b\T = BType
BulletTime = MilliSecs()
EndIf
If Btype = 2 Then
b.Bullet = New Bullet
b\X = P1X + 2
b\Y = P1Y + 5
b\T = 2
b.Bullet = New Bullet
b\X = P1X + 19
b\Y = P1Y + 5
b\T = 2
BulletTime = MilliSecs()
EndIf
If BType = 3 Then
b.Bullet = New Bullet
b\X = P1X + 10
b\Y = P1Y
b\T = 1
b.Bullet = New Bullet
b\X = P1X + 3
b\Y = P1Y + 5
b\T = 3
b.Bullet = New Bullet
b\X = P1X + 18
b\Y = P1Y + 5
b\T = 3
BulletTime = MilliSecs()
EndIf
If Btype = 5 Then
b.Bullet = New Bullet
For a.Alien = Each Alien
If a\S = 1 Then
b\X = a\X + 15
b\Y = a\Y + 30
b\T = BType
a\S = 0
EndIf
Next
EndIf
End Function
Function CBBull(BX, BY, Num)
If Num = 1 Then
bb.Bull = New Bull
bb\X = BX
bb\Y = BY
bb\A = 0
bb\K = 1
bb.Bull = New Bull
bb\X = BX
bb\Y = BY
bb\A = 1
bb\K = 1
bb.Bull = New Bull
bb\X = BX
bb\Y = BY
bb\A = 2
bb\K = 1
bb\T = MilliSecs()
EndIf
If Num = 2 Then
bb.Bull = New Bull
bb\X = BX
bb\Y = BY
bb\K = 2
EndIf
End Function
Function CEngine()
e.EParticle = New EParticle
TempY = Rand(1, 2)
If TempY = 1 Then e\X = P1X + Rand(5, 9)
If TempY = 2 Then e\X = P1X + Rand(14, 18)
e\Y = P1Y + 27
e\L = Rand(20, 30)
End Function
Function CAlien()
a.Alien = New Alien
a\X = AX
a\Y = AY
a\T = AType
a\S = 0
a\D = 0
a\ID = I
a\Dive = 0
End Function
Function CExplo(EX, EY)
x.Explosion = New Explosion
x\X = EX
x\Y = EY
x\F = 0
x\T = MilliSecs()
End Function
Function CPower(PX, PY, PS)
p.PowerUp = New PowerUp
p\X = PX
p\Y = PY
p\S = PS
TempA = Rand(1, 2): TempB = Rand(1, 2)
If TempA = TempB Then p\T = 3 Else p\T = Rand(0, 1)
End Function
Function CBoss()
h.Boss1 = New Boss1
h\X = 640 /2 - 96 / 2
h\Y = 25
h\S = 0
h\D = 1
h\L = 200
h\F = 0
AnimTimer = MilliSecs()
End Function
Function RStars()
For s.Stars = Each Stars
s\Y = s\Y + s\S
If s\T = 0 Then
If s\C = 1 Then Color 255, 255, 255
If s\C = 2 Then Color 128, 128, 128
If s\C = 3 Then Color 192, 192, 192
If s\C = 4 Then Color 80, 80, 80
Rect s\X, s\Y, 1, 1
EndIf
If s\T > 0 Then ; Asteriod
DrawImage Asteroids, s\X, s\Y, s\F
For b.Bullet = Each Bullet
If ImagesCollide(Shots, b\X, b\Y, WeapFrame, Asteroids, s\X, s\Y, s\F) And B\T <> 5 Then
CExplo(s\X, s\Y): PlaySound ExploSFX
P1Score = P1Score + 999999
TempA = Rand(1, 6): TempB = Rand(1, 6)
If TempA = TempB And Level <> 10 And Level <> 20 And Level <> 30 Then CPower(s\X, s\Y, s\S)
Delete b
Delete s
If Level = 10 Or Level = 20 Or Level = 30 Then Akill = Akill + 1
Goto Leave
EndIf
Next
If ImagesCollide(Ships, P1X, P1Y, 0, Asteroids, s\X, s\Y, s\F) And LSF = 0 Then
CExplo(P1X -3, P1Y + 15)
PlayerHit = 1
Goto Leave
EndIf
EndIf
If s\Y > 480 Then Delete S
.Leave
Next
End Function
Function RBullet()
For b.Bullet = Each Bullet
If b\T = 1 Then
b\Y = b\Y - 4
DrawImage Shots, b\X, b\Y, WeapFrame
If b\Y < 0 Then Delete b: Goto leave
EndIf
If b\T = 2 Then
b\Y = b\Y - 4
DrawImage Shots, b\X, b\Y, WeapFrame
If b\Y < 0 Then Delete b: Goto Leave
EndIf
If b\T = 3 Then
b\Y = b\Y - 5
DrawImage Shots, b\X, b\Y, WeapFrame
If b\Y < 0 Then Delete B: Goto Leave
EndIf
If b\T = 5 Then
b\Y = b\Y + 4
DrawImage EShots, b\X, b\Y, EWeapFrame
If b\Y > 480 Then Delete B: Goto leave
EndIf
.Leave
Next
End Function
Function REngine()
For e.EParticle = Each EParticle
e\X = e\X + Rand(-2, 2)
e\Y = e\Y + Rand(1, 2)
If e\L > 20 Then Color 156, 255, 255
If e\L > 10 And e\L < 20 Then Color 0, 150, 150
If e\L > 0 And e\L < 10 Then Color 56, 100, 100
Rect e\X, e\Y, 1, 1
e\L = e\L - 1
If e\L <= 0 Or e\Y > 480 Then Delete e
Next
End Function
Function RAlien()
For a.Alien = Each Alien
If a\Dive = 0
If a\D = 0 Then a\X = a\X + 2
If a\D = 1 Then a\X = a\X - 2
If ADir = 0 Then a\D = 0
If ADir = 1 Then a\D = 1
EndIf
If ADive < DiveMax Then Choose()
If a\Dive = 1 Then
If P1X > a\X Then a\X = a\X + 2
If P1X < a\X Then a\X = a\X - 2
a\Y = a\Y + Rand(3, 4)
EndIf
TempA = Rand(1, Difficulty): TempB = Rand(1, Difficulty)
If TempA = TempB And a\S = 0 Then a\S = 1: CBullet(5): PlaySound Shot5SFX
If a\T = 1 Then
If EType = 1 Then DrawImage Enemy, a\X, a\Y, EFrame
If Etype = 2 Then DrawImage Enemy2, a\X, a\Y, EFrame
If EType = 3 Then DrawImage Enemy3, a\X, a\Y, EFrame
If MilliSecs() >= AnimTimer + 300 Then EFrame = EFrame + 1: AnimTimer = MilliSecs()
If EFrame = EFMax Then EFrame = 0
EndIf
If ImageRectCollide(Ships, P1X, P1Y, 0, a\X, a\Y, AW, AH) Then CExplo(a\X - 3, a\Y + 15): PlayerHit = 1: Goto Leave
For b.Bullet = Each Bullet
If ImageRectCollide(Shots, b\X, b\Y, WeapFrame, a\X, a\Y, AW, AH) And b\T <> 5 Then
CExplo(a\X + 5, a\Y + 5): PlaySound ExploSFX
If A\Dive = 1 Then ADive = ADive - 1
Delete A: Delete B:
If EType = 1 Then P1Score = P1Score + 1000
If EType = 2 Then P1Score = P1Score + 2000
If EType = 3 Then P1Score = P1Score + 3000
AlienNum = AlienNum - 1: Goto Leave
EndIf
If ImagesCollide(Shots, P20X, P17Y, 0, EShots, b\X, b\Y, WeapFrame) And b\T = 5 Then
CExplo(P20X -3, P17Y + 15)
PlayerHit = 1
a\Dive = 0
EndIf
If ImagesCollide(Ships, P1X, P1Y, 0, EShots, b\X, b\Y, EWeapFrame) And b\T = 5 Then
CExplo(P1X -3, P1Y + 15)
PlayerHit = 1
a\Dive = 0
EndIf
Next
If a\Y > 480 Then a\Y = - 30
.Leave
Next
End Function
Function RExplo()
For x.Explosion = Each Explosion
DrawImage Explode, x\X, x\Y, x\F
If MilliSecs() >= x\T + 15 Then x\F = x\F + 1: x\T = MilliSecs()
If x\F = 19 Then Delete X
Next
End Function
Function RBoss()
For h.Boss1 = Each Boss1
If h\D = 1 Then h\X = h\X + 2
If h\D = 0 Then h\X = h\X - 2
If h\X <= 15 Then h\D = 1
If h\X >= 529 Then h\D = 0
If MilliSecs() >= BlastTimer + BTR Then CBBull(h\X+5, h\Y + 74, 1): BlastTimer = MilliSecs(): PlaySound PulseSFX
If MilliSecs() >= LaserTime + 4000 Then CBBull(h\X+48, h\Y + 96, 2): LaserTime = MilliSecs(): PlaySound LaserSFX
For b.Bullet = Each Bullet
If ImagesCollide(Shots, b\X, b\Y, WeapFrame, Boss, h\X, h\Y, h\F) Then
h\L = h\L - 1: BTR = BTR - 5
CExplo(b\X, b\Y): PlaySound ExploSFX
Delete b
EndIf
Next
If h\L <= 0 Then
For TempX = h\X - 16 To h\X + 96 Step 32
For TempY = h\Y To h\Y + 96 Step 32
CExplo(TempX, TempY)
Next
Next
PlaySound ExploSFX
P1Score = P1Score + 10000
Delete h
Level = Level + 1: Difficulty = Difficulty - 6: Diff2 = Diff2 - 4: AlienNum = 0: Goto Leave
EndIf
DrawImage Boss, h\X, h\Y, h\F
If MilliSecs() >= AnimTimer + 300 Then h\F = h\F + 1: AnimTimer = MilliSecs()
If h\F >= 3 Then h\F = 0
.Leave
Next
End Function
Cls
Function RPower()
For p.PowerUp = Each PowerUp
p\Y = p\Y + p\S
DrawImage Power, p\X, p\Y, p\T
If ImagesCollide(Ships, P1X, P1Y, 0, Power, p\X, p\Y, p\T) Then
PlaySound PowerSFX
If p\T = 3 Then Weap = 3
If p\T = 1 Then Weap = 2
If p\T = 0 Then P1Lives = P1Lives + 2
Delete P
Goto Leave
End If
If p\Y > 480 Then Delete P
.Leave
Next
End Function
Function Choose()
TempQ = Rand(1, 30)
For a.Alien = Each Alien
If a\ID = TempQ Then a\Dive = 1: ADive = Adive + 1: PlaySound DiveSFX
Next
End Function
Function RBBull()
For bb.Bull = Each Bull
If bb\K = 1 Then
If bb\A = 0 Then
bb\X = bb\X
bb\Y = bb\Y + 4
EndIf
If bb\A = 1 Then
bb\X = bb\X - 2
bb\Y = bb\Y + 4
EndIf
If bb\A = 2 Then
bb\X = bb\X + 2
bb\Y = bb\Y + 4
EndIf
DrawImage Orb, bb\X, bb\Y, bb\F
If ImageRectCollide(Orb, bb\X, bb\Y, bb\F, P1X, P1Y, 24, 28) Then
CExplo(P1X -3, P1Y + 15)
PlayerHit = 1
EndIf
If MilliSecs() >= bb\T + 50 Then bb\F = bb\F + 1: bb\T = MilliSecs()
If bb\F = 10 Then bb\F = 0
EndIf
If bb\K = 2 Then
Color 255, 255, 255
For h.Boss1 = Each Boss1
bb\Y = bb\Y + 3
Color 0, 255, 255
Rect h\X + 46, h\Y + 96, 4, bb\Y
If RectsOverlap(P1X, P1Y, 24, 28, h\X + 46, h\Y + 96, 4, bb\Y) Then
CExplo(P1X - 3, P1Y + 15)
PlayerHit = 1
EndIf
Next
EndIf
For b.Bullet = Each Bullet
If ImagesCollide(Shots, b\X, b\Y, WeapFrame, Orb, bb\X, bb\Y, bb\F) Then Delete B
Next
If bb\Y > 480 Then Delete BB
Next
End Function
Function LoadHiScores()
File = ReadFile("hiscore.rde")
Line1$ = ReadLine(File)
Line2 = ReadLine(File)
Line3$ = ReadLine(File)
Line4 = ReadLine(File)
Line5$ = ReadLine(File)
Line6 = ReadLine(File)
Line7$ = ReadLine(File)
Line8 = ReadLine(File)
Line9$ = ReadLine(File)
Line10 = ReadLine(File)
End Function
Function show_hiscores()
Cls
Flip
File = OpenFile("hiscore.rde")
FlushKeys()
Delay(10)
Color 255, 255, 0
Print "~You Made The High Score List!~"
Locate 165, 180: Name$ = Input$("Enter Your Name: ")
Print
If Len(Name$) > 100 Then
Locate 165, 200
Name$ = Input$("Enter Your Name (20 Characters Max): ")
EndIf
If P1Score > Line10 And P1Score < Line8 Then Line9$ = Name$: Line10 = P1Score ; Got 5th Place
If P1Score > Line8 And P1Score < Line6 Then ; Got 4th Place
Line9$ = Line7$: Line10 = Line8
Line7$ = Name$: Line8 = P1Score
EndIf
If P1Score > Line6 And P1Score < Line4 Then ; Got 3rd Place
Line9$ = Line7$: Line10 = Line8
Line7$ = Line5$: Line8 = Line6
Line5$ = Name$: Line6 = P1Score
EndIf
If P1Score > Line4 And P1Score < Line2 Then ; Got 2nd
Line9$ = Line7$: Line10 = Line8
Line7$ = Line5$: Line8 = Line6
Line5$ = Line3$: Line6 = Line4
Line3$ = Name$: Line4 = P1Score
EndIf
If P1Score > Line2 Then ; 1st!
Line9$ = Line7$: Line10 = Line8
Line7$ = Line5$: Line8 = Line6
Line5$ = Line3$: Line6 = Line4
Line3$ = Line1$: Line4 = Line2
Line1$ = Name$: Line2 = P1Score
EndIf
WriteLine( File, Line1)
WriteLine( File, Line2)
WriteLine( File, Line3)
WriteLine( File, Line4)
WriteLine( File, Line5)
WriteLine( File, Line6)
WriteLine( File, Line7)
WriteLine( File, Line8)
WriteLine( File, Line9)
WriteLine( File, Line10)
CloseFile( File )
End Function
Function DisplayHiScores()
Color 255, 255, 0
Text 265, 290, "- High Scores -
Text 240, 320, Line1$: Text 380, 320, Line2
Text 240, 340, Line3$: Text 380, 340, Line4
Text 240, 360, Line5$: Text 380, 360, Line6
Text 240, 380, Line7$: Text 380, 380, Line8
Text 240, 400, Line9$: Text 380, 400, Line10
End Function
.GameOver
FlushKeys()
While Not KeyHit(28)
Cls
Repeat
Until MilliSecs()-MainTimer>=13
CStars()
RStars()
RExplo()
RPower()
LSF = 1
Color 255, 255, 0
Text 288, 230, "GAME OVER"
If P1Score > Line10 Then show_hiscores(): Goto Reset
Flip
Wend
Goto Reset
End
Conclusion
Ce jeux sera bientot mis a jour. lancer play.bat pour voir le mp2.exe
Historique
- 17 avril 2006 16:28:38 :
- bug de powerups corrige. ajout de la fonction de capture d'ecran (f10). ajout de l'executable windows (mp2.exe(Pour le voir veuillez lancer play.bat))
Sources de la même categorie
Commentaires et avis
Discussions en rapport avec ce code source dans le forum
Gros problème avec les vbrun Urgent!!!!!! [ par Cyber117 ]
Je distribut gratuitement mes programmes sur internet mais les gens me disent qu'ils leur marque les vbrun. (lorsque qu'il lance le jeux une fenetre a
Jeux de Pacman [ par Integer ]
Je cherche a faire un jeux du genre pacman.ca consiste a déplacer un petit personnage, pour qu'il mange des points jaunes sans qu'il se fasse manger p
Jeu de tir à la Rogue Spear [ par Nat ]
Salut.Je développe un jeu de tir et j'ai grave besoin d'aide.Il me manque un graphiste et j'aimerais aussi savoir comment on fait pour interpréter la
Jeux : Rubics Cubes [ par Bruno ]
Bonjour , Je suis à la recherche d'un développement d'un programme VB6 pour simuler le jeux Rubics Cubes.Um MAX de renseignement serait le bien venu.M
Déplacement latéral [ par CyBeR ]
Je suis entrain de créé un jeux d'aventure et je veux que mes personnages se déplace latéralement. La ou je bloque c quand la persone (l'utilisateur d
Recherche de programmeurs vb pour creer un jeux de role online. [ par Kasim0d0 ]
Bonjour.Voila, je me presente, avec un amis (un infographiste) (moi je suis programmeur), nous avons decidé de creer un jeux de rôle online francais e
Recherche de programmeurs vb pour creer un jeux de role online. [ par Kasim0d0 ]
Bonjour.Voila, je me presente, avec un amis (un infographiste) (moi je suis programmeur), nous avons decidé de creer un jeux de rôle online francais e
faire un trainer [ par pedrez ]
lire et ecrire dans la memoire Précisions : je voudrais savoir comment utiliseropenprocessmemoryreadprocessmemorywriteprocessmemorypour pouvoir
Comment creer un serveur de jeux en reseaux? [ par Momo3dfx ]
Salut a tous,j'ai un exellent site, sur un jeu, j'ai du matos pour faire un serveur, j'ai tout sauf l'expérience et el savoir faire.-Comment fait-on p
|
Derniers Blogs
TECHDAYS PARIS 2010 : ADMINISTRATION SHAREPOINT 2010TECHDAYS PARIS 2010 : ADMINISTRATION SHAREPOINT 2010 par ROMELARD Fabrice
Animé par: Patrick Guimonet et Benoit Hamet Cette session traitera des différents points exigés durant les taches d'administration : Planification (architecture, hébergement, authentification, .) Opération e...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice [TECHDAYS 2010] #03 - WEB CONTENT MANAGEMENT SOUS SHAREPOINT 2010[TECHDAYS 2010] #03 - WEB CONTENT MANAGEMENT SOUS SHAREPOINT 2010 par pierre
Stephane Cordonnier de MCNext nous présente les fonctionnalités Web Content Management (WCM) sous SharePoint 2010. Qu'est-ce que le WCM ECM, GED, RM, WCM c'est quoi Plateforme SharePoint Versions SharePoint 2010 SharePoint Fondation...
Cliquez pour lire la suite de l'article par pierre [DESIGN PATTERNS] PARTIE 2: DIP: DEPENDENCY INVERSION PRINCIPLE[DESIGN PATTERNS] PARTIE 2: DIP: DEPENDENCY INVERSION PRINCIPLE par tja
C'est le dernier principe des principes du Design Orienté Objet (The Principles of Object Oriented Design) fondés par Robert C. Martin plus connu sous le pseudonyme d'Uncle Bob.
l'image empruntée de LosTechies.
Je ne traite pas les principes dans...
Cliquez pour lire la suite de l'article par tja TECHDAYS PARIS 2010 : SHAREPOINT 2010 POUR LES DéVELOPPEURSTECHDAYS PARIS 2010 : SHAREPOINT 2010 POUR LES DéVELOPPEURS par ROMELARD Fabrice
Animé par: Laurent Cotton Le développement dans SharePoint 2010 passe par plusieurs axes qui seront évoqués dans cette session, mais plus particulièrement les développements simples lié au besoin Business Business Connectivity Services Ce BCS es...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice TECHDAYS PARIS 2010 : PLEINIèRE DERNIER JOURTECHDAYS PARIS 2010 : PLEINIèRE DERNIER JOUR par ROMELARD Fabrice
Cette session est la dernière pleinière de ces 3 jours de TechDays Paris 2010. Généralement, cette troisième journée est plus axée sur l'avenir vu par Microsoft. Après un retour sur l'avenir vu par la Science Fiction ou par ...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice
Logiciels
DB-MAIN (9.1.0)DB-MAIN (9.1.0)DB-MAIN is a data-modeling and data-architecture tool. It is designed to help developers and anal... Cliquez pour télécharger DB-MAIN Xilisoft DPG Convertisseur (5.1.37.0120)XILISOFT DPG CONVERTISSEUR (5.1.37.0120)Xilisoft DPG Convertisseur offre aux fans de Nintendo DS une bonne solution leur permettant de dé... Cliquez pour télécharger Xilisoft DPG Convertisseur GraphicsGale (2.01.01)GRAPHICSGALE (2.01.01)GraphicsGale est un logiciel de PixelArt avec de nombreuse fonctionnalités permettant de réalisé ... Cliquez pour télécharger GraphicsGale Architecte 3D (Platinum 2010)ARCHITECTE 3D (PLATINUM 2010)Architecte 3D Platinium vous permet de concevoir facilement les plans votre future maison, de l'é... Cliquez pour télécharger Architecte 3D TeamViewer 5 (TeamViewer 5)TEAMVIEWER 5 (TEAMVIEWER 5)Dépanner un ami,expliquer une manipulation devient un jeu d'enfant.
Prise en main d'un autre ord... Cliquez pour télécharger TeamViewer 5
Comparez les prix

HTC Hero
Entre 550€ et 550€
|