Springende Bälle[BB+|B3D]
Übersicht

![]() |
TheMatrixBetreff: Springende Bälle[BB+|B3D] |
![]() Antworten mit Zitat ![]() |
---|---|---|
Hi Leutz,
ich hatte wieder ganz dolle langeweile und dachte mir, ich prog zum Zeitvertreib eine Pixelfontäne. Nach mehereren herumgedüddel is aber was aber was ganz anderes draus geworden. Seht selbst: Code: [AUSKLAPPEN] Global wx=640,wy=480
Graphics wx,wy,16 Global grav#=0.4, wind#=0 Const key_up = 200, key_down = 208, key_right = 205, key_left = 203 Const key_return = 28, key_space = 57 Type pixel Field x#,y#,x2#,y2#,ziely End Type Global pixel.pixel fps = CreateTimer(50) : SetBuffer BackBuffer() ; Grafik Laden background = CreateImage(wx,wy) : SetBuffer ImageBuffer(background) ; Hintergrund y=wy For a=1 To 512 If y=380 Then start = a y = y-1 : Color a/4,a/4,a/2 Rect 0,y,wx,1 Next ; Hüpffläche für Partikel y=380 For a=start To 512 If y<220 Then Exit y = y-1 : Color a/3.4,a/3.4,a/1.7 Rect 100,y,450,1 Next Color 255,255,255 : Rect 100,220,450,159,0 SetBuffer BackBuffer() While Not KeyHit(1) WaitEvent(fps) ; WaitTimer(fps) ; Wenn du B3D-Nutzer bist, dann diese Zeile bitte benutzen. DrawBlock background,0,0 Text 0,0,"Gravity: "+grav# Text 0,15,"Wind: "+wind# Text 320,0,"Mit Rauf und Runter Gravity verändern" Text 320,15,"Mit Links und Rechts Wind verändern" If MilliSecs()>=hu+200 Then hu=MilliSecs() : create_pixel(320,300) If KeyDown(key_left) Then wind#=wind#-0.005 If KeyDown(key_right) Then wind#=wind#+0.005 If KeyDown(key_up) Then grav#=grav#-0.005 If KeyDown(key_down) Then grav#=grav#+0.005 draw_pixels() Flip Wend Function draw_pixels() For pixel=Each pixel x# = pixel\x# : y# = pixel\y# : x2# = pixel\x2# + wind#: y2#=pixel\y2# : y3 = pixel\ziely Color 255,255,255 s = 4+(y#/100) Oval x#+2,y#-2,s,s If x2#>-99999 y2#=y2#+grav# x# = x#+x2# : y# = y#+y2# End If If y2#>0 If (x#>96 And x#<540) And (y#>y3-5 And y#<y3+5) And y#<380 y3=y3+30 y2#=(y2#*-1)/2 End If End If pixel\x#=x : pixel\y#=y : pixel\x2#=x2# : pixel\y2#=y2# : pixel\ziely=y3 If x#<0 Or x#>wx Or y#>wy Or y#<-1500 Then Delete pixel Next End Function Function create_pixel(x,y) ;Mache 5 Bälle For a=1 To 5 pixel = New pixel pixel\x = x pixel\y = y pixel\x2# = Rnd(-3,3) pixel\y2# = Rnd(-10,-14) pixel\ziely = y+Rnd(-72,72) Next End Function |
||
- Zuletzt bearbeitet von TheMatrix am Do, Sep 21, 2006 12:13, insgesamt 4-mal bearbeitet
![]() |
SoNenTyp |
![]() Antworten mit Zitat ![]() |
---|---|---|
Schreib doch bitte dazu das es nur unter BlitzPlus läuft. | ||
Gruss Der Typ.
User posted image |
![]() |
StepTiger |
![]() Antworten mit Zitat ![]() |
---|---|---|
läuft auch in B3d
ersetzt waitevent durch waittimer |
||
Noch gestern standen wir am Abgrund, doch heute sind wir schon einen Schritt weiter.
Computer: AMD Sempron 3000+; ATI Radeon 9800 Pro; 512 MB DDR RAM 400Mhz; Asus E7N8X-E Deluxe; Samsung 200GB HD 5.4ns acces t Gewinner: BP Code Compo #2 Π=3.141592653589793238...<--- und das aus dem kopf ![]() Seit der Earthlings-Diskussion überzeugter Fleisch(fr)esser. |
![]() |
TheMatrix |
![]() Antworten mit Zitat ![]() |
---|---|---|
Hab im Quellcode noch WaitTimer hinzugefügt. Einfach das Remake davor wegmachen und Waitevent löschen.
Mfg |
||
![]() |
SoNenTyp |
![]() Antworten mit Zitat ![]() |
---|---|---|
Ahh wunderbar. Das ist noch viel besser als es nur als BP zu kenzeichnen.
Sieht nett aus. Wie kleine Tischtennis Bälle. |
||
Gruss Der Typ.
User posted image |
![]() |
TheMatrix |
![]() Antworten mit Zitat ![]() |
---|---|---|
So, habs nochmal modifiziert.
Mit Steuertasten Rauf und Runter kann die Gravity verändert werden. Mit Links und Rechts wird der Wind gesteuert. |
||
°_° °.° °~° °v° .. -.- |
Übersicht


Powered by phpBB © 2001 - 2006, phpBB Group