3D Kugel auf 2D Basis
Übersicht

timmeTheOnlyBetreff: 3D Kugel auf 2D Basis |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
Hier ein "Ding", welches aus Versehen entstanden ist (ich wollte eigentlich eine Feuerwerksrakete basteln):
Code: [AUSKLAPPEN] Graphics 1024,768,32,2
SetBuffer BackBuffer() SeedRnd MilliSecs() Const ParticleAddTime# = 1500 ; Erstellintervall der Partikel in Millisekunden Const ParticleAdd = 100 ; Anzahl der zu erstellenden Partikel bei Intervallablauf Type particle Field PosX#,PosY# Field Angle# Field Speed# Field r,g,b Field Health# End Type Global p.particle Global FPSTime#=millisecs(),FPSCount,FPS ; Wichtig für die FPS (Frames-Per-Second) Global MSecTime#=millisecs() ; Wichtig für das Erstellen der Partikel Global loopTime#, MSecLoopTime#=millisecs() ; Wichtig für Frameunabhängiges Programmieren While Not KeyHit(1) Cls loopTime# = (MilliSecs()-MSecLoopTime#)/1000.0 MSecLoopTime# = MilliSecs() If MilliSecs() - MSecTime# >= ParticleAddTime# Then For i = 0 To ParticleAdd p.particle = New particle p\PosX# = GraphicsWidth() / 2 p\PosY# = GraphicsHeight() / 2 If Rand(0,1) = 1 Then p\Angle# = Rnd(-80,-100) Else p\Angle# = Rnd(80,100) EndIf p\Speed# = Rnd(0,0.2) p\r = Rand(200,255) p\g = Rand(100,128) p\b = 0 p\Health# = 500 Next MSecTime# = MilliSecs() EndIf For p.particle = Each particle If p\Angle# <> 0 Then p\Angle# = p\Angle# + 100 * loopTime# EndIf If p\Speed# < 5 Then p\Speed# = p\Speed# + 2 * loopTime# EndIf p\PosX# = p\PosX# + Sin(p\Angle#) * p\Speed# p\PosY# = p\PosY# + Cos(p\Angle#) * p\Speed# rgb = p\r*$10000 + p\g*$100 + p\b Writepixel p\PosX#, p\PosY#, rgb, BackBuffer() p\Health# = p\Health# - 1 If p\Health# <= 0 Then Delete p EndIf Next FPS() Text 10, 30, MilliSecs() - MSecTime# Text 10, 50, loopTime# count = 0 For p.particle = Each particle count = count + 1 Next text 10, 70, count Flip Wend End Function FPS() FPSCount = FPSCount + 1 If MilliSecs() - FPSTime# >= 1000 Then FPS = FPSCount FPSCount = 0 FPSTime# = MilliSecs() EndIf Text 10, 10, "FPS: " + FPS End Function |
||
![]() |
BlitzChecker |
![]() Antworten mit Zitat ![]() |
---|---|---|
joa, ganz nice.
mit ein paar anpassungen bestimmt gut als "powerball" oder ähnliches zu gebrauchen... mfg BlitzChecker |
||
www.xairro.com |
![]() |
StepTiger |
![]() Antworten mit Zitat ![]() |
---|---|---|
sieht irgendwie komisch aus ![]() |
||
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 ![]() |
---|---|---|
Hm, da könnte man sicherlich nochmal was besseres draus machen. Aber sieht irgendwie ganz cool aus ![]() |
||
°_° °.° °~° °v° .. -.- |
Übersicht


Powered by phpBB © 2001 - 2006, phpBB Group