Server und Client?
Verfasst: 23.09.2005 15:25
Hallo,
Ich bin relativ neu in PB und wollte mal ein kleines Spiel programmieren.
Es ist eine art Rollenspiel.
Das game wollte ich auch online spielbar machen, also brauche ich einen Client und einen Server.
Nur, wie macht man einen? Welche befehle brauche ich?
kann mir da einer weiterhelfen?
Ich hab auch noch einige fragen zum spiel selbst:
Wie kann ich eine animation machen, dass sich die Figur beim laufen bewegt?
Wie macht man einen Mapwechsel?
Das ist mein code bis jetzt:
mfg Sv
Edit by Kiffi: Code-Tags gesetzt und Code formatiert
Ich bin relativ neu in PB und wollte mal ein kleines Spiel programmieren.
Es ist eine art Rollenspiel.
Das game wollte ich auch online spielbar machen, also brauche ich einen Client und einen Server.
Nur, wie macht man einen? Welche befehle brauche ich?
kann mir da einer weiterhelfen?
Ich hab auch noch einige fragen zum spiel selbst:
Wie kann ich eine animation machen, dass sich die Figur beim laufen bewegt?
Wie macht man einen Mapwechsel?
Das ist mein code bis jetzt:
Code: Alles auswählen
If InitSprite() = 0
MessageRequester("Fehler","Konnte dx nicht finden",0)
EndIf
If InitKeyboard()=0
MessageRequester("Fehler","Konnte dx nicht finden",0)
EndIf
If OpenScreen(1280,1024,32,"Vollbild") = 0
MessageRequester("Fehler","Konnte kein Vollbild erstellen ",0)
EndIf
LoadSprite(0,"data\playerB.bmp",0)
LoadSprite(1,"data\wall.bmp",0)
LoadSprite(2,"data\rasen.bmp",0)
LoadSprite(3,"data\playerF.bmp",0)
LoadSprite(4,"data\playerL.bmp",0)
LoadSprite(5,"data\playerR.bmp",0)
LoadSprite(6,"data\map1street.bmp",0)
LoadSprite(7,"data\map2street.bmp",0)
position_x = 0
position_y = 0
look = 3
level = 1
Repeat
FlipBuffers()
ClearScreen(31,80,33)
ExamineKeyboard()
If KeyboardPushed(#PB_Key_Right)
position_x + 2
look = 5
If position_x > 1000
position_x = 1000
EndIf
EndIf
If KeyboardPushed(#PB_Key_Left)
position_x - 2
look = 4
If position_x < 0
position_x = 0
EndIf
EndIf
If KeyboardPushed(#PB_Key_Up)
position_y - 2
look = 0
If position_y < 0
position_y = 0
EndIf
If KeyboardPushed(#PB_Key_F1)
EndIf
EndIf
If KeyboardPushed(#PB_Key_Down)
position_y + 2
look = 3
If position_y > 1000
position_y = 1000
EndIf
EndIf
If SpriteCollision(look,position_x,position_y,1,200,200) = 1
position_y + 5
EndIf
DisplayTransparentSprite(look,position_x,position_y)
If SpriteCollision(look,position_x,position_y,1,232,200) = 1
position_y + 5
EndIf
DisplayTransparentSprite(look,position_x,position_y)
If SpriteCollision(look,position_x,position_y,1,264,200) = 1
position_y + 5
If SpriteCollision(look,position_x,position_y,0,10,287) = 1
level = 2
EndIf
EndIf
If level = 1
DisplayTransparentSprite(2,0,0)
DisplayTransparentSprite(1,296,200)
DisplayTransparentSprite(1,264,200)
DisplayTransparentSprite(1,232,200)
DisplayTransparentSprite(1,200,200)
DisplayTransparentSprite(6,0,0)
DisplayTransparentSprite(look,position_x,position_y)
EndIf
If level = 2
DisplayTransparentSprite(7,0,0)
DisplayTransparentSprite(look,position_x,position_y)
EndIf
If KeyboardPushed(#PB_Key_Escape)
End
EndIf
ForEver
Edit by Kiffi: Code-Tags gesetzt und Code formatiert