Danke, fliegt jetzt in die richtige Richtung, aber ich kann nur einmal schießen

und ich will die Bullet in die Richtige Richtung drehen aber
dreht die Bullet ganz schnell im Kreis..
Code: Alles auswählen
Structure Bullet
x.w
y.w
Width.w
Height.w
Image.w
SpeedX.w
SpeedY.w
Angle.w
EndStructure
Global NewList Bullet.Bullet()
Procedure AddBullet(Sprite, x, y, SpeedX, SpeedY,Angle)
AddElement(Bullet())
Bullet()\x = x
Bullet()\y = y
Bullet()\Width = SpriteWidth(Sprite)
Bullet()\Height = SpriteHeight(Sprite)
Bullet()\Image = Sprite
Bullet()\SpeedX = SpeedX
Bullet()\SpeedY = SpeedY
Bullet()\Angle = Angle
EndProcedure
SchussSpeed = 5
Code: Alles auswählen
If KeyboardPushed(#PB_Key_Space) And Not Reloading
StartReloading = ElapsedMilliseconds()
SchussDX = SchussSpeed * Sin( SpaceShipAngle * #PI / 180 )
SchussDY = -SchussSpeed * Cos( SpaceShipAngle * #PI / 180 )
addBullet(#Bullet_0,DeskW/2,DeskH/2,SchussDX, SchussDY,SpaceShipAngle)
EndIf
ResetList(Bullet())
While NextElement(Bullet()) ; Process all the bullet actualy displayed on the screen
If Bullet()\y < 0 ; If a bullet is now out of the screen, simply delete it..
DeleteElement(Bullet())
Else
If Bullet()\x < 0 ; If a bullet is now out of the screen, simply delete it..
DeleteElement(Bullet())
Else
If Bullet()\x > DeskW-Bullet()\Width
DeleteElement(Bullet())
Else
If Bullet()\y > DeskH
DeleteElement(Bullet())
Else
DisplaySprite3D(Bullet()\Image, Bullet()\x, Bullet()\y) ; Display the bullet..
RotateSprite3D(Bullet()\Image,Bullet()\Angle,1)
Bullet()\y + Bullet()\SpeedY
Bullet()\x + Bullet()\SpeedX
EndIf
EndIf
EndIf
EndIf
Wend
MfG Tompazi