Fehler im Sourcecode mit Plot()
Verfasst: 23.11.2004 16:13
Hi,
hab folgende Frage:
wieso stürzt dieser Code ab, wenn ich in Zeile 53 "Plot" anstelle von "Circle" verwende? Ansonsten würde ich vielleicht den Code in den CodeArchiv tun, wegen der Berechnung der Schüsse
.
mfg. Kooky
hab folgende Frage:
wieso stürzt dieser Code ab, wenn ich in Zeile 53 "Plot" anstelle von "Circle" verwende? Ansonsten würde ich vielleicht den Code in den CodeArchiv tun, wegen der Berechnung der Schüsse
mfg. Kooky
Code: Alles auswählen
InitSprite()
InitMouse()
InitKeyboard()
OpenScreen(800,600,32,"")
Global speed.f
speed = 5
Structure shoot
x.f
y.f
rx.w
ry.w
richtungx.f
richtungy.f
multi.f
farbe.l
EndStructure
NewList shoots.shoot()
Repeat
ExamineKeyboard()
ExamineMouse()
If MouseButton(1)
AddElement(shoots())
shoots()\x = 400
shoots()\y = 300
shoots()\farbe=Random($FFFFFF)
shoots()\richtungx = (MouseX()-400)
shoots()\richtungy = (MouseY()-300)
shoots()\multi = Sqr(Pow(speed,2)/(Pow(shoots()\richtungx,2)+Pow(shoots()\richtungy,2)))
shoots()\richtungx = shoots()\richtungx * shoots()\multi
shoots()\richtungy = shoots()\richtungy * shoots()\multi
EndIf
ForEach Shoots()
Shoots()\x + Shoots()\richtungx
Shoots()\y + Shoots()\richtungy
Shoots()\rx = Shoots()\x
Shoots()\ry = Shoots()\y
If Shoots()\x < 0 Or Shoots()\x > 800 Or Shoots()\y < 0 Or Shoots()\y > 600
DeleteElement(Shoots())
NextElement(Shoots())
EndIf
Next
StartDrawing(ScreenOutput())
Plot(MouseX(),MouseY(),RGB(255,0,100))
ForEach Shoots()
Plot(Shoots()\x,Shoots()\y,Shoots()\Farbe) ;Circle(Shoots()\x,Shoots()\y,1,Shoots()\Farbe)
Next
Circle(400,300,10,$FF0010)
StopDrawing()
FlipBuffers()
Delay(10)
ClearScreen(0,0,0)
Until KeyboardPushed(#pb_key_escape)
End