Seite 1 von 3

Spaceship Attack V1.0

Verfasst: 07.01.2005 01:00
von AndyX
Guten Abend. :mrgreen:
Das Spiel Spaceship Attack von meinem Software-Team Twelve (siehe Signatur!!!) ist fertig. Also, es is nich ganz fertig, sinn sicher noch bugs drin, aber man kann es schon Spiel nennen. Der Sourcecode ist dabei, aber es ist sch*** unübersichtlich, weil ich noch die demo hab (ja, ich weiß ja, ich sollts mir endlich zulegen. :oops:) und es mehr als 200 Zeilen waren, darum hab ichs auch noch ziemlich gestaucht. Ladets mal runter und sagts mir wie es ist, was man verbessern kann... Für Vorschläge bin ich offen. :)

Meine Website

Es geht darum, das man mit dem Monster raumschiffe fangen muss. Näheres steht unter "Projekte".

Big THX im Voraus. :D

Mfg,
AndyX

Verfasst: 07.01.2005 01:47
von MVXA
Naja. Ich denke das weißt du auch selbst. Das Spiel ist ein bischen dürftig. Ich begreiffe nicht wo der Spielspaß sein soll, wenn man nur irgendwelche Raketen aufrisst. Ich hof am Spiel und am Konzept wird noch gearbeitet :|. Achja, schön das wenigstens du den Code lesen kannst.

Ich würd ja selber gern mal ein Spiel machen aber ich kann überhaupt nicht zeichen und mein Grafiker ist unglaublich faul, der übertrift sogar mich :mrgreen:.

Verfasst: 07.01.2005 02:08
von ts-soft
@AndyX
Welche Demo-Version verwendest Du denn? Bei Dir scheint OGG ja zu funktionieren. Bei mir mit der Vollversion 3.92 gibt es nee Windows-Fehlermeldung.

Verfasst: 07.01.2005 09:24
von Lebostein
Naja, wenig spektakulär. Ich nehme an dass du wegen der Demo auf 'mehr Spiel' verzichtet hast. Aber für die Demo-Einschränkungen ganz nett.

Was ich aber über alles hasse sind solche Installationsroutinen für kleine Programme und Spiele. Kannst du nicht einfach das Spiel in eine ZIP-Datei packen? So kann man es schnell entpacken, spielen und (bei Bedarf) einfach wieder löschen. So muss ich mich erst umständlich (wegen einer Handvoll Dateien, die sowieso alle im gleichen Ordner liegen) durch die Install-Routine quälen, es werden mir ohne Einverständnis Programmordner im Startmenü erstellt vielleicht sogar Registry-Einträge gesetzt... Sollte nur ein Hinweis sein. Ich glaube das Thema gabs schonmal hier im Forum.

Verfasst: 07.01.2005 16:05
von AndyX
ts-soft hat geschrieben:@AndyX
Welche Demo-Version verwendest Du denn? Bei Dir scheint OGG ja zu funktionieren. Bei mir mit der Vollversion 3.92 gibt es nee Windows-Fehlermeldung.
Ich verwende 3.90, bei mir hat die 3.92 auch nicht richtig gefunzt. :?
Vielleicht liegts auch dran, mit welchen Programm du es erstellt hast. Ich verwende Audacity. :allright:

@LittleFurz:
Ich weiß, das Spiel ist noch relativ blöd :D, aber ich werds auf jeden Fall verbessern.

@Lebostein:
Das mit der Installation musste sein, ich wollts mal ausprobieren. :wink:

Jedenfalls danke für eure zahlreichen Antworten.

Mfg,
AndyX

Verfasst: 07.01.2005 16:18
von ts-soft
Habe Vorsichtshalber die OGG-Dateien Deines Spieles benutzt. Würde mich ja interessieren ob noch jemand Probleme beim laden von OGG-Dateien hat oder ob mein PB nee Macke hat.

Die Installation finde ich auch überflüssig, zumal da nach Deinstallation 2 leere Ordner übrigbleiben.

Verfasst: 07.01.2005 16:48
von _ZOMTEX_
@ts-soft

OGG-Files funktionieren seit PB V 3.90 (mit UseOGGSoundDecoder()
) nicht mehr! Das muß Fred erst fixen, aber so weit ich weiß ist es ihm bekannt. Im Moment muß man sich anderweitig behilflich sein.

Gruß

Michael

Verfasst: 07.01.2005 17:21
von ts-soft
@_ZOMTEX_
danke :allright:

Verfasst: 07.01.2005 17:55
von M@xx
Der Sourcecode sieht ja cool aus :allright:
Ich habs mal ein bischen schöner gemacht (für die mit Vollversion :D):

Code: Alles auswählen

;{-Inits

InitSprite()
InitKeyboard()
InitSound()
InitMouse()
UseJPEGImageDecoder()
UseOGGSoundDecoder()

;}-

;{-Variablen

Global shipX.w
Global scroll.w
Global shipY.w
Global p.w
Global durch.b
Global Level.w

scroll=0
zahl=0
zahl2=0
Level=4


shipX = 820
shipY=Random(560)
ship2act=0
shipY2=Random(560)
shipX2=1600
ship3act=0
shipY3=Random(560)
shipX3=2600
ship4act=0
shipY4=Random(560)
shipX4=3800

;}-


;{-Sounds

LoadSound(6,"gaover.ogg")

LoadSound(22,"select.ogg")
SoundFrequency(22,12050)
SoundVolume(22,40)

LoadSound(12,"wecker.ogg")
SoundFrequency(12,22050)
SoundVolume(12,80)

LoadSound(20,"tada.wav")
SoundVolume(20,75)

;}-


;{-Sprites

LoadSprite(9,"space.bmp",0)
TransparentSpriteColor(9,255,255,255)

LoadSprite(88,"auswahl1.bmp",0)
TransparentSpriteColor(88,0,0,0)

LoadSprite(99,"auswahl2.bmp",0)
TransparentSpriteColor(99,0,0,0)

;}-


OpenScreen(800, 600, 32, "Spaceship Attack")


Goto menu


game:

PlaySound(4, 1)

Repeat
  ExamineKeyboard()
  ExamineMouse()
  
  ClearScreen(0, 0, 0)
  
  DisplaySprite(1, scroll, 0)
  DisplayTransparentSprite(0,MouseX()-43,MouseY()-25)
  
  
  If KeyboardPushed(1)
    e=1
  EndIf
  
  If MouseX()>shipX And MouseX()<shipX+20 And MouseY()>shipY And MouseY()<shipY+20
    shipY=Random(560)
    shipX = 820
    p+10
    PlaySound(5, 0)
  EndIf
  
  If MouseX()>shipX2 And MouseX()<shipX2+20 And MouseY()>shipY2 And MouseY()<shipY2+20
    shipY2=Random(560)
    shipX2=1600
    p+10
    PlaySound(5, 0)
  EndIf
  
  If MouseX()>shipX3 And MouseX()<shipX3+20 And MouseY()>shipY3 And MouseY()<shipY3+20
    shipY3=Random(560)
    shipX3=2600
    p+10
    PlaySound(5, 0)
  EndIf
  
  If MouseX()>shipX4 And MouseX()<shipX4+20 And MouseY()>shipY4 And MouseY()<shipY4+20
    shipY4=Random(560)
    shipX4=3800
    p+10
    PlaySound(5, 0)
  EndIf
  
  
  DisplayTransparentSprite(3, shipX2, shipY2)
  DisplayTransparentSprite(3,shipX3,shipY3)
  DisplayTransparentSprite(3,shipX4,shipY4)
  DisplayTransparentSprite(3,shipX, shipY)
  
  StartDrawing(ScreenOutput())
  DrawingMode(1)
  
  Locate(350, 0)
  FrontColor(155, 10, 20)
  DrawText("Punkte: "+Str(p))
  
  Locate(398, 585)
  FrontColor(40, 125, 10)
  DrawText(Str(durch))
  
  StopDrawing()
  
  
  FlipBuffers()
  
  
  shipX-Level
  
  If (p/200)+1>Level
    Level=Level+1
  EndIf
  
  
  If scroll=-596
    scroll=0
  Else
    scroll-2
  EndIf
  
  
  If ship2act=1
    shipX2-Level
  EndIf
  
  If ship3act=1
    shipX3-Level
  EndIf
  
  If ship4act=1
    shipX4-Level
  EndIf
  
  
  If p=100
    ship2act=1
  EndIf
  
  If p=350
    ship3act=1
  EndIf
  
  If p=560
    ship4act=1
  EndIf
  
  
  If shipX<-32
    durch+1
    shipX=820
    shipY=Random(560)
  EndIf
  
  If shipX2<-32
    durch+1
    shipX2=1600
    shipY2=Random(560)
  EndIf
  
  If shipX3<-32
    durch+1
    shipX3=2600
    shipY3=Random(560)
  EndIf
  
  If shipX4<-32
    durch+1
    shipX4=3800
    shipY4=Random(560)
  EndIf
  
  
Until e=1 Or durch=5

e=0

StopSound(4)

If CreateFile(0,"HI.bin")
  WriteString(Str(p))
Else
  End
EndIf

CloseFile(0)

FreeSound(4)
FreeSound(5)
FreeSprite(0)
FreeSprite(1)
FreeSprite(3)

scroll=0
Level=4
shipX=820
shipX2=1600
ship2act=0
ship3act=0
ship4act=0
shipX3=2600
shipX4=3800
durch=0


Goto gover


Ending:
CloseScreen()
End


menu:
ka=1
ausx=280
ausy=140
ausx1=420
ausy1=140
k=0

Repeat
  ClearScreen(0,0,50)
  
  DisplayTransparentSprite(9,130,1)
  
  StartDrawing(ScreenOutput())
  DrawingMode(1)
  
  Locate(320, 150)
  FrontColor(100, 0, 255)
  DrawText("Neues Spiel")
  
  Locate(323, 300)
  DrawText("High Score")
  Locate(325, 450)
  DrawText("Beenden")
  
  Locate(270, 583)
  FrontColor(145, 0, 0)
  DrawText("By Twelve Productions 2005.")
  
  StopDrawing()
  
  
  ExamineKeyboard()
  
  If KeyboardPushed(#PB_Key_1)
    PlaySound(22, 0)
    k=1
  ElseIf KeyboardPushed(#PB_Key_2)
    PlaySound(22, 0)
    k=2
  ElseIf KeyboardPushed(#PB_Key_Escape)
    k=3
    PlaySound(22, 0)
  EndIf
  
  
  DisplayTransparentSprite(88, ausx, ausy)
  DisplayTransparentSprite(99, ausx1, ausy1)
  
  FlipBuffers()
  
  
  If KeyboardPushed(#PB_Key_Down)
    ka+1
    If ka=4
      ka=1
      ausy=140
      ausy1=140
    Else
      ausy+150
      ausy1+150
    EndIf
    
    PlaySound(22, 0)
    
  EndIf
  
  If KeyboardPushed(#PB_Key_Up)
    ka-1
    
    If ka=0
      ka=3
      ausy=440
      ausy1=440
    Else
      ausy-150
      ausy1-150
    EndIf
    PlaySound(22, 0)
  EndIf
  
  If KeyboardPushed(#PB_Key_Return)
    k=ka
    PlaySound(22, 0)
  EndIf
  
  Delay(100)
  
Until k=1 Or k=2 Or k=3

If k=1
  Delay(400)
  Goto loading
  
ElseIf k=2
  Delay(400)
  Goto highscore
  
ElseIf k=3
  Delay(400)
  Goto Ending
  
EndIf


highscore:

ClearScreen(0, 0, 50)

DisplayTransparentSprite(9, 130, 1)

StartDrawing(ScreenOutput())
FrontColor(100, 0, 255)
DrawingMode(1)

Locate(310, 300)
DrawText("Du hast beim letzten Mal")

If OpenFile(5, "HI.bin")
  high$=ReadString()
  CloseFile(5)
  
  Locate(310, 320)
  DrawText(high$+" Punkte erreicht!")
  
Else
  Locate(310, 320)
  DrawText("Fehler erreicht!") 
  
EndIf

StopDrawing()

FlipBuffers()

e=0

PlaySound(20, 0)


Repeat
  ExamineKeyboard()
  
  If KeyboardPushed(1) Or KeyboardPushed(#PB_Key_Return)
    e=1
  EndIf
  
Until e=1

e=0
PlaySound(22, 0)
Delay(400)


Goto menu


loading:

ClearScreen(0, 0, 50)

DisplayTransparentSprite(9, 130, 1)

StartDrawing(ScreenOutput())
Locate(310, 300)
FrontColor(100, 0, 255)
ClearScreen(0,0,50)
Box(200, 300, 100, 30, RGB(0, 0, 255))
StopDrawing()

DisplayTransparentSprite(9, 130, 1)

FlipBuffers()

Delay(300)

LoadSound(4, "Music.ogg")
LoadSprite(0, "Eater1.bmp", 0)

ClearScreen(0, 0, 50)

SoundVolume(4, 45)

StartDrawing(ScreenOutput())
Box(200, 300, 200, 30, RGB(0, 0, 255))
StopDrawing()

DisplayTransparentSprite(9, 130, 1)


FlipBuffers()

Delay(500)

TransparentSpriteColor(0, 255, 255, 255)
LoadSprite(3,"ship1.bmp", #PB_Sprite_Texture)
TransparentSpriteColor(3, 255, 255, 255)

ClearScreen(0, 0, 50)

StartDrawing(ScreenOutput())
Box(200, 300, 300, 30, RGB(0, 0, 255))
StopDrawing()

DisplayTransparentSprite(9, 130, 1)

FlipBuffers()

Delay(400)

LoadSprite(1, "Background.jpg", 0)
LoadSound(5, "schluck.ogg")

ClearScreen(0,0,50)

StartDrawing(ScreenOutput())
Box(200,300,400,30, RGB(0,0,255))
StopDrawing()

DisplayTransparentSprite(9, 130, 1)

FlipBuffers()


For i=1 To 3
  ClearScreen(0, 0, 50)
  
  DisplayTransparentSprite(9, 130, 1)
  
  StartDrawing(ScreenOutput())
  DrawingMode(1)
  Box(200, 300, 400, 30, RGB(0, 0, 255))
  FrontColor(145, 0, 0)
  Locate(398, 368)
  DrawText(Str(i))
  StopDrawing()
  
  Delay(600)
  
  FlipBuffers()
  
Next i

PlaySound(12, 0)

Delay(850)


Goto game


gover:

PlaySound(6, 0)

ClearScreen(0, 0, 50)

DisplayTransparentSprite(9, 130, 1)

StartDrawing(ScreenOutput())
Locate(340, 300)
FrontColor(100, 0, 255)
DrawingMode(1)

DrawText("Game Over!")

Locate(340, 320)
DrawText(Str(p)+" Punkte!")

StopDrawing()


FlipBuffers()

Delay(5000)

p=0
Goto menu

Verfasst: 07.01.2005 18:09
von AndyX
M@xx:

Ja super, so isses übersichtlich!!! Nur kann ichs so nich kompilieren!! :( Sind 540 Zeilen! /:-> Na ja, kompilieren kann ichs ja auch mit dem Wirrwarr-Code, nur zum mitgeben sollte man den Code nehmen. :wink:
Aber ich werd jetzt n gscheites Spiel proggen, das is ja ziemlich fad.
Mein Gehirn hat wohl grade nen Aussetzer gehabt, als ich das Spiel gecodet hab. :oops:

Mfg,
AndyX