Je mehr Partickle desto...
Übersicht

![]() |
Mathias-KwiatkowskiBetreff: Je mehr Partickle desto... |
![]() Antworten mit Zitat ![]() |
---|---|---|
hi, leute es is ja kla das wenn wir mehrere partickel haben das es immer weniger FPS werden. aber wie kann man es so machen das man viele partickel hat das die fps nicht gleich unter 21 fällt?
z.b. wenn ich wow spiele habe ich ne fps von 78 bis 84 ( dort gibt es viele partickel ^^) mein code allerdings sagt mir das ich unter 21 fps komme, wie is das möglich? code: Code: [AUSKLAPPEN] Global PImg:TImage = LoadImage("data\particle.png")
MidHandleImage (PImg) Global PartickleList:TList = New TList Global Partickle:TPartickle Type TPartickle Field X:Float, Y:Float Field Speed:Float Field Timer:Int Field Alpha:Float Field R:Int Field G:Int Function Create(x:Float, y:Float) Partickle:TPartickle = New TPartickle Partickle.x = x + Rnd(-15, 15) Partickle.y = y + Rnd(-15, 15) Partickle.Speed = Rnd(0.1, 0.4) Partickle.Timer = MilliSecs() Partickle.Alpha = 1 Partickle.R = 0 Partickle.G = 255 PartickleList.Addlast Partickle End Function EndType Global Timer:Int = MilliSecs() Graphics 800,600 Repeat SetRotation (0) Cls SetColor 0, 255, 0 DrawLine 800 / 2, 0, 800 / 2, 600 DrawLine 0, 600 / 2, 800, 600 / 2 If (MilliSecs() - Timer) > 56 Then TPartickle.Create(800 / 2, 40) TPartickle.Create(800 / 2, 600 / 2) TPartickle.Create(800 / 2, 560) TPartickle.Create(100, 600 / 2) TPartickle.Create(700, 600 / 2) Timer = MilliSecs() EndIf SetColor 255, 255, 0 For Partickle:TPartickle = EachIn PartickleList SetRotation (Partickle.r) SetBlend ALPHABLEND SetAlpha Partickle.Alpha SetColor Partickle.g, Partickle.G, Partickle.G Plot Partickle.x, Partickle.y SetScale 30.0 / PImg.width, 30.0 / PImg.height DrawImage PImg, Partickle.x, Partickle.y SetAlpha 1 SetBlend MASKBLEND Partickle.R = Partickle.R + Rnd(0.5, 1.5) PlayerWinkel = (ATan2 (MouseY() - 600 / 2, MouseX() - 800 / 2) + 360) Mod 360 PlayerWinkel = PlayerWinkel + 180 If MouseX() < 800 / 2 Then Partickle.x = Partickle.x + Cos(PlayerWinkel) * 1 Else Partickle.x = Partickle.x + Cos(PlayerWinkel) *1 EndIf Partickle.y = Partickle.y + Sin(PlayerWinkel) * Rnd(0.3, 0.8) Partickle.Alpha = Partickle.Alpha - 0.0015 Partickle.G = Partickle.G - 1 If Partickle.G = 0 Then PartickleList.Remove Partickle If Partickle.Alpha <= 0 Then PartickleList.Remove Partickle Next SetColor 255, 255, 255 SetScale 1, 1 DrawText Fps(), 0, 0 Flip Until KeyDown(key_escape) End Function Fps:Int() Global show:Int, counter:Int = MilliSecs(), count:Int If MilliSecs()-counter >= 1000 Then counter = MilliSecs() show = count count = 0 End If count :+ 1 Return show End Function |
||
![]() |
HolzchopfMeisterpacker |
![]() Antworten mit Zitat ![]() |
---|---|---|
Versuch's mal ohne Plot (ist relativ langsam) und nimm die Zeitintensive Atan2-Spielerwinkelberechnung - überhaupt das ganze Maussteuerungszeugs - aus der Partikel-Mal-Schleife raus. Vielleicht bringt das schon einen kleinen Geschwindigkeitsschub.
mfG Holzchopf |
||
Erledige alles Schritt um Schritt - erledige alles. - Holzchopf
CC BY ♫ BinaryBorn - Yogurt ♫ (31.10.2018) Im Kopf da knackt's und knistert's sturm - 's ist kein Gedanke, nur ein Wurm |
![]() |
ZEVS |
![]() Antworten mit Zitat ![]() |
---|---|---|
Schnelle Effekte kannst du mit Winkeln kaum erreichen. Vektoren sind dafür schon besser geeignet.
Außerem solltest du einmal SetBlend ALPHABLEND aufrufen und danach einmal SetBlend MASKBLEND (wenn überhaupt) und zwischendurch die Partikel zeichnen. Wenn alles nichts hilft: Mach' es direkt mit OpenGL. Damit erhöhst du die Geschwindigkeit enorm. Es reicht BlitzMax: [AUSKLAPPEN] SetGraphicsDriver GLMax2DDriver() x1, y1, x2, y2, x3 und y3 sind drei Koordinaten, aus denen ein Dreieck gezeichnet wird. Du kannst diese durch particle.x+? und particley+? beliebig festsetzen. Ggf. musst du die Reihenfolge anpassen. ZEVS |
||
![]() |
Mathias-Kwiatkowski |
![]() Antworten mit Zitat ![]() |
---|---|---|
mhh danke werd es mir ansehen, sobald es die liebe zeit zulässt. | ||
Übersicht


Powered by phpBB © 2001 - 2006, phpBB Group