Partikel Schussrichtung falsch
Verfasst: 16.09.2015 18:58
				
				Hallo,
habe das Problem das der Schuss einer Kanone, die auf nem Vehikel montiert ist und nach links und rechts schwenken kann,
nicht in die Richtung des Winkels der Kanone fliegt.
Kann da jemand helfen?
Der Code der Kanone und des Schusses habe ich unten gepostet.
Grüße
NeoRon
			habe das Problem das der Schuss einer Kanone, die auf nem Vehikel montiert ist und nach links und rechts schwenken kann,
nicht in die Richtung des Winkels der Kanone fliegt.
Kann da jemand helfen?
Der Code der Kanone und des Schusses habe ich unten gepostet.
Grüße
NeoRon
Code: Alles auswählen
  ;//---------------------------Player Weapon-----------------------
  ;//Start Speed  
  If weapon\Is_Rot = 1 Or weapon\dir = 1 
    weapon\Shall_Rot + weapon\Is_Rot
  EndIf
  If weapon\Is_Rot = -1 Or weapon\dir = -1 
    weapon\Shall_Rot - weapon\Is_Rot
  EndIf
  
  If weapon\rotation <= 0
    weapon\rotation = 0
  EndIf 
  
  ;// Rotate Weapon
  If weapon\Is_Rot = 1 Or weapon\Dir = 1
    weapon\rotation + weapon\Shall_Rot
  EndIf
  If weapon\Is_Rot = -1 Or weapon\Dir = -1
    weapon\rotation - weapon\Shall_Rot
  EndIf
  
  ;// Max Speed Weapon
  If weapon\Shall_Rot => 1
    weapon\Shall_Rot = 1
  EndIf
  
  ;// Set Direction Weapon
  If weapon\dir = -1 And weapon\Shall_Speed =< 0
    weapon\dir = 0
  EndIf
  If weapon\dir = 1 And weapon\Shall_Speed =< 0
    weapon\dir = 0
  EndIf  
  
  ;// MAX Weapon Bewegung 
  If weapon\rotation => 240 
    weapon\rotation = 240
  EndIf
  If weapon\rotation =< 120
    weapon\rotation = 120
  EndIf
  
  ;// MAX Weapon Is_Rot
  If weapon\rotation => 240
    weapon\Is_Rot = 0
  ElseIf weapon\rotation =< 120
    weapon\Is_Rot = 0
  EndIf
  ;//---------------------------Player Shoot-----------------------
  
  
  ;// Start Shoot
  If Weapon\Is_Shoot = 1
    ADDShoot(#SPRITE_PLAYER_SHOOT, 1, player\PositionX+145, player\PositionY-50, 6, Weapon\rotation)
  EndIf
  
  ForEach Shoot_Act_List()
    
    ;// Min Speed Shoot
    If Shoot_Act_List()\Shall_Speed <= 0
      Shoot_Act_List()\Shall_Speed = 0
    EndIf 
    ;// Max Speed Shoot
    If Shoot_Act_List()\Shall_Speed => 10
      Shoot_Act_List()\Shall_Speed = 10
    EndIf    
    
    ;// X und Y Bewegung
    Shoot_Act_List()\PositionY - Shoot_Act_List()\Shall_Speed 
    ; x=Cos(30*#PI/180) * timer 
    If Shoot_Act_List()\direction <180
      Shoot_Act_List()\PositionX = Sin(Shoot_Act_List()\direction*#PI/180)
    EndIf
    
    If Shoot_Act_List()\direction >180
      Shoot_Act_List()\PositionX = Cos(Shoot_Act_List()\direction*#PI/180)
    EndIf
       
  Next