A_SetAngle

From ZDoom Wiki
Jump to: navigation, search

A_SetAngle (float angle)
A_SetAngle (float angle[, int flags]) (development version 67ebbe3 only)

Usage

Sets the calling actor's angle to angle. It can be used with the angle DECORATE variable to modify the actor's current angle.

Parameters

Examples

This zombie spins in circles in his spawn state.

ACTOR SpinningZombieMan:ZombieMan replaces ZombieMan
{
  States
  {  
  Spawn:
    POSS ABCD 4 A_SetAngle(15+angle)
    loop
  }
}

This firing state randomly jumps the view to the left or right using A_SetAngle.

Fire:
  TNT1 A 0 A_GunFlash
  TNT1 A 0 A_Jump(128, 2)
  TNT1 A 0 A_SetAngle(angle+((abs(velx)+abs(vely)+abs(velz))/10))
  TNT1 A 0 A_Jump(255, 1)
  TNT1 A 0 A_SetAngle(angle-((abs(velx)+abs(vely)+abs(velz))/10))
  TNT1 A 0 A_SetPitch(pitch-((abs(velx)+abs(vely)+abs(velz))/6))
  TNT1 A 0 A_PlaySound("Weapons/Pistol")
  PISG B 3 offset(3, 39) A_FireBullets(1, 1, -1, 12, "BulletPuff")
  PISG C 2 offset(2, 37)
  PISG D 2 offset(1, 35)
  TNT1 A 0 offset(0, 32)
  Goto Ready