Tapahtui kummia. CB huutaa "A fatal error occurred. Please contact us at our homepage. But as you can see, the program didn't crash
Code: Select all
maapa:
Include "C:\Program Files\CoolBasic\cbFUN\cbFUN.cb"
Include "SDK/include/cbTimer.cb"
Include "SDK/include/cbSpecialFX.cb"
Include "SDK/include/cbAPI.cb"
Include "SDK/include/cbMotion.cb"
Include "sdk/include/cbGravitationPhysics.cb"
ts1=LoadObject("Media/charmander.jpg")
img = LoadImage("Media/earth2.png")
boom = LoadSound("SDK/media/boom.wav")
sun = LoadObject("Media/sun.png")
mer = LoadObject("Media/mercurius.png")
ven = LoadObject("Media/venus.png")
mar = LoadObject("Media/mars.png")
cow = LoadObject("Media/cow3.bmp")
t = LoadObject("Media/torchic.bmp")
tt = LoadObject("Media/treecko.bmp")
mu = LoadObject("Media/mudkip.bmp")
pac = LoadObject("Media/pacman.bmp")
musa=PlaySound("Media/city5.wav")
muu = LoadSound ("Media/in.wav")
me=LoadSound ("Media/off.wav")
MaskObject mu,255,255,255
MaskObject tt,255,255,255
MaskObject t,255,255,255
ShowObject sun, OFF
ShowObject cow, OFF
ShowObject ven, OFF
ShowObject mer, OFF
ShowObject mar, OFF
ShowObject pac, OFF
ShowObject ts1, OFF
PositionObject t, 150,-50
PositionObject tt, -150,-50
PositionObject mu, 0,100
Locate 0,13 'Asetetaan Inputin sijainti
imageX = (ScreenWidth() - ImageWidth(img)) / 2
imageY = (ScreenHeight() - ImageHeight(img)) / 2
t = InitTimer(1000)
SetTimerLifeTime(t, 1)
Repeat 'Aloitetaan looppi
UpdateTimer()
Text 10,0,"Write something and press enter"
teksti$ = Input(">> ") 'Käynnistetään input
If IsTimerRunning(t) = False Then
DrawImage img, imageX, imageY
If teksti$ = "porsas" And KeyHit(cbkeyreturn) Then 'jos inputissa lukee possu...
ExplodeImage(img, imageX, imageY, 30, 15, 1, 300, 1, 10, 0, 0)
PlaySound boom
StartTimer(t)
EndIf
If teksti$ = "kilpikonna" And KeyHit(cbkeyreturn) Then
If MessageBox("Oletko aivan varma?", "Vahvistus", MB_YESNO, MB_ICONQUESTION, MB_DEFBUTTON2) = IDYES Then
If MessageBox("Oikeasti?", "SuperVahvistus", MB_YESNO, MB_ICONQUESTION, MB_DEFBUTTON2) = IDYES Then
If MessageBox("Enpä uskoisi sinusta", "HyperVahvistus", MB_YESNO, MB_ICONQUESTION, MB_DEFBUTTON2) = IDYES Then
If MessageBox("O'really?", "MegaVahvistus", MB_YESNO, MB_ICONQUESTION, MB_DEFBUTTON2) = IDYES Then
MakeError ("Virus luotu koneellesi.")
EndIf
EndIf
EndIf
EndIf
EndIf
If teksti$ = "lol" And KeyHit(cbkeyreturn) Then
If MessageBox("Idiootti", "Idiootti", MB_YESNO, MB_ICONQUESTION, MB_DEFBUTTON2) = IDYES Or IDNOThen
If MessageBox("Idiootti", "Idiootti", MB_YESNO, MB_ICONQUESTION, MB_DEFBUTTON2) = IDYES Or IDNO Then
If MessageBox("Idiootti", "Idiootti", MB_YESNO, MB_ICONQUESTION, MB_DEFBUTTON2) = IDYES Or IDNO Then
If MessageBox("Idiootti", "Idiootti", MB_YESNO, MB_ICONQUESTION, MB_DEFBUTTON2) = IDYES Or IDNO Then
If MessageBox("Idiootti", "Idiootti", MB_YESNO, MB_ICONQUESTION, MB_DEFBUTTON2) = IDYES Or IDNO Then
If MessageBox("Idiootti", "Idiootti", MB_YESNO, MB_ICONQUESTION, MB_DEFBUTTON2) = IDYES Or IDNO Then
If MessageBox("Idiootti", "Idiootti", MB_YESNO, MB_ICONQUESTION, MB_DEFBUTTON2) = IDYES Or IDNO Then
If MessageBox("Olet idiootti", "Idiootti", MB_YES, MB_DEFBUTTON2) = IDYES Then
MessageBox("HAAHAA!!", "HAAHAA!!", MB_YES, MB_DEFBUTTON2) = IDYES
EndIf
EndIf
EndIf
EndIf
EndIf
EndIf
EndIf
EndIf
EndIf
EndIf
If teksti$ = "moi" And KeyHit(cbkeyreturn) Then
If SoundPlaying (musa) Then StopSound (musa)
If SoundPlaying (m2) Then StopSound (m2)
If SoundPlaying (m3) Then StopSound (m3)
If SoundPlaying (m4) Then StopSound (m4)
m=PlaySound ("Media\battle2.wav")
EndIf
If teksti$ = "miisa" And KeyHit(cbkeyreturn) Then
If SoundPlaying (musa) Then StopSound (musa)
If SoundPlaying (m) Then StopSound (m)
If SoundPlaying (m3) Then StopSound (m3)
If SoundPlaying (m4) Then StopSound (m4)
m2=PlaySound ("Media\Ding Drum.mp3")
EndIf
If teksti$ = "rasmus" And KeyHit(cbkeyreturn) Then
If SoundPlaying (musa) Then StopSound (musa)
If SoundPlaying (m) Then StopSound (m)
If SoundPlaying (m2) Then StopSound (m2)
If SoundPlaying (m4) Then StopSound (m4)
m3=PlaySound ("Media\Nintendo - Super Mario Bros Original Theme.mp3")
EndIf
If teksti$ = "lohikäärme" And KeyHit(cbkeyreturn) Then
If SoundPlaying (musa) Then StopSound (musa)
If SoundPlaying (m) Then StopSound (m)
If SoundPlaying (m2) Then StopSound (m2)
If SoundPlaying (m3) Then StopSound (m3)
m4=PlaySound ("Media\city2.mid")
EndIf
If teksti$ = "pig" And KeyHit(cbkeyreturn) Then
PlaySound muu
ShowObject sun,ON
ShowObject cow, OFF
ShowObject ven, OFF
ShowObject mer, OFF
ShowObject mar, OFF
ShowObject ts1,OFF
EndIf
If teksti$ = "kissa" And KeyHit(cbkeyreturn) Then
PlaySound muu
ShowObject sun,OFF
ShowObject cow, ON
ShowObject ven, OFF
ShowObject mer, OFF
ShowObject mar, OFF
ShowObject ts1,OFF
EndIf
If teksti$ = "nörtti" And KeyHit(cbkeyreturn) Then
PlaySound muu
ShowObject sun,OFF
ShowObject cow, OFF
ShowObject ven, ON
ShowObject mer, OFF
ShowObject mar, OFF
ShowObject ts1,OFF
EndIf
If teksti$ = "manga" And KeyHit(cbkeyreturn) Then
PlaySound muu
ShowObject sun,OFF
ShowObject cow, OFF
ShowObject ven, OFF
ShowObject mer, ON
ShowObject mar, OFF
ShowObject ts1,OFF
EndIf
If teksti$ = "anime" And KeyHit(cbkeyreturn) Then
PlaySound muu
ShowObject sun,OFF
ShowObject cow, OFF
ShowObject ven, OFF
ShowObject mer, OFF
ShowObject mar, ON
ShowObject ts1,OFF
EndIf
If teksti$ = "koira" And KeyHit(cbkeyreturn) Then
PlaySound me
ShowObject ts1,ON
ShowObject sun,OFF
ShowObject cow, OFF
ShowObject ven, OFF
ShowObject mer, OFF
ShowObject mar, OFF
EndIf
If teksti$ = "omg" And KeyHit(cbkeyreturn) Then
PlaySound me
ShowObject ts1,OFF
ShowObject sun,OFF
ShowObject cow, OFF
ShowObject ven, OFF
ShowObject mer, OFF
ShowObject mar, OFF
ShowObject pac, OFF
EndIf
If teksti$ = "xD" And KeyHit(cbkeyreturn) Then
Goto omgah
EndIf
If teksti$ = "jesse" And KeyHit(cbkeyreturn) Then
ShowObject pac, ON
EndIf
DrawGame
If teksti$ = "lopetus" And KeyHit(cbkeyreturn) Then
OpenCdTray(open=1)
_DLL_InitMemBlock()
_DLL_PutByte(open)
_DLL_CallDll("_OpenCdTray")
_DLL_DeleteMemBlock()
EndIf
UpdateEffects()
DrawToScreen
DrawScreen
Forever
omgah:
SCREEN 800, 600
// Ladataan tähtäin
imgSight = LoadImage("media/target.bmp")
ShowMouse imgSight
// Ladataan lehmä ja siirretään piirtopiste (hotspot) keskelle
Global imgCow
imgCow = LoadImage("media/torchic.bmp")
HotSpot imgCow, 15, 12
MaskImage imgCow,255,255,255
// Lehmätaulukko
Const NUM_COWS = 5
Const COW_X = 1
Const COW_Y = 2
Const COW_VEL = 3
Dim aCows#(NUM_COWS, 3)
For i = 1 To NUM_COWS
initCow(i)
Next i
Global iHit, iMiss, iDrown
iHit = 0: iMiss = 0: iDrown = 0
Randomize Timer()
ClsColor 128, 255, 255
Repeat
UpdateFrameTimer()
DrawScenery()
DrawCows()
UpdateEffects()
Color 140, 50, 200
Text 0, 20, "Osumia....: " + iHit
Text 0, 35, "Huteja....: " + iMiss
Text 0, 50, "Hukkuneita: " + iDrown
DrawScreen
Forever
Function InitCow(cowNum)
aCows(cowNum, COW_X) = Rnd(0, 800)
aCows(cowNum, COW_Y) = 0
aCows(cowNum, COW_VEL) = Rnd(80, 200)
End Function
Function DrawCows()
mx = MouseX()
my = MouseY()
bHit = False
// Otetaan mouseclick talteen
bMouseClick = MouseHit(1)
// Käydään lehmät läpi
For i = 1 To NUM_COWS
cx = aCows(i, COW_X)
cy = aCows(i, COW_Y)
If bMouseClick Then
// Jos ollaan ammuttu niin tarkistetaan etäisyys lehmään
If Distance(mx, my, cx, cy) < 15 Then
// Osui! Verta kehiin
Blood(mx, my)
iHit + 1
If iHit = 16 Then MakeError "Tapoit liikaa Torchiceja!"
// Lehmän ylösnousemus
InitCow(i)
bHit = True
EndIf
EndIf
DrawImage imgCow, cx, cy
aCows(i, COW_Y) = aCows(i, COW_Y) + aCows(i, COW_VEL) * FrameTime()
// Tippuiko lehmä veteen
If aCows(i, 2) > 500 Then
Water(cx, 500, aCows(i, COW_VEL))
iDrown + 1
// Ja uutta lehmää peliin
InitCow(i)
EndIf
Next i
// Jos ollaan ammuttu mutta tuli huti niin tehdään savypöllähdys
If bHit = False And bMouseClick = True Then
Smoke(mx, my)
iMiss + 1
EndIf
End Function
// <-- Piirretään lehmät
//==============================================================================
// Piirretään maisema
//==============================================================================
Function DrawScenery()
// Aurinko
Color 255, 255, 0
Circle 400, 50, 150, ON
// Auringonsäteet
For i = 0 To 18
a# = i * 20.0
s# = Sin(a)
c# = Cos(a)
x1 = 475 - s * 80
x2 = 475 - s * 130
y1 = 125 - c * 80
y2 = 125 - c * 130
Line x1, y1, x2, y2
Next i
// Pilvi
Color 255, 255, 255
Circle 250, 60, 80, ON
Circle 300, 70, 100, ON
Circle 400, 90, 80, ON
Circle 380, 130, 50, ON
Circle 370, 80, 50, ON
// Vesi
Color 0, 0, 255
Box 0, 500, 800, 100, ON
End Function
// <-- Piirretään maisema
//==============================================================================
// Veriroiske
//==============================================================================
Function Blood(x, y)
dir = 0 // Partikkelien lähtösuunta
range = 360 // Kuinka laajalle alueelle partikkelit leviää. Alkaen kulmasta "dir"
amount = 100 // Partikkelien lukumäärä
size1 = 1 // Pienin mahdollinen partikkeli
size2 = 10 // Suurin mahdollinen partikkeli
speed1 = 10 // Pienin lähtönopeus (pikseliä sekunnissa)
speed2 = 200 // Suurin lähtönopeus (pikseliä sekunnissa)
shrink1 = 30 // Pienin yksittäisen partikkelin kutistuma (pikseliä sekunnissa)
shrink2 = 30 // Suurin yksittäisen partikkelin kutistuma (pikseliä sekunnissa)
fade1 = 0 // Vaalennus/tummennus. Pienin nopeus (väriarvoa sekunnissa)
fade2 = 0 // Vaalennus/tummennus. Suurin nopeus (väriarvoa sekunnissa)
gx = 0 // Vaikutus sivuttaisliikkeeseem esim tuuli. (pikseliä sekunnissa)
gy = 600 // Vaikutus pystyliikkeesees esim painovoima. (pikseliä sekunnissa)
colors$ = "r,255" // Partikkelin väri on aina punainen
CreateColorParticleEffect(x, y, dir, range, amount, size1, size2, speed1, speed2, shrink1, shrink2, fade1, fade2, gx, gy, colors)
Return True
End Function
// <-- Veriroiske
//==============================================================================
// Vesiroiske
//==============================================================================
Function Water(x, y, power#)
dir = 45 // Partikkelien lähtösuunta
range = 90 // Kuinka laajalle alueelle partikkelit leviää. Alkaen kulmasta "dir"
amount = 100 // Partikkelien lukumäärä
size1 = 1 // Pienin mahdollinen partikkeli
size2 = power/20 // Suurin mahdollinen partikkeli
speed1 = 10 // Pienin lähtönopeus (pikseliä sekunnissa)
speed2 = power*2 // Suurin lähtönopeus (pikseliä sekunnissa)
shrink1 = 20 // Pienin yksittäisen partikkelin kutistuma (pikseliä sekunnissa)
shrink2 = 20 // Suurin yksittäisen partikkelin kutistuma (pikseliä sekunnissa)
fade1 = 300 // Vaalennus/tummennus. Pienin nopeus (väriarvoa sekunnissa)
fade2 = 300 // Vaalennus/tummennus. Suurin nopeus (väriarvoa sekunnissa)
gx = 0 // Vaikutus sivuttaisliikkeeseem esim tuuli. (pikseliä sekunnissa)
gy = 600 // Vaikutus pystyliikkeesees esim painovoima. (pikseliä sekunnissa)
colors$ = "b,255" // Partikkelin väri on aina sininen
CreateColorParticleEffect(x, y, dir, range, amount, size1, size2, speed1, speed2, shrink1, shrink2, fade1, fade2, gx, gy, colors)
Return True
End Function
// <-- Veriroiske
//==============================================================================
// Savupöllähdys
//==============================================================================
Function Smoke(x, y)
dir = 0 // Partikkelien lähtösuunta
range = 360 // Kuinka laajalle alueelle partikkelit leviää. Alkaen kulmasta "dir"
amount = 50 // Partikkelien lukumäärä
size1 = 10 // Pienin mahdollinen partikkeli
size2 = 30 // Suurin mahdollinen partikkeli
speed1 = 5 // Pienin lähtönopeus (pikseliä sekunnissa)
speed2 = 20 // Suurin lähtönopeus (pikseliä sekunnissa)
shrink1 = 20 // Pienin yksittäisen partikkelin kutistuma (pikseliä sekunnissa)
shrink2 = 20 // Suurin yksittäisen partikkelin kutistuma (pikseliä sekunnissa)
fade1 = -50 // Vaalennus/tummennus. Pienin nopeus (väriarvoa sekunnissa)
fade2 = -50 // Vaalennus/tummennus. Suurin nopeus (väriarvoa sekunnissa)
gx = 0 // Vaikutus sivuttaisliikkeeseem esim tuuli. (pikseliä sekunnissa)
gy = 0 // Vaikutus pystyliikkeesees esim painovoima. (pikseliä sekunnissa)
colors$ = "rgb,128-255" // Väriarvo väliltä 128-255 joka vaikuttaa jokaiseen värikomponenttiin
CreateColorParticleEffect(x, y, dir, range, amount, size1, size2, speed1, speed2, shrink1, shrink2, fade1, fade2, gx, gy, colors)
Return True
End Function
Siinä. Onko mitään mahdollisuutta toimimaan, please?!