Bewegte Bälle

Übersicht BlitzMax, BlitzMax NG Codearchiv & Module

Neue Antwort erstellen

Markus2

Betreff: Bewegte Bälle

BeitragSo, Jan 15, 2006 15:25
Antworten mit Zitat
Benutzer-Profile anzeigen
8)

user posted image
user posted image

Code:

'Dies ist eine BlitzMax Version von bewegte Baelle (Amiga)
'15.01.2006 M.Rauch

Strict
Global scw:Int=640,sch:Int=480,xoff:Int=scw/2.0,yoff:Int=sch/2.0
SetGraphicsDriver D3D7Max2DDriver()
'SetGraphicsDriver GLMax2DDriver()
Graphics scw,sch,16,72

Global rd:Int=110
Global r:Int,deh:Int,sup:Int,cy:Int,dx:Int,dy:Int,sc:Int,sn:Int,cs:Int
Global x:Int[731]
Global y:Int[731]
Global w:Int=0
'---------------------
For w=0 To 360
  x[w]=Sin(w*1.001)*rd
  y[w]=Cos(w*1.001)*rd
  x[w+360.0]=x[w]
  y[w+360.0]=y[w]
Next
'---------------------
For cy=0 To 10
  x[cy+720]=x[cy]
  y[cy+720]=y[cy]
Next
'---------------------
Global screen:TPixmap[7]
For sc=0 To 6
screen[sc]=CreatePixmap(scw,sch,PF_RGB888)
Next
Global imgBall:TPixmap=LoadPixmap("Kugel.bmp") '24x24 Pixel , Hintergrund schwarz
imgBall=ConvertPixmap(imgBall,PF_RGB888)

r=0
Global Ende:Int=0
Repeat
  For deh=0 To 360 Step 7
    sc=0
    For sup=0 To 6
      sn=deh+r+sup
      cs=deh+sup
      dx=x[sn]+xoff
      dy=y[cs]+yoff
      Blit screen[sc],imgBall,dx-12,dy-12 '-12 statt MidHandle
      DrawPixmap screen[sc],0,0
      Flip
      sc=sc+1
    Next
    If KeyHit(KEY_ESCAPE) Then Ende=1;Exit
  Next
  r=r+8
  If r>360 Then r=r-360
Until Ende=1
End
'---------------------
Function Blit(a:TPixmap,b:TPixmap,px:Int,py:Int)
 'Ball in Screen Bitmap kopieren
 Local x:Int,y:Int,c:Int
 For x=0 To PixmapWidth(b)-1
 For y=0 To PixmapHeight(b)-1
  c=ReadPixel(b,x,y) & $00ffffff
  If c Then WritePixel a,px+x,py+y,c
 Next
 Next
End Function
'---------------------

d-bug

BeitragSo, Jan 15, 2006 15:39
Antworten mit Zitat
Benutzer-Profile anzeigen
Hießen die Dinger früher nicht mal Bobs ?

...aber schicker oldschool Demo-FX Smile

greetz

Neue Antwort erstellen


Übersicht BlitzMax, BlitzMax NG Codearchiv & Module

Gehe zu:

Powered by phpBB © 2001 - 2006, phpBB Group