Seite 2 von 2

Verfasst: 16.05.2007 13:50
von skey-z
sieht gut aus und fehlt ja nicht mehr viel bis zu ner spielbaren Alpha

-Kollisionen
-Schüsse
-KI

erinnert mich an CS2D jedoch mit moderner Grafik

Verfasst: 16.05.2007 17:54
von dllfreak2001
So habe ich die Perspektive erzeugt....

Code: Alles auswählen

InitSprite()
InitKeyboard()
#screenw = 800
#screenh = 600

OpenScreen(#screenw,#screenh,32,"Perspektive mit Sprite3D")
Global posx.f, posy.f, gain.f, swh.l, shh.l
gain = 1.5

swh = #screenw/2
shh = #screenh/2

Repeat
  ExamineKeyboard()
  
  If KeyboardPushed(#PB_Key_Up)
    posy -10
  EndIf
  If KeyboardPushed(#PB_Key_Down)
    posy + 10
  EndIf
  If KeyboardPushed(#PB_Key_Left)
    posx-10
  EndIf
  If KeyboardPushed(#PB_Key_Right)
    posx+10
  EndIf
  
    If KeyboardPushed(#PB_Key_A)
    gain + 0.01
  EndIf
  If KeyboardPushed(#PB_Key_Z)
    gain - 0.01
  EndIf

  StartDrawing(ScreenOutput())
    LineXY(swh+posx-32,shh+posy-32,swh+(posx-32)*gain,shh+(posy-32)*gain,RGB(100,100,100))
    LineXY(swh+posx+32,shh+posy-32,swh+(posx+32)*gain,shh+(posy-32)*gain,RGB(100,100,100))
    LineXY(swh+posx+32,shh+posy+32,swh+(posx+32)*gain,shh+(posy+32)*gain,RGB(100,100,100))
    LineXY(swh+posx-32,shh+posy+32,swh+(posx-32)*gain,shh+(posy+32)*gain,RGB(100,100,100))
    
    LineXY(swh+(posx-32)*gain,shh+(posy-32)*gain,swh+(posx+32)*gain,shh+(posy-32)*gain,RGB(100,100,100))
    LineXY(swh+(posx+32)*gain,shh+(posy-32)*gain,swh+(posx+32)*gain,shh+(posy+32)*gain,RGB(100,100,100))
    LineXY(swh+(posx+32)*gain,shh+(posy+32)*gain,swh+(posx-32)*gain,shh+(posy+32)*gain,RGB(100,100,100))
    LineXY(swh+(posx-32)*gain,shh+(posy+32)*gain,swh+(posx-32)*gain,shh+(posy-32)*gain,RGB(100,100,100))
    
    
    Circle(swh+posx-32,shh+posy-32,3,RGB(255,255,0))
    Circle(swh+posx+32,shh+posy-32,3,RGB(255,255,0))
    Circle(swh+posx+32,shh+posy+32,3,RGB(255,255,0))
    Circle(swh+posx-32,shh+posy+32,3,RGB(255,255,0))
    
    Circle(swh+(posx-32)*gain,shh+(posy-32)*gain,3,RGB(0,255,0))
    Circle(swh+(posx+32)*gain,shh+(posy-32)*gain,3,RGB(0,255,0))
    Circle(swh+(posx+32)*gain,shh+(posy+32)*gain,3,RGB(0,255,0))
    Circle(swh+(posx-32)*gain,shh+(posy+32)*gain,3,RGB(0,255,0))
    
    DrawText(0,0,StrF(gain,2))
  StopDrawing()

  FlipBuffers()
  ClearScreen(0)


Until KeyboardPushed(#PB_Key_Escape)
CloseScreen()

Verfasst: 16.05.2007 21:11
von AndyX
sieht echt gut aus!

Verfasst: 17.05.2007 11:09
von dllfreak2001
Ich wurde grad darauf angesprochen...

Die Grafiken dürft ihr für eigene Projekte natürlich benutzen...