Scrolling ...(Bitte helft mir möchte weiter proggen )
Übersicht

![]() |
dimasterBetreff: Scrolling ...(Bitte helft mir möchte weiter proggen ) |
![]() Antworten mit Zitat ![]() |
---|---|---|
Code: [AUSKLAPPEN] Graphics 640,480 SetBuffer BackBuffer() Dim map(40,31) Dim Alien(359) TFormFilter 0 bild = LoadImage("alien.bmp") For Winkel = 0 To 359 Alien(Winkel) = CopyImage(bild) RotateImage Alien(Winkel), Winkel - 90 MidHandle Alien(Winkel) Next Geschwindigkeit = 3 X# = 300 Y# = 220 Repeat Cls For x = 0 To 40 For y = 0 To 31 DrawImage tileset,x*32-scrollx,y*32-scrolly,map(x,y) Next Next load() If KeyDown(203) Then scrollx = scrollx - 32 Winkel= Winkel - 3 EndIf If KeyDown(205) Then Winkel= Winkel + 3 scrollx = scrollx + 32 EndIf If Winkel > 359 Then Winkel = 0 If Winkel < 0 Then Winkel = 359 If KeyDown(200) Then ; Hoch scrolly = scrolly - 32 X = X - Cos(Winkel) * Geschwindigkeit Y = Y - Sin(Winkel) * Geschwindigkeit EndIf If KeyDown(208) Then ; Runter scrolly = scrolly + 32 X = X + Cos(Winkel) * Geschwindigkeit Y = Y + Sin(Winkel) * Geschwindigkeit EndIf DrawImage Alien(Winkel),X,Y Flip Until KeyHit(1) Function load() karte$ = ReadFile("maps/map1.map") For x = 0 To 40 For y = 0 To 31 tile = ReadLine(karte$) map(x,y) = ReadInt(karte$) Next Next CloseFile(karte$) End Function So gets nicht wie würdest es du machen? |
||
- Zuletzt bearbeitet von dimaster am Sa, Apr 10, 2004 15:15, insgesamt 3-mal bearbeitet
Edlothiol |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
Du hast da doch schon scrolling. Nur noch die Variablen scrollx und scrolly verändern, z.B. auf Tastendruck, fertig.
Das ist so natürlich nicht unbedingt schnell, besser wäre es natürlich noch nur den Bereich der Karte zu zeichnen der auch auf den Bildschirm kommt. |
||
Übersicht


Powered by phpBB © 2001 - 2006, phpBB Group